[GRASS-user] r.sun annual radiation

Hi,

I want to generate a cumulative annual map for solar radiation (W/m2/yr). It is possible with r.sun? There is a script to do this?

Thanks,

Salvatore

On Wed, Aug 24, 2011 at 12:21 PM, Salvatore Mellino
<salvatore.mellino@gmail.com> wrote:

Hi,

I want to generate a cumulative annual map for solar radiation (W/m2/yr). It
is possible with r.sun? There is a script to do this?

You can find a ascript here:

http://www.grassbook.org/examples_menu2nd.php
-> rsun_crop.sh

If you have complex terrain, you will want to add the "-s" flag for the shadow
correction.

Markus

Dear Markus,

I try to use rsun_crop.sh, but I received same error message, where I make a mistake?

Computing radiation for day 075...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27151 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.075>
Invalid map <d_rad.075>
Invalid map <r_rad.075>
Parse error
ERROR: Map <b_rad.075> not found in current mapset
ERROR: Raster map <b_rad.075> not found
ERROR: Map <d_rad.075> not found in current mapset
ERROR: Raster map <d_rad.075> not found
ERROR: Map <r_rad.075> not found in current mapset
ERROR: Raster map <r_rad.075> not found
Computing radiation for day 076...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27188 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.076>
Invalid map <d_rad.076>
Invalid map <r_rad.076>
Parse error
ERROR: Map <b_rad.076> not found in current mapset
ERROR: Raster map <b_rad.076> not found
ERROR: Map <d_rad.076> not found in current mapset
ERROR: Raster map <d_rad.076> not found
ERROR: Map <r_rad.076> not found in current mapset
ERROR: Raster map <r_rad.076> not found
Computing radiation for day 077...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27214 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.077>
Invalid map <d_rad.077>
Invalid map <r_rad.077>
Parse error
ERROR: Map <b_rad.077> not found in current mapset
ERROR: Raster map <b_rad.077> not found
ERROR: Map <d_rad.077> not found in current mapset
ERROR: Raster map <d_rad.077> not found
ERROR: Map <r_rad.077> not found in current mapset
ERROR: Raster map <r_rad.077> not found
Computing radiation for day 078...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27249 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.078>
Invalid map <d_rad.078>
Invalid map <r_rad.078>
Parse error
ERROR: Map <b_rad.078> not found in current mapset
ERROR: Raster map <b_rad.078> not found
ERROR: Map <d_rad.078> not found in current mapset
ERROR: Raster map <d_rad.078> not found
ERROR: Map <r_rad.078> not found in current mapset
ERROR: Raster map <r_rad.078> not found
Computing radiation for day 079...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27285 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.079>
Invalid map <d_rad.079>
Invalid map <r_rad.079>
Parse error
ERROR: Map <b_rad.079> not found in current mapset
ERROR: Raster map <b_rad.079> not found
ERROR: Map <d_rad.079> not found in current mapset
ERROR: Raster map <d_rad.079> not found
ERROR: Map <r_rad.079> not found in current mapset
ERROR: Raster map <r_rad.079> not found
Computing radiation for day 080...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27320 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.080>
Invalid map <d_rad.080>
Invalid map <r_rad.080>
Parse error
ERROR: Map <b_rad.080> not found in current mapset
ERROR: Raster map <b_rad.080> not found
ERROR: Map <d_rad.080> not found in current mapset
ERROR: Raster map <d_rad.080> not found
ERROR: Map <r_rad.080> not found in current mapset
ERROR: Raster map <r_rad.080> not found
Computing radiation for day 081...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27356 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.081>
Invalid map <d_rad.081>
Invalid map <r_rad.081>
Parse error
ERROR: Map <b_rad.081> not found in current mapset
ERROR: Raster map <b_rad.081> not found
ERROR: Map <d_rad.081> not found in current mapset
ERROR: Raster map <d_rad.081> not found
ERROR: Map <r_rad.081> not found in current mapset
ERROR: Raster map <r_rad.081> not found
Computing radiation for day 082...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27391 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.082>
Invalid map <d_rad.082>
Invalid map <r_rad.082>
Parse error
ERROR: Map <b_rad.082> not found in current mapset
ERROR: Raster map <b_rad.082> not found
ERROR: Map <d_rad.082> not found in current mapset
ERROR: Raster map <d_rad.082> not found
ERROR: Map <r_rad.082> not found in current mapset
ERROR: Raster map <r_rad.082> not found
Computing radiation for day 083...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27420 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.083>
Invalid map <d_rad.083>
Invalid map <r_rad.083>
Parse error
ERROR: Map <b_rad.083> not found in current mapset
ERROR: Raster map <b_rad.083> not found
ERROR: Map <d_rad.083> not found in current mapset
ERROR: Raster map <d_rad.083> not found
ERROR: Map <r_rad.083> not found in current mapset
ERROR: Raster map <r_rad.083> not found
Computing radiation for day 084...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27453 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.084>
Invalid map <d_rad.084>
Invalid map <r_rad.084>
Parse error
ERROR: Map <b_rad.084> not found in current mapset
ERROR: Raster map <b_rad.084> not found
ERROR: Map <d_rad.084> not found in current mapset
ERROR: Raster map <d_rad.084> not found
ERROR: Map <r_rad.084> not found in current mapset
ERROR: Raster map <r_rad.084> not found
Computing radiation for day 085...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27488 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY
Invalid map <b_rad.085>
Invalid map <d_rad.085>
Invalid map <r_rad.085>
Parse error
ERROR: Map <b_rad.085> not found in current mapset
ERROR: Raster map <b_rad.085> not found
ERROR: Map <d_rad.085> not found in current mapset
ERROR: Raster map <d_rad.085> not found
ERROR: Map <r_rad.085> not found in current mapset
ERROR: Raster map <r_rad.085> not found
Computing radiation for day 086...
Mode 2: integrated daily irradiation for a given day of the year
^C 0%
Il giorno 24/ago/2011, alle ore 13:37, Markus Neteler ha scritto:

