Solar Position#

Functions and methods for calculating solar position.

The location.Location.get_solarposition() method and the solarposition.get_solarposition() function with default parameters are fast and accurate. We recommend using these functions unless you know that you need a different function.

location.Location.get_solarposition(times[, ...])

Uses the pvlib.solarposition.get_solarposition() function to calculate the solar zenith, azimuth, etc.

solarposition.get_solarposition(time, ...[, ...])

A convenience wrapper for the solar position calculators.

solarposition.spa_python(time, latitude, ...)

Calculate the solar position using a python implementation of the NREL SPA algorithm.

solarposition.ephemeris(time, latitude, ...)

Python-native solar position calculator.

solarposition.pyephem(time, latitude, longitude)

Calculate the solar position using the PyEphem package.

solarposition.spa_c(time, latitude, longitude)

Calculate the solar position using the C implementation of the NREL SPA code.

Additional functions for quantities closely related to solar position.

solarposition.calc_time(lower_bound, ...[, ...])

Calculate the time between lower_bound and upper_bound where the attribute is equal to value.

solarposition.pyephem_earthsun_distance(time)

Calculates the distance from the earth to the sun using pyephem.

solarposition.nrel_earthsun_distance(time[, ...])

Calculates the distance from the earth to the sun using the NREL SPA algorithm.

spa.calculate_deltat(year, month)

Calculate the difference between Terrestrial Dynamical Time (TD) and Universal Time (UT).

Functions for calculating sunrise, sunset and transit times.

location.Location.get_sun_rise_set_transit(times)

Calculate sunrise, sunset and transit times.

solarposition.sun_rise_set_transit_ephem(...)

Calculate the next sunrise and sunset times using the PyEphem package.

solarposition.sun_rise_set_transit_spa(...)

Calculate the sunrise, sunset, and sun transit times using the NREL SPA algorithm.

solarposition.sun_rise_set_transit_geometric(...)

Geometric calculation of solar sunrise, sunset, and transit.

The spa module contains the implementation of the built-in NREL SPA algorithm.

spa

Calculate the solar position using the NREL SPA algorithm either using numpy arrays or compiling the code to machine language with numba.

Correlations and analytical expressions for low precision solar position calculations.

solarposition.solar_zenith_analytical(...)

Analytical expression of solar zenith angle based on spherical trigonometry.

solarposition.solar_azimuth_analytical(...)

Analytical expression of solar azimuth angle based on spherical trigonometry.

solarposition.declination_spencer71(dayofyear)

Solar declination from Duffie & Beckman and attributed to Spencer (1971) and Iqbal (1983).

solarposition.declination_cooper69(dayofyear)

Solar declination from Duffie & Beckman and attributed to Cooper (1969).

solarposition.equation_of_time_spencer71(...)

Equation of time from Duffie & Beckman and attributed to Spencer (1971) and Iqbal (1983).

solarposition.equation_of_time_pvcdrom(dayofyear)

Equation of time from PVCDROM.

solarposition.hour_angle(times, longitude, ...)

Hour angle in local solar time.