[GRASS-user] r.sun for selected points

Hello,

I'm trying to generate solar irradiance data for a set of points (which
requires r.horizon and r.sun output). My data covers most of eastern
North America at 20m by 20m resolution. This is beyond the capacity of
my computer to process. However, I don't need complete maps for this
area. I only need the beam values for ca. 10,000 point locations. I
expect it would be possible to do this on my laptop, but I can't figure
out how to limit the analysis to these spots. Is it possible? Does
anyone have any suggestions?

I've also asked my local tech people to install GRASS on our cluster,
that's turned into a complicated procedure of its own.

Best,

Tyler

Il 13/08/2014 22:46, Tyler Smith ha scritto:

  but I can't figure
out how to limit the analysis to these spots. Is it possible? Does
anyone have any suggestions?

Hi Tyler,

you sure can use the region settings and the r.mask GRASS module to
limit the analysis area:

use
"g.region" and "r.mask"

roy

On Thu, Aug 14, 2014, at 02:42 AM, roy wrote:

Il 13/08/2014 22:46, Tyler Smith ha scritto:
> but I can't figure
> out how to limit the analysis to these spots. Is it possible? Does
> anyone have any suggestions?
>

you sure can use the region settings and the r.mask GRASS module to
limit the analysis area:

use
"g.region" and "r.mask"

Thanks Roy.

I've tried this. However, the spread of my points covers most of the
area involved. So I can't reduce the total area very much, especially
when I need to keep a buffer around the points for r.horizon. What I'm
looking for is a way to tell GRASS to calculate r.horizon values only
for a list of points, rather than an area. And for the second step, to
calculate r.sun beam values using the same points.

Best,

Tyler

Tyler Smith:

> but I can't figure out how to limit the analysis to these spots.
> Is it possible? Does anyone have any suggestions?

roy:

you sure can use the region settings and the r.mask GRASS module to
limit the analysis area: use "g.region" and "r.mask"

Tyler:

I've tried this. However, the spread of my points covers most of the
area involved. So I can't reduce the total area very much, especially
when I need to keep a buffer around the points for r.horizon. What I'm
looking for is a way to tell GRASS to calculate r.horizon values only
for a list of points, rather than an area. And for the second step, to
calculate r.sun beam values using the same points.

Questions and ideas that might help:

How dense is your point data-set? What is the spatial resolution your aiming at? Could latitude be your criterion in eliminating (somehow) points? It's an important factor in estimating solar irradiation. Maybe take ideas from existing maps (10km seems to be a high resolution value for solar irradiance mapping).

Nikos

On Wed, Aug 13, 2014 at 4:46 PM, Tyler Smith <tyler@plantarum.ca> wrote:

I'm trying to generate solar irradiance data for a set of points (which
requires r.horizon and r.sun output). My data covers most of eastern
North America at 20m by 20m resolution. This is beyond the capacity of
my computer to process. However, I don't need complete maps for this
area. I only need the beam values for ca. 10,000 point locations. I
expect it would be possible to do this on my laptop, but I can't figure
out how to limit the analysis to these spots. Is it possible? Does
anyone have any suggestions?

I'm not sure if I see all the details but if you can script in Python or
Bash you can do something like iteration over all points using PyGRASS or
v.out.ascii and textual processing (the later applies also for external
files with points) and then set computation region using g.region around
each point to sufficient extent. Then you compute the r.horizon and r.sun
just in the specified (computational) region and store the results as maps
and as text (using e.g. r.univar or v.what.rast). Does this make sense?

On Thu, Aug 14, 2014, at 02:29 PM, Vaclav Petras wrote:

On Wed, Aug 13, 2014 at 4:46 PM, Tyler Smith <tyler@plantarum.ca> wrote:

I’m trying to generate solar irradiance data for a set of points (which

requires r.horizon and r.sun output). My data covers most of eastern

North America at 20m by 20m resolution. This is beyond the capacity of

my computer to process. However, I don’t need complete maps for this

area. I only need the beam values for ca. 10,000 point locations. I

expect it would be possible to do this on my laptop, but I can’t figure

out how to limit the analysis to these spots. Is it possible? Does

anyone have any suggestions?

I’m not sure if I see all the details but if you can script in Python or Bash you can do something like iteration over all points using PyGRASS or v.out.ascii and textual processing (the later applies also for external files with points) and then set computation region using g.region around each point to sufficient extent. Then you compute the r.horizon and r.sun just in the specified (computational) region and store the results as maps and as text (using e.g. r.univar or v.what.rast). Does this make sense?

Thanks, Vaclav.

That makes sense. I know enough bash to try that out.

Best,

Tyler

On 14/08/14 12:46 PM, Nikos Alexandris wrote:

Questions and ideas that might help:

How dense is your point data-set? What is the spatial resolution your aiming at? Could latitude be your criterion in eliminating (somehow) points? It's an important factor in estimating solar irradiation. Maybe take ideas from existing maps (10km seems to be a high resolution value for solar irradiance mapping).

Thanks, Nikos.

We are trying to model habitat for a plant species that appears to prefer particular slope positions, often in steep ravines. So we need a very high resolution to capture shading from surrounding topography. 20m-sq cells is the resolution of our DEM, and biologically we can't use a coarser resolution. The data set is fairly dense, such that I can't see any obvious ways to simply block out areas within the larger map. I may try the scripting approach that Vaclav suggested instead.

Best,

Tyler

On Thu, Aug 14, 2014 at 8:42 AM, roy <royroge@outlook.com> wrote:

Il 13/08/2014 22:46, Tyler Smith ha scritto:

  but I can't figure
out how to limit the analysis to these spots. Is it possible? Does
anyone have any suggestions?

Hi Tyler,

you sure can use the region settings and the r.mask GRASS module to
limit the analysis area:

use
"g.region" and "r.mask"

Keep in mind the shading effect of surrounding mountains which
requires that the area must be larger than the pixel of interest.
You could calculate the viewshed with r.viewshed in order to estimate
the minimum area to be considered for a pixel.
Then put all into a loop.

Markus

On Fri, Aug 15, 2014, at 04:30 PM, Markus Neteler wrote:

On Thu, Aug 14, 2014 at 8:42 AM, roy <royroge@outlook.com> wrote:
>
> Il 13/08/2014 22:46, Tyler Smith ha scritto:
>
>> but I can't figure
>> out how to limit the analysis to these spots. Is it possible? Does
>> anyone have any suggestions?
>>
> Hi Tyler,
>
> you sure can use the region settings and the r.mask GRASS module to
> limit the analysis area:
>
> use
> "g.region" and "r.mask"

Keep in mind the shading effect of surrounding mountains which
requires that the area must be larger than the pixel of interest.
You could calculate the viewshed with r.viewshed in order to estimate
the minimum area to be considered for a pixel.
Then put all into a loop.

That's a good idea, thanks. At the moment I've got r.horizon running on
a server (12CPU, 32G RAM). I broke the area up into a dozen overlapping
areas, and it seems to be working. When I get to r.sun I may try
scripting a loop as you've suggested.

Best,

Tyler