Table Of Contents

Previous topic

References

This Page

The SolarInformation class

class SolarInformation(dates, latitude)

Defines some astronomical information for a series of dates at a given latitude.

The series of dates must be a valid DateArray object. If its frequency is weekly or less (monthly, quarterly), the series is internally converted to a daily frequency, but its original frequency is saved in the freq attribute. A NotImplementedError is raised if the initial frequency is hourly or higher.

All of the attributes are stored internally with a daily frequency. Public versions are available: in that case, the attribute is reconverted to the initial frequency freq.

Parameters:

dates : DateArray

Series of dates on which to compute the astronomical information.

latitude : float

Latitude of the site (in degrees).

Methods

clearsky_solar_radiations
frac_day_of_year
solar_radiations_from_sunshinehours
solar_radiations_from_temperatures

Attributes

SolarInformation.freq

Frequency specifier of the input dates.

SolarInformation.latitude
Returns the latitude of the site (in degrees). The latitude is stored in radians internally.

The following attributes are TimeSeries objects, with the same dates and freq attributes as the instance. If the initial frequency is less than daily (for example, monthly), the values of the series correspond to daily values average over the period.

SolarInformation.earth_sun_distance

Returns the average inverse relative distance Earth-sun \delta_r, calculated as:

\delta_r = 1 + 0.033 \cos\left(2\pi f\right)

where f is the fractional day of the year (1./365 for Jan., 1st and 1. for Dec.,31st).

SolarInformation.solar_declination

Returns the solar declination \delta as [Spencer_1971]:

\frac{\pi}{180^\circ} \delta &= 0.006918 \\
                              &- 0.399912 \cos(\phi)  + 0.070257 \sin(\phi) \\
                              &- 0.006758 \cos(2\phi) + 0.000907 \sin(2\phi) \\
                              &- 0.002697 \cos(3\phi) + 0.00148 \sin(3\phi)

where \phi= 2 \pi (n-1)/N is the fractional year in radians, n the day of the year (1 for Jan, 1st) and N the number of days in the year.

SolarInformation.sunset_angle

Returns the sunset hour angle, as a TimeSeries. The sunset hour angle \omega_s is calculated from the solar declination \delta and the latitude \Phi as

\cos(\omega_s) = -\tan(\Phi) \cdot \tan(\delta)

SolarInformation.daylength
Returns the number of hours of daylights, as a TimeSeries. The day length D depends on the sunset hour angle \omega_s through the relation D = 24 \cdot \omega_s / \pi.
SolarInformation.daylighthours
Alias to daylength.
SolarInformation.extraterrestrial_solar_radiations

The extraterrestrial solar radiation R_a is the solar radiation received at the top of the atmosphere on an horizontal surface. It depends on the solar constant \sigma, the solar radiation hitting a surface perpendicular to the sun’s rays at the top of the atmosphere, and the angle between the sun rays and the normal to the atmosphere.

An expression of R_a [MJ.m-2.d-1] is given by Duffie & Beckman (1981) [Duffie_Beckman_1981]:

R_a = \frac{\sigma \delta_r}{\pi} \cdot
      \left[\omega_s \sin(\Phi) \sin(\delta_s) + \cos(\Phi) \cos(\delta_s) \sin(\omega_s)\right]

where \omega_s is the sunset hour angle (sunset_angle), \delta_r the inverse relative Earth-Sun distance(earth_sun_distance), \delta_s the solar declination (solar_declination), \Phi the site latitude (latitude).

Methods

SolarInformation.frac_day_of_year

Returns the fractional days of the year, as a TimeSeries. The fractional day of the year is a float between 0 (or 1./365) for Jan., 1st and 1. for Dec., 31st.

Parameters:

offset : {False, True}

Whether the first day of year corresponds to 1./365 (False) or 0 (True)