Solar Radiation

longitude_rad(lon_deg)

Converts longitude from degrees to radians.

Parameters

lon_deg (float) – longitude in degrees, \(\phi\) [deg]

Returns

lon – longitude, \(\phi\) [rad]

Return type

float

latitude_rad(lat_deg)

Converts latitude from degrees to radians.

Parameters

lat_deg (float) – latitude in degrees, \(\lambda\) [deg]

Returns

lat – latitude, \(\lambda\) [rad]

Return type

float

slope_rad(slope_deg)

Converts slope from degrees to radians.

Parameters

slope_deg (float) – slope in degrees, \(s\) [deg]

Returns

slope – slope, \(\Delta\) [rad]

Return type

float

aspect_rad(aspect_deg)

Converts aspect from degrees to radians.

Parameters

aspect_deg (float) – aspect in degrees, \(s\) [deg]

Returns

aspect – aspect (0 is north; pi is south), \(\alpha\) [rad]

Return type

float

declination(doy)

Computes the solar declination which is the angular height of the sun above the astronomical equatorial plane in radians.

\[\delta=0.409 \cdot \sin\left(\frac{2\pi \cdot J}{365}-1.39\right)\]
Parameters

doy (float) – julian day of the year, \(J\) [-]

Returns

decl – declination, \(\delta\) [rad]

Return type

float

Examples

>>> import ETLook.solar_radiation as solrad
>>> solrad.declination(180)
0.40512512455439242
earth_sun_distance(doy)

Computes the earth sun distance in Angstrom Unit where 1 AU is 1.496e8 km.

\[d_{r}=1+0.033 \cdot \cos\left(\frac{2\pi \cdot J}{365}\right)\]
Parameters

doy (float) – julian day of the year, \(J\) [-]

Returns

ed – earth sun distance, \(d_{r}\) [AU]

Return type

float

Examples

>>> import ETLook.solar_radiation as solrad
>>> solrad.earth_sun_distance(180)
0.96703055420162642
inverse_earth_sun_distance(doy)

Computes the inverse earth sun distance (iesd) in Angstrom Unit where 1 AU is 1.496e8 km.

\[d_{r}=1+0.033 \cdot \cos\left(\frac{2\pi \cdot J}{365}\right)\]
Parameters

doy (float) – julian day of the year, \(J\) [-]

Returns

iesd – inverse earth sun distance, \(d_{r}\) [AU]

Return type

float

Examples

>>> import ETLook.solar_radiation as solrad
>>> solrad.inverse_earth_sun_distance(180)
0.96703055420162642
actual_earth_sun_distance(iesd)

Computes the earth sun distance (esd) in Angstrom Unit where 1 AU is 1.496e8 km.

\[d_{r}=1+0.033 \cdot \cos\left(\frac{2\pi \cdot J}{365}\right)\]
Parameters

iesd (float) – inverse earth sun distance, \(J\) [AU]

Returns

esd – earth sun distance, \(d_{r}\) [AU]

Return type

float

Examples

>>> import ETLook.solar_radiation as solrad
>>> solrad.actual_earth_sun_distance(180)
1.034093489244084
seasonal_correction(doy)

Computes the seasonal correction for solar time in hours.

\[b=\frac{2\pi\left(J-81\right)}{365}\]
\[s_{c}= 0.1645 \cdot sin \left( 2b \right) - 0.1255 \cdot cos \left(b \right) - 0.025 \left(b\right)\]
Parameters

doy (float) – julian day of the year, \(J\) [-]

Returns

sc – seasonal correction, \(s_{c}\) [hours]

Return type

float

Examples

>>> import ETLook.solar_radiation as solrad
>>> solrad.seasonal_correction(180)
-0.052343379605521212
sunset_hour_angle(lat, decl)

Computes the sunset hour angle.

\[w_{s}=\arccos(-\tan(\lambda)\cdot \tan(\delta))\]
Parameters
  • decl (float) – solar declination, \(\delta\) [rad]

  • lat (float) – latitude, \(\lambda\) [rad]

Returns

ws – sunset hour angle, \(w_{s}\) [rad]

Return type

float

hour_angle(sc, dtime, lon=0)

