solposx.solarposition.sg2

Contents

solposx.solarposition.sg2#

solposx.solarposition.sg2(times, latitude, longitude, elevation=0, *, pressure=101325, temperature=12)#

Calculate solar position using the SG2 algorithm.

The SG2 algorithm [1] has a stated accuracy of 0.003 degrees from years 1980 to 2030.

Parameters:
  • times (pandas.DatetimeIndex) – Timestamps - must be localized. Prior to 1970 and far in the future UTC and UT1 may deviate significantly. For such use cases, UT1 times should be provided.

  • latitude (float) – Latitude in decimal degrees. Positive north of equator, negative to south. [degrees]

  • longitude (float) – Longitude in decimal degrees. Positive east of prime meridian, negative to west. [degrees]

  • elevation (float, default : 0) – Altitude of the location of interest. [m]

  • pressure (float, default : 101325) – Annual average air pressure. [Pa]

  • temperature (float, default : 12) – Annual average air temperature. [°C]

Returns:

DataFrame with the following columns (all values in degrees):

  • elevation : actual sun elevation (not accounting for refraction).

  • apparent_elevation : sun elevation, accounting for atmospheric refraction.

  • zenith : actual sun zenith (not accounting for refraction).

  • apparent_zenith : sun zenith, accounting for atmospheric refraction.

  • azimuth : sun azimuth, east of north.

Return type:

pandas.DataFrame

Notes

The SG2 equations as described in [1] had a number of typos and errors. These errors have been corrected in the present implementation.

References