angle of incidence calculation

I am calculating angle of incidence by the following formula!

cos(aoi) =  cos(slp) cos(zn) + sin(slp) sin(zn) cos(azm_s - azm )

aoi: angle of incidence slp: slope zn: zenith angle azm_s: solar azimuth angle (N = 0, clockwise) azm: surface azimuth (N = 0, clockwise)

For surface azimuth and slope angle I run 'r.slope.aspect' using Grass framework (https://grass.osgeo.org/grass70/manuals/r.slope.aspect.html). I convert the aspect values from E=0 anti-clockwise to N=0 clockwise. is the calculated aspect and surface azimuth similar?

Note that there is i.topo.corr in GRASS GIS for performing terrain correction.

If you want to calculate it "manually", then you can update the angle computation with r.mapcalc:

# If you want to limit the range to 0..360, use:
r.mapcalc "angle_cw = (450 - angle_ccw) % 360"

# Similarly, if you want -180..180 (again, clockwise from North):
r.mapcalc "angle_cw = (630 - angle_ccw) % 360 - 180"

A few days ago a new -n flag to produce aspect CW from North with flat = -9999 (like gdaldem) was added to r.slope.aspect in trunk (GRASS GIS 7.5.svn) in order to avoid the r.mapcalc step.

• Thank you so much for your reply! But I have another question. I tried to calculate the angle of incidence (aoi) using both the formula (e.g. range 0 to 360 and range -180 to 180) and I get a different aoi values. why so? then which aoi value I sud consider! – Sukriti Bhattacharya Feb 19 '18 at 9:40