Skip to content
Open
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
1 change: 1 addition & 0 deletions docs/sphinx/source/reference/solarposition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Functions for calculating sunrise, sunset and transit times.
solarposition.sun_rise_set_transit_ephem
solarposition.sun_rise_set_transit_spa
solarposition.sun_rise_set_transit_geometric
spa.transit_sunrise_sunset


The spa module contains the implementation of the built-in NREL SPA
Expand Down
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/v0.16.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Enhancements

Documentation
~~~~~~~~~~~~~
* Add :py:func:`pvlib.spa.transit_sunrise_sunset` to the API reference.
(:issue:`2255`, :pull:`2873`)


Testing
Expand Down
7 changes: 6 additions & 1 deletion pvlib/spa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ def solar_position(unixtime, lat, lon, elev, pressure, temp, delta_t,
def transit_sunrise_sunset(dates, lat, lon, delta_t, numthreads):
"""
Calculate the sun transit, sunrise, and sunset
for a set of dates at a given location.
for a set of dates at a given location using the NREL SPA [1]_.

Parameters
----------
Expand All @@ -1129,6 +1129,11 @@ def transit_sunrise_sunset(dates, lat, lon, delta_t, numthreads):
-------
tuple : (transit, sunrise, sunset) localized to UTC

References
----------
.. [1] I. Reda and A. Andreas, Solar position algorithm for solar
radiation applications. Solar Energy, vol. 76, no. 5, pp. 577-589,
2004. :doi:`10.1016/j.solener.2003.12.003`
"""

if ((dates % 86400) != 0.0).any():
Expand Down
Loading