solar_zenith#
- hydrometlib.meteorology.solar_zenith(time, latitude)[source]#
Calculate the solar zenith angle (theta_s) [radians]
The angle of the sun from the vertical: 0 when the sun is directly overhead,
pi / 2at the horizon andpiat the nadir.cos(theta_s) > 0means the sun is above the horizon, which is used as a proxy for daylight hours.This is an approximate calculation: the hour angle is taken straight from the clock time and the declination from a simple day-of-year formula, so longitude and the equation of time are not accounted for.
\[\begin{split}\begin{aligned} H &= \left( t_\mathrm{hour} + \frac{t_\mathrm{min}}{60} - 12 \right) \cdot \frac{15\pi}{180} \\[4pt] \delta &= -\,\frac{23.44\pi}{180} \, \cos\!\left( \frac{360}{365}\,(n + 10) \cdot \frac{\pi}{180} \right) \\[4pt] \theta_s &= \arccos\!\left( \sin\phi \, \sin\delta + \cos\phi \, \cos\delta \, \cos H \right) \end{aligned}\end{split}\]where \(H\) is the hour angle, \(\delta\) the solar declination, \(n\) the ordinal day of the year and \(\phi\) the latitude in radians.
References
Taken from https://en.wikipedia.org/wiki/Solar_zenith_angle, with some approximations.
- Parameters:
time (
Expr) – Datetime column of the observations [local clock time]. The hour angle is taken straight from the clock time, so this must be a local time in which solar noon is approximately 12:00 - longitude and the equation of time are not accounted for. For UK sites, UTC is close enough; do not pass a summer-time (BST) clock.latitude (
Expr) – Site attribute - site latitude [degrees, positive north]
- Return type:
Expr- Returns:
Expression or Series for solar zenith angle, theta_s [radians]