r.sunhours(1)
β¨ r.sunhours(1) β¨
okay bestie, welcome to the GRASS GIS User's Manual page for r.sunhours β she calculates solar elevation, solar azimuth, and sun hours and honestly? she ate. π
π NAME π
r.sunhours β Calculates solar elevation, solar azimuth, and sun hours. π
Let's get the definitions out of the way because they're lowkey iconic:
- Solar elevation: the angle between the direction of the geometric center of the sun's apparent disk and the (idealized) horizon.
- Solar azimuth: the angle from due north in clockwise direction.
π KEYWORDS π
raster, solar, sun energy, sun position
π SYNOPSIS π
r.sunhours
r.sunhours --help
r.sunhours [-ts] [elevation=name] [azimuth=name] [sunhour=name]
year=integer [month=integer] day=integer [hour=integer]
[minute=integer] [second=integer] [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π© Flags:
-tβ Time is local sidereal time, not Greenwich standard time. (iykyk π°οΈ)-sβ Do not use SOLPOS algorithm of NREL.--overwriteβ Allow output files to overwrite existing files. π careful bestie--helpβ Print usage summary.--verboseβ Verbose module output.--quietβ Quiet module output. π€«--uiβ Force launching GUI dialog. π₯οΈ
π Parameters:
elevation=nameβ Output raster map with solar elevation angle. It's the Name for output raster map, bestie.azimuth=nameβ Output raster map with solar azimuth angle. Also a Name for output raster map.sunhour=nameβ Output raster map with sunshine hours. Heads up: Sunshine hours require SOLPOS use and Greenwich standard time. πyear=integer[required] β Year. Options:1950-2050. Required, no skipping. π ββοΈmonth=integerβ Month. If not given, day is interpreted as day of the year. Options:1-12.day=integer[required] β Day. Options:1-366.hour=integerβ Hour. Options:0-24. Default:12.minute=integerβ Minutes. Options:0-60. Default:0.second=integerβ Seconds. Options:0-60. Default:0.
πΈ DESCRIPTION πΈ
So r.sunhours calculates sun elevation and sun azimuth angles for the given time of day, and it does it for each grid cell in the current region. And as a lil bonus? The photoperiod (sunshine hours on flat terrain) can be calculated too. Obsessed. β¨
Sun elevation β also known as height, height angle, or solar altitude angle β is the angle in degrees between the horizon and a line that points from the site towards the centre of the sun. π
The sun azimuth angle is here defined as the azimuth angle in degrees of the sun from due north in a clockwise direction. π§
Now the time situation, because it's giving β¨quirkyβ¨: the time used here is defined such that 12:00 (high noon) is the time when the sun has reached its highest point in the sky at the current site β unless the -t flag is used, in which case time is interpreted as Greenwich standard time.
And if a sunhour output map is specified, the module calculates sunshine hours for the given day. This option requires both Greenwhich standard time and the use of the SOLPOS algorithm by NREL. No cap.
π NOTES π
If you wanna also consider cast shadow effects of the terrain, you gotta use r.sun instead. Different girl, different job. πββοΈ
π§ͺ EXAMPLES π§ͺ
βοΈ Calculating a sun elevation angle map
Calculate the sun elevation angle map for 2010-10-11 at 14:00h solar time:
# set computational region to North Carolina state extent
g.region n=318500 s=-16000 w=124000 e=963000 res=500 -p
r.sunhours elevation=sun_elev year=2010 month=10 day=11 hour=14 minute=00
# visualize
d.mon wx0
d.rast sun_elev
d.vect nc_state type=boundary
d.legend sun_elev -s
Sun angle map (in degree) of North Carolina for the 2010-10-11 at 14:00h solar time. πΊοΈ
π Calculate map of photoperiod (insolation time)
Calculate photoperiod of day-of-year 001 (1st January) of 2012 for the current computational region, ignoring cast shadow effects of the terrain:
g.region -p
r.sunhours sunhour=photoperiod_doy_001 year=2012 day=1
π«Ά Acknowledgements
Acknowledgements: National Renewable Energy Laboratory for their SOLPOS 2.0 sun position algorithm. Thank you kings. π
π SEE ALSO π
g.region, r.sun, r.sunmask
π AUTHOR π
Markus Metz
πΎ SOURCE CODE πΎ
Available at: r.sunhours source code (history)
Accessed: Saturday Jan 17 05:41:01 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
okay that's the whole page bestie, and just so you have the receipts: this is from GRASS 8.4.2, accessed Saturday Jan 17 05:41:01 2026, Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual. slay, go calculate some sun angles πβ¨π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms