pvlib.solarposition.get_sun_rise_set_transit

pvlib.solarposition.get_sun_rise_set_transit(time, latitude, longitude, how='numpy', delta_t=67.0, numthreads=4)[source]

Calculate the sunrise, sunset, and sun transit times using the NREL SPA algorithm described in [1].

If numba is installed, the functions can be compiled to machine code and the function can be multithreaded. Without numba, the function evaluates via numpy with a slight performance hit.

Parameters:

time : pandas.DatetimeIndex

Only the date part is used

latitude : float

longitude : float

delta_t : float, optional

If delta_t is None, uses spa.calculate_deltat using time.year and time.month from pandas.DatetimeIndex. For most simulations specifing delta_t is sufficient. Difference between terrestrial time and UT1. *Note: delta_t = None will break code using nrel_numba, this will be fixed in a future version. By default, use USNO historical data and predictions

how : str, optional

Options are ‘numpy’ or ‘numba’. If numba >= 0.17.0 is installed, how=’numba’ will compile the spa functions to machine code and run them multithreaded.

numthreads : int, optional

Number of threads to use if how == ‘numba’.

Returns:

DataFrame

The DataFrame will have the following columns: sunrise, sunset, transit

References

[1] Reda, I., Andreas, A., 2003. Solar position algorithm for solar radiation applications. Technical report: NREL/TP-560- 34302. Golden, USA, http://www.nrel.gov.