Computes the hour angle which is zero at noon and -pi at 0:00 am and pi at 12:00 pm

\[\omega=\left(\frac{\pi}{12}\right)\cdot \left(t+s_{c}-12\right)\]
Parameters
  • sc (float) – seasonal correction, \(s_{c}\) [hours]

  • dtime (float) – decimal time, \(t\) [hours]

  • lon (float) – longitude, \(\phi\) [rad]

Returns

ha – hour_angle, \(\omega\) [rad]

Return type

float

Examples

>>> import ETLook.solar_radiation as solrad
>>> solrad.hour_angle(sc=solrad.seasonal_correction(75), dtime=11.4)
-0.19793970172084141
inst_solar_radiation_toa(csza, iesd)

Computes the instantaneous solar radiation at the top of the atmosphere [Wm-2].

\[S_{toa}^{i} = S_{sun} \cdot d_{r} \cdot \phi\]
Parameters
  • csza (float) – cosine solar zenith angle, \(\phi\) [-]

  • iesd (float) – inverse earth sun distance, \(d_{r}\) [AU]

Returns

ra_i_toa – instantaneous solar radiation at top of atmosphere, \(S_{toa}^{i}\) [Wm-2]

Return type

float

Examples

>>> import ETLook.solar_radiation as solrad
>>> doy = 1
>>> sc = solrad.seasonal_correction(doy)
>>> ha = solrad.hour_angle(sc, dtime=12)
>>> decl = solrad.declination(doy)
>>> csza = solrad.cosine_solar_zenith_angle(ha, decl, 0)
>>> iesd = solrad.inverse_earth_sun_distance(doy)
>>> solrad.inst_solar_radiation_toa(csza, iesd)
1299.9181944414036
daily_solar_radiation_toa(sc, decl, iesd, lat, slope=0, aspect=0)

Computes the daily solar radiation at the top of the atmosphere.

\[S_{toa}=S_{sun} \cdot d_{r}\int_{i=-\pi}^{i=\pi}S_{toa}^{i}\]
Parameters
  • iesd (float) – inverse earth sun distance, \(d_{r}\) [AU]

  • decl (float) – solar declination, \(\delta\) [rad]

  • sc (float) – seasonal correction, \(s_{c}\) [hours]

  • lat (float) – latitude, \(\lambda\) [rad]

  • slope (float) – slope, \(\Delta\) [rad]

  • aspect (float) – aspect (0 is north; pi is south), \(\alpha\) [rad]

Returns

ra_24_toa – daily solar radiation at the top of atmosphere, \(S_{toa}\) [Wm-2]

Return type

float

Examples

>>> import ETLook.solar_radiation as solrad
>>> from math import pi
>>> doy = 1
>>> sc = solrad.seasonal_correction(doy)
>>> decl = solrad.declination(doy)
>>> iesd = solrad.inverse_earth_sun_distance(doy)
>>> solrad.daily_solar_radiation_toa(sc, decl, iesd, lat=25*pi/180.0)
265.74072308978026
cosine_solar_zenith_angle(ha, decl, lat, slope=0, aspect=0)

computes the cosine of the solar zenith angle [-].

\[\begin{split}\phi = & \sin\left(\delta\right) \cdot \sin\left(\lambda\right) \cdot \cos\left(\Delta\right) - \\ & \sin\left(\delta\right) \cdot \cos\left(\lambda\right) \cdot \sin\left(\Delta\right) + \\ & \cos\left(\delta\right) \cdot \cos\left(\lambda\right) \cdot \cos\left(\Delta\right) \cdot \cos\left(\omega\right)+\\ & \cos\left(\delta\right) \cdot \sin\left(\lambda\right) \cdot \sin\left(\Delta\right) \cdot \sin\left(\alpha\right) \cdot \cos\left(\omega\right)+\\ & \cos\left(\delta\right) \cdot \sin\left(\Delta\right) \cdot \sin\left(\alpha\right) \cdot \sin\left(\omega\right)\end{split}\]
Parameters
  • ha (float) – hour angle, \(\omega\) [rad]

  • decl (float) – declination, \(\delta\) [rad]

  • lat (float) – latitude, \(\lambda\) [rad]

  • slope (float) – slope, \(\Delta\) [rad]

  • aspect (float) – aspect (0 is north; pi is south), \(\alpha\) [rad]

