Description
Description
On line 260 at
pvlib-python/pvlib/clearsky.py
Line 260 in 0781787
_interpolate_turbidity
uses time_utc.dayofyear
which is 1-indexed. When the middle of the month is calculated, this uses 0-indexing.
Usually in other parts of the code, this is corrected by an offset of 1, but in this case, it is not.
Reproduction
For instance, this year, February 15th 12:00 PM was the midpoint of February. This is the 46th day of the year, so the index is 45.5 which is correctly calculated by _calendar_month_middles
.
Expected Behavior
This can be seen for some midpoints which you would expect to be exactly what's in the HDF5 file, but are not. For example, we would expect
>>> pvlib.clearsky.lookup_linke_turbidity(pd.DatetimeIndex([datetime.datetime(2024,2,15,12)]), 38, -93)
2024-02-15 12:00:00 2.861667
I imagine this is of very low priority, since these calculations only have the resolution of a single day, but I noticed it and thought I should make an issue.
pvlib.__version__ == '0.11.1'
pandas.__version__ == '2.2.3'
- Python 3.13.0
Activity