Package: insolation
insolationA collection of python functions to compute insolation over inclined surfaces or complex terrain.DocumentationFull documentation at:https://www.meteoexploration.com/insol/python/index.htmlOverviewIncluded functions are:aspect(dem, dlxy, degrees = False)Calculates the aspect or orientation of the slope of every grid cell in a digital elevation model (DEM).cgrad(dem, dlxy, cArea = False)Computes a unit vector normal to every grid cell in a digital elevation model.daylength(latitude, longitude, jd, tmz)Compute duration of day light for a given latitude and Julian Day.declination(jd)Computes declination from Julian Date.doshade(dem, res, sun_v, num_sweeps=1)Computes cast shadows over a DEM python implementation from openamundsen package based on the f90 function in R insol by Florian Hanzerhttps://github.com/openamundsen/openamundseneqtime(jd)Computes the equation of time for a given Julian Date.hourangle(jd,longitude, timezone)Hour angle, internal function for solar position.hillshading(dem, dlxy, sunv)Computes the intensity of illumination over a surface (DEM) according to the position of the sun.insolation(zenith, jd, height, visibility, RH, tempK, O3, alphag)Computes direct and diffuse solar irradiance perpendicular to the beam, for a given zenith angle, Julian Day, altitude and atmospheric conditions.julian_day(y, m, d, h, min = 0, sec = 0)Computes Julian Day  (days np.since January 1, 4713 BCE at noon UTC).normalvector(slope, aspect)Calculates a unit vector normal to a surface defined by slope inclination and slope orientation.slope(dem,dlxy, degrees = False)Calculates the inclination of the slope of every grid cell in a digital elevation model (DEM). Zero is an horizontal surface.sunpos(sunv)Returns a matrix of azimuth and zenith angles of the sun given the unit vectors from the observer to the direction of the sun.sunr(jd)Calculates the Earth radius vector.sunvector(jd, latitude, longitude, timezone)Calculates a unit vector in the direction of the sun from the observer position.Included functions inatmosfare:p2rho(Pz, Ta, RH)Computes density of air  at given pressure, temperature and relative humidityrh2sh(RH, Ta, Pz, ice=0)Computes specific humidity from relative humidity at given temperature and pressurewvapsat(TempK,ice=0)Computes saturated vapor pressure over water and over icez2p(z,P0=1.013250E5,T0=288.15)Computes pressure for a given altitude according to  US standard atmosfphereReferencesBird, R. E. and Hulstrom, R. L. (1981a) Review, evaluation and improvements of direct irradiance models,
Trans. ASME J. Solar Energy Eng. 103, 182-192.Bird, R. E. and Hulstrom, R. L. (1981b) A simplified clear sky model for direct
and diffuse insolation on horizontal surfaces,
Technical Report SERI/TR-642-761, Solar Research Institute, Golden, Colorado.Bourges, B.: 1985, Improvement in solar declination computation, Solar Energy 35(4), 367-369.Brutsaert, W.: 1982, Evaporation into the atmosfphere: theory, history,
and applications, Reidel, Dordrecht.Corripio, J. G. (2003). Vectorial algebra algorithms for calculating
terrain parameters from DEMs and solar radiation modelling in mountainous
terrain. International Journal of Geographical Information Science, 17(1),
1–23.https://doi.org/10.1080/713811744Danby, J. M. Eqn. 6.16.4 in Fundamentals of Celestial Mechanics, 2nd ed. Richmond, VA: Willmann-Bell, p. 207, 1988.https://aa.usno.navy.mil/data/JulianDatehttps://aa.usno.navy.mil/faq/JD_formulahttps://aa.usno.navy.mil/software/novaspy_introhttps://adsabs.harvard.edu/full/1983IAPPP..13...16Fhttps://gml.noaa.gov/grad/solcalc/calcdetails.htmlIqbal, M. (1983) An Introduction to Solar Radiation, Academic Press, Toronto.Jacobson, M. Z.: 1999, Fundamentals of atmosfpheric Modeling,
Cambridge University Press, Cambridge.Lowe, P. R.: 1977, An approximating polynomial for the computation of
saturation vapor pressure, Journal of Applied Meteorology 16, 100-103.Meeus, J. 1999. Astronomical Algorithms. Willmann-Bell, Richmond, Virginia, USA.Reda, I. and Andreas, A. 2003. Solar Position Algorithm for Solar Radiation Applications. 55 pp.;
NREL Report No. TP-560-34302, Revised January 2008.https://www.nrel.gov/docs/fy08osti/34302.pdfUS Standard Atmosfphere
U.S. NOAA: 1976, U.S. standard atmosfphere, 1976, NOAA-S/T# 76-1562, U.S. National Oceanic and atmosfpheric Administration,
National Aeronautics and Space Administration,
United States Air Force, Washington. 227 pp.Requirementspython 3 or highernumpyrasteriomatplotlibInstallationpip install insolation