Returns

csza – cosine solar zenith angle, \(\phi\) [-]

Return type

float

Examples

>>> import ETLook.solar_radiation as solrad
>>> sc = solrad.seasonal_correction(1)
>>> ha = solrad.hour_angle(sc, dtime=12)
>>> solrad.cosine_solar_zenith_angle(ha, decl=solrad.declination(1), lat=0)
0.92055394167363314
transmissivity(ra, ra_flat)

Computes the transmissivity.

Parameters
  • ra_24 (float) – daily solar radiation for a flat surface, \(S^{\downarrow}\) [Wm-2]

  • ra_24_toa_flat (float) – daily solar radiation at the top of atmosphere for a flat surface, \(S_{toa,f}\) [Wm-2]

Returns

trans_24 – daily atmospheric transmissivity, :math:` au` [-]

Return type

float

daily_solar_radiation_toa_flat(decl, iesd, lat, ws)

Computes the daily solar radiation at the top of the atmosphere for a flat surface.

\[S_{toa,f}=\frac{S_{sun}}{\pi} \cdot d_{inv,r} \cdot (w_{s} \cdot \sin(\lambda) \cdot \sin(\delta) + \cos(\lambda)\cdot\cos(\delta)\cdot\sin(w_{s}))\]
Parameters
  • decl (float) – solar declination, \(\delta\) [rad]

  • iesd (float) – inverse earth sun distance, \(d_{inv,r}\) [AU]

  • lat (float) – latitude, \(\lambda\) [rad]

  • ws (float) – sunset hour angle, \(w_{s}\) [rad]

Returns

ra_24_toa_flat – daily solar radiation at the top of atmosphere for a flat surface, \(S_{toa,f}\) [Wm-2]

Return type

float

daily_solar_radiation_flat(ra_24_toa_flat, trans_24)

Computes the daily solar radiation at the earth’s surface.

\[S^{\downarrow} = \tau \cdot S_{toa}\]
Parameters
  • ra_24_toa_flat (float) – daily solar radiation at the top of atmosphere for a flat surface, \(S_{toa}\) [Wm-2]

  • trans_24 (float) – daily atmospheric transmissivity, \(\tau\) [-]

Returns

ra_24 – daily solar radiation for a flat surface, \(S^{\downarrow}\) [Wm-2]

Return type

float

diffusion_index(trans_24, diffusion_slope=-1.33, diffusion_intercept=1.15)

Computes the diffusion index, the ratio between diffuse and direct solar radiation. The results are clipped between 0 and 1.

\[I_{diff} = a_{diff}+b_{diff} \cdot \tau\]
Parameters
  • trans_24 (float) – daily atmospheric transmissivity, \(\tau\) [-]

  • diffusion_slope (float) – slope of diffusion index vs transmissivity relationship, \(b_{diff}\) [-]

  • diffusion_intercept (float) – intercept of diffusion index vs transmissivity relationship, \(a_{diff}\) [-]

Returns

diffusion_index – diffusion_index, \(I_{diff}\) [-]

Return type

float

daily_total_solar_radiation(ra_24_toa, ra_24_toa_flat, diffusion_index, trans_24)

Computes the daily solar radiation at the earth’s surface taken diffuse and direct solar radiation into account.

\[S^{\downarrow} = I_{diff} \cdot \tau \cdot S_{toa,f} +(1-I_{diff}) \cdot \tau \cdot S_{toa}\]
Parameters
  • ra_24_toa (float) – daily solar radiation at the top of atmosphere, \(S_{toa}\) [Wm-2]

  • ra_24_toa_flat (float) – daily solar radiation at the top of atmosphere for a flat surface, \(S_{toa,f}\) [Wm-2]

  • diffusion_index (float) – diffusion_index, \(I_{diff}\) [-]

  • trans_24 (float) – daily atmospheric transmissivity, \(\tau\) [-]

Returns

ra_24 – daily solar radiation, \(S^{\downarrow}\) [Wm-2]

Return type

float