pvlib.solarposition.nrel_earthsun_distance#
- pvlib.solarposition.nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4)[source]#
Calculates the distance from the earth to the sun using the NREL SPA algorithm.
The details of the NREL SPA algorithm are described in [1].
- Parameters:
time (pandas.DatetimeIndex) – Must be localized or UTC will be assumed.
how (str, optional, default 'numpy') – 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.
delta_t (float or array, optional, default 67.0) – Difference between terrestrial time and UT1. If delta_t is None, uses spa.calculate_deltat using time.year and time.month from pandas.DatetimeIndex. For most simulations the default delta_t is sufficient.
numthreads (int, optional, default 4) – Number of threads to use if how == ‘numba’.
- Returns:
dist (pd.Series) – Earth-sun distance in AU.
References