On Wed, Aug 24, 2011 at 12:21 PM, Salvatore Mellino
<salvatore.mellino@gmail.com> wrote:

Hi,

I want to generate a cumulative annual map for solar radiation (W/m2/yr). It
is possible with r.sun? There is a script to do this?

You can find a ascript here:

http://www.grassbook.org/examples_menu2nd.php
-> rsun_crop.sh

If you have complex terrain, you will want to add the "-s" flag for the shadow
correction.

Markus

Hello all

I have a problem getting GRASS to run on windows having downloaded through the OSGeo4W installer (quick install). GRASS works prefectly through QGIS (including shell commands) but fails to load from the shortcuts or start menu. Unfortunately the shell drops out immediately so I am unable to read exactly what the problem is but I think that it might be unable to find the init file in the specified location.

I am currently not working on my own computer but in a computer lab (in Italy) so to the best of my knowledge the set up is as follows:

GRASS 6.4.1
Windows 7 (with admin rights ,not sure if 32 or 64bit)

If anyone has come across this issue before or has any ideas to resolve it I (and my students) would be very grateful to hear from you!

Thanks for reading,

Rebecca Bennett

Postgraduate Researcher (Archaeology Group)
Bournemouth University

Mode 2: integrated daily irradiation for a given day of the year
^C 0%
Il giorno 24/ago/2011, alle ore 13:37, Markus Neteler ha scritto:

On Wed, Aug 24, 2011 at 12:21 PM, Salvatore Mellino
<salvatore.mellino@gmail.com> wrote:

Hi,

I want to generate a cumulative annual map for solar radiation (W/m2/yr). It
is possible with r.sun? There is a script to do this?

You can find a ascript here:

http://www.grassbook.org/examples_menu2nd.php
→ rsun_crop.sh

If you have complex terrain, you will want to add the “-s” flag for the shadow
correction.

Markus


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hello,
no idea where the problem could be.
Here are some steps to try to get more information:
1) right click one of launcher icons and find out GRASS location;
2) run cmd.exe
3) cd to GRASS installation directory
4) type in GRASS startup script name (see step 1)
5) google for error message
6) fiddle around more
7) install GRASS nightly from http://wingrass.fsv.cvut.cz/grass64/
8) fall into despair as nothing works
9) remove Windows and replace it with GNU/Linux
10) just to find out that YOURDISTROCHOICE packages are broken
11) go to nearest bar to take a few shots of whiskey - only thing that works.

Just follow those steps as long as You want to. You can stop after 5th
one and return to ML too.
Maris.

2011/8/29 Rebecca Bennett <rabennett@ymail.com>:

Hello all

I have a problem getting GRASS to run on windows having downloaded through
the OSGeo4W installer (quick install). GRASS works prefectly through QGIS
(including shell commands) but fails to load from the shortcuts or start
menu. Unfortunately the shell drops out immediately so I am unable to read
exactly what the problem is but I think that it might be unable to find the
init file in the specified location.

