Skip to content

Clarify delta_t docstring descriptions #1429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Documentation
:py:class:`pvlib.modelchain.ModelChain` or procedural functions.
(:pull:`1394`)
* Fix some typos (:pull:`1414`)
* Clarify the descriptions of ``delta_t`` in several solar position functions
(:pull:`1429`)

Requirements
~~~~~~~~~~~~
Expand Down
26 changes: 12 additions & 14 deletions pvlib/solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,13 @@ def spa_python(time, latitude, longitude,
temperature : int or float, optional, default 12
avg. yearly air temperature in degrees C.
delta_t : float, 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 specifing delta_t is sufficient.
Difference between terrestrial time and UT1.
For most simulations the default delta_t is sufficient.
*Note: delta_t = None will break code using nrel_numba,
this will be fixed in a future version.*
The USNO has historical and forecasted delta_t [3].
The USNO has historical and forecasted delta_t [3]_.
atmos_refrac : None or float, optional, default None
The approximate atmospheric refraction (in degrees)
at sunrise and sunset.
Expand Down Expand Up @@ -405,18 +405,17 @@ def sun_rise_set_transit_spa(times, latitude, longitude, how='numpy',
Latitude in degrees, positive north of equator, negative to south
longitude : float
Longitude in degrees, positive east of prime meridian, negative to west
delta_t : float, optional
If delta_t is None, uses spa.calculate_deltat
using times.year and times.month from pandas.DatetimeIndex.
For most simulations specifing delta_t is sufficient.
Difference between terrestrial time and UT1.
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, 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, optional, default 67.0
Difference between terrestrial time and UT1.
If delta_t is None, uses spa.calculate_deltat
using times.year and times.month from pandas.DatetimeIndex.
For most simulations the default delta_t is sufficient.
*Note: delta_t = None will break code using nrel_numba,
this will be fixed in a future version.*
numthreads : int, optional, default 4
Number of threads to use if how == 'numba'.

Expand Down Expand Up @@ -972,13 +971,12 @@ def nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4):
to machine code and run them multithreaded.

delta_t : float, 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 specifing delta_t is sufficient.
Difference between terrestrial time and UT1.
For most simulations the default delta_t is sufficient.
*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

numthreads : int, optional, default 4
Number of threads to use if how == 'numba'.
Expand Down
10 changes: 2 additions & 8 deletions pvlib/spa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,15 +1097,9 @@ def solar_position(unixtime, lat, lon, elev, pressure, temp, delta_t,
temp : int or float
avg. yearly temperature at location in
degrees C; used for atmospheric correction
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.
delta_t : float
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
atmos_refrac : float, optional
atmos_refrac : float
The approximate atmospheric refraction (in degrees)
at sunrise and sunset.
numthreads: int, optional, default 8
Expand Down