pvlib.solarposition.ephemeris(time, latitude, longitude, pressure=101325, temperature=12)[source]#

Python-native solar position calculator. The accuracy of this code is not guaranteed. Consider using the built-in spa_c code or the PyEphem library.

  • time (pandas.DatetimeIndex) – Must be localized or UTC will be assumed.

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

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

  • pressure (float or Series, default 101325) – Ambient pressure (Pascals)

  • temperature (float or Series, default 12) – Ambient temperature (C)


DataFrame with the following columns

  • apparent_elevation : apparent sun elevation accounting for atmospheric refraction.

  • elevation : actual elevation (not accounting for refraction) of the sun in decimal degrees, 0 = on horizon. The complement of the zenith angle.

  • azimuth : Azimuth of the sun in decimal degrees East of North. This is the complement of the apparent zenith angle.

  • apparent_zenith : apparent sun zenith accounting for atmospheric refraction.

  • zenith : Solar zenith angle

  • solar_time : Solar time in decimal hours (solar noon is 12.00).



Grover Hughes’ class and related class materials on Engineering Astronomy at Sandia National Laboratories, 1985.

See also

pyephem, spa_c, spa_python