r.sunhours(1grass)

✨ r.sunhours ✨

ok so bestie, welcome to the r.sunhours page from the GRASS User's Manual β€” she's a lil raster module that does Big Sun Math and honestly? iconic. πŸ’…


🌞 NAME 🌞

r.sunhours β€” she calculates solar elevation, solar azimuth, and sun hours. no cap.

fr fr, here's the definition dump:

  • 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
  • -s β€” Do not use SOLPOS algorithm of NREL
  • --overwrite β€” Allow output files to overwrite existing files
  • --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
    • Name for output raster map
  • azimuth=name β€” Output raster map with solar azimuth angle
    • Name for output raster map
  • sunhour=name β€” Output raster map with sunshine hours
    • Sunshine hours require SOLPOS use and Greenwich standard time
  • year=integer [required] β€” Year
    • Options: 1950-2050
  • 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 πŸ’–

ok so what does she actually do. r.sunhours calculates sun elevation and sun azimuth angles for the given time of day and for each grid cell in the current region. and like, bonus?? the photoperiod (sunshine hours on flat terrain) can also be calculated. 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. it's giving geometry class but make it celestial. ✨

The sun azimuth angle is here defined as the azimuth angle in degrees of the sun from due north, in a clockwise direction.

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.

🌞 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.

πŸ“ NOTES πŸ“

To consider also cast shadow effects of the terrain, r.sun has to be used. (so like, r.sunhours is the vibes-only version, she's not doing shadows ok 😌)


🌈 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. πŸ’œ


πŸ‘€ SEE ALSO πŸ‘€

g.region, r.sun, r.sunmask


πŸ‘‘ AUTHOR πŸ‘‘

Markus Metz


πŸ“¦ SOURCE CODE πŸ“¦

Available at: r.sunhours source code (history)

Latest change: Friday Feb 07 19:16:09 2025 in commit: a82a39f673b97fafcfce1604dc3e6015cb96487a

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index


and that's the whole page bestie!! πŸŽ€ Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual β€” this was r.sunhours(1grass) from GRASS 8.5.0, slay, go touch some sunlight fr fr πŸŒžβœ¨πŸ’…

πŸ“¦ where this page comes from