I am currently not working on my own computer but in a computer lab (in
Italy) so to the best of my knowledge the set up is as follows:

GRASS 6.4.1
Windows 7 (with admin rights ,not sure if 32 or 64bit)

If anyone has come across this issue before or has any ideas to resolve it I
(and my students) would be very grateful to hear from you!

Thanks for reading,

Rebecca Bennett

Postgraduate Researcher (Archaeology Group)
Bournemouth University

Mode 2: integrated daily irradiation for a given day of the year
^C 0%
Il giorno 24/ago/2011, alle ore 13:37, Markus Neteler ha scritto:

On Wed, Aug 24, 2011 at 12:21 PM, Salvatore Mellino
<salvatore.mellino@gmail.com> wrote:

Hi,

I want to generate a cumulative annual map for solar radiation (W/m2/yr).
It
is possible with r.sun? There is a script to do this?

You can find a ascript here:

http://www.grassbook.org/examples_menu2nd.php
-> rsun_crop.sh

If you have complex terrain, you will want to add the "-s" flag for the
shadow
correction.

Markus

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Mon, Aug 29, 2011 at 2:08 PM, Salvatore Mellino
<salvatore.mellino@gmail.com> wrote:

Dear Markus,

I try to use rsun_crop.sh, but I received same error message, where I make a mistake?

Computing radiation for day 075...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27151 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY

wow, it triggers a Segmentation fault.
I can replicate that.

I have filed it as ticket
http://trac.osgeo.org/grass/ticket/1431

Markus

On Wed, Aug 31, 2011 at 9:59 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Mon, Aug 29, 2011 at 2:08 PM, Salvatore Mellino
<salvatore.mellino@gmail.com> wrote:

Dear Markus,

I try to use rsun_crop.sh, but I received same error message, where I make a mistake?

Computing radiation for day 075...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27151 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY

wow, it triggers a Segmentation fault.
I can replicate that.

I have filed it as ticket
http://trac.osgeo.org/grass/ticket/1431

Hamish has sync'ed r.sun2 in 6.4svn with existing 6.5svn fixes in r47993.
No more segfault, ticket has been closed.

Lessons learned (from https://trac.osgeo.org/grass/ticket/498),
- no need to define slope and aspect maps, done automatically by r.sun
- no need to define latitude

Find the updated script attached.

Markus

(attachments)

rsun_crop_grass6.sh (1.1 KB)

Hi,

thanks for the script, it works. I want to be sure that the result is the global radiation map expressed in W/m2/yr (or it is W/pixel/yr?). I compare it with ones made with ArcGis and the values are differents.
Another question…the albedo effect is excluded?

Thanks

Salvatore

Il giorno 31/ago/2011, alle ore 17:43, Markus Neteler ha scritto:

On Wed, Aug 31, 2011 at 9:59 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Mon, Aug 29, 2011 at 2:08 PM, Salvatore Mellino
<salvatore.mellino@gmail.com> wrote:

Dear Markus,

I try to use rsun_crop.sh, but I received same error message, where I make a mistake?

Computing radiation for day 075...
Mode 2: integrated daily irradiation for a given day of the year
/Applications/GRASS-6.4.app/Contents/MacOS/scripts/rsun_crop.sh: line 42: 27151 Segmentation fault: 11 r.sun elevin=SOLelev aspin=SOLaspect slopein=SOLslope lat="$lat" day="$i" beam_rad=b_rad.$DAY diff_rad=d_rad.$DAY refl_rad=r_rad.$DAY

wow, it triggers a Segmentation fault.
I can replicate that.

I have filed it as ticket
http://trac.osgeo.org/grass/ticket/1431

Hamish has sync'ed r.sun2 in 6.4svn with existing 6.5svn fixes in r47993.
No more segfault, ticket has been closed.

Lessons learned (from https://trac.osgeo.org/grass/ticket/498),
- no need to define slope and aspect maps, done automatically by r.sun
- no need to define latitude

Find the updated script attached.

Markus
<rsun_crop_grass6.sh>

Salvatore wrote:

thanks for the script, it works. I want to be sure that the
result is the global radiation map expressed in W/m2/yr (or
it is W/pixel/yr?). I compare it with ones made with ArcGis
and the values are differents.

how much different? just by a few percent or wildly different?

I have just done some back-of-the-envelope calculations based
on Spearfish's latitude on Sept 21st and the solar constant,
both instantaneous at 12 noon, and a rough integration over the
day, and both answers of my very crude calcs come within 3% and
8% of the presumably much more correct r.sun results. (and I'd
expect the atm scattering to take more out in the dawn/dusk
hours so that increase to 8% diff for the daily sum doesn't
worry me) So they would seem to me to be in the correct order of
magnitude.

It is not surprising that ESRI is using a different method/
algorithm than r.sun uses, and if so not surprising that the
answer would be slightly different. Can you hold the albedo and
atmospheric turbidity identical in both methods?

the basic integration of flux from a point source following a
curve for a known geometry should be rather similar, but the
fancy atmospheric and ground albedo adjustments is where I'd
expect to see the differences and interesting science.

Another question…the albedo effect is excluded?

the albedo in r.sun is either given by a raster map containing
ground coefficients, or the "alb" parameter, which defaults
to 0.2.

Hamish

Hi Hamish,

now I can't verify in which way the sun map made with arcGIS was done (albedo, atmospheric turbidity…) maybe the differences depend on terrain shadow effect that I have not considered in grass map.

If I want to add this effect to your script for global radiation, how can I do?
And moreover, will your script calculate automatically slope and aspect from DTM or it use the default values?

Thanks

Salvatore

Il giorno 06/set/2011, alle ore 05:13, Hamish ha scritto:

Salvatore wrote:

thanks for the script, it works. I want to be sure that the
result is the global radiation map expressed in W/m2/yr (or
it is W/pixel/yr?). I compare it with ones made with ArcGis
and the values are differents.

how much different? just by a few percent or wildly different?

I have just done some back-of-the-envelope calculations based
on Spearfish's latitude on Sept 21st and the solar constant,
both instantaneous at 12 noon, and a rough integration over the
day, and both answers of my very crude calcs come within 3% and
8% of the presumably much more correct r.sun results. (and I'd
expect the atm scattering to take more out in the dawn/dusk
hours so that increase to 8% diff for the daily sum doesn't
worry me) So they would seem to me to be in the correct order of
magnitude.

It is not surprising that ESRI is using a different method/
algorithm than r.sun uses, and if so not surprising that the
answer would be slightly different. Can you hold the albedo and
atmospheric turbidity identical in both methods?

the basic integration of flux from a point source following a
curve for a known geometry should be rather similar, but the
fancy atmospheric and ground albedo adjustments is where I'd
expect to see the differences and interesting science.

Another question…the albedo effect is excluded?

the albedo in r.sun is either given by a raster map containing
ground coefficients, or the "alb" parameter, which defaults
to 0.2.

Hamish

On Tue, Sep 6, 2011 at 7:20 PM, Salvatore Mellino
<salvatore.mellino@gmail.com> wrote:

now I can't verify in which way the sun map made with arcGIS was done (albedo,
atmospheric turbidity…) maybe the differences depend on terrain shadow effect
that I have not considered in grass map.

Depending on your terrain that can make a huge difference.
See for example (Alpine region next to my home):

http://gis.cri.fmach.it/gis-analysis/
-> Solar radiation based on high resolution DEM

If I want to add this effect to your script for global radiation, how can I do?

Just add the -s flag to r.sun.

And moreover, will your script calculate automatically slope and aspect from DTM or it use the default values?

It calculates slope and aspect from DTM automatically.

Markus

Sorry again,

I forgot to ask you about the Linke turbidity atmospheric coefficient. Is it included into the script? and which is the value used? (3.0 ?)

Thanks again,

Salvatore

Il giorno 06/set/2011, alle ore 19:53, Markus Neteler ha scritto:

On Tue, Sep 6, 2011 at 7:20 PM, Salvatore Mellino
<salvatore.mellino@gmail.com> wrote:

now I can't verify in which way the sun map made with arcGIS was done (albedo,
atmospheric turbidity…) maybe the differences depend on terrain shadow effect
that I have not considered in grass map.

Depending on your terrain that can make a huge difference.
See for example (Alpine region next to my home):

http://gis.cri.fmach.it/gis-analysis/
-> Solar radiation based on high resolution DEM

If I want to add this effect to your script for global radiation, how can I do?

Just add the -s flag to r.sun.

And moreover, will your script calculate automatically slope and aspect from DTM or it use the default values?

It calculates slope and aspect from DTM automatically.

Markus