You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TrendAnalysis does not like hourly data where the timestamps are not at the top of the hour. Here is a toy example where it errors when given an input time series timestamped at the half-hour mark instead of the usual 00:
importpandasaspdimportnumpyasnpimportrdtools# toy hourly dataset, note that minute=30times=pd.date_range('2019-01-01 00:30:00', periods=8760*3, freq='H')
df=pd.DataFrame({'pv': 1-0.005*np.arange(len(times))/8760,
'poa_global': 1000,
'temperature_cell': 25},
index=times)
ta=rdtools.TrendAnalysis(**df)
ta.filter_params.pop('clip_filter') # clipping filter doesn't like this toy datasetta.sensor_analysis() # ValueError: Less than two years of data left after filtering
Inspection of the object's attributes reveals that pv_energy's index is misaligned with the original data's index (the minutes have been truncated to 00):
In [181]: ta.pv_energy[:3]
Out[181]:
2019-01-0101:00:000.5000002019-01-0102:00:000.9999992019-01-0103:00:000.999999Freq: H, Name: energy_Wh, dtype: float64
Index misalignment between energy and the irradiance data messes up the filtering, resulting in the "less than two years" error. Of course, the index difference traces back to energy_from_power:
In [189]: rdtools.normalization.energy_from_power(df['pv'])[:3]
Out[189]:
2019-01-0101:00:000.5000002019-01-0102:00:000.9999992019-01-0103:00:000.999999Freq: H, Name: energy_Wh, dtype: float64
And from there, I think, to the call to _aggregate and a resample it performs:
TrendAnalysis does not like hourly data where the timestamps are not at the top of the hour. Here is a toy example where it errors when given an input time series timestamped at the half-hour mark instead of the usual
00
:Inspection of the object's attributes reveals that
pv_energy
's index is misaligned with the original data's index (the minutes have been truncated to00
):Index misalignment between energy and the irradiance data messes up the filtering, resulting in the "less than two years" error. Of course, the index difference traces back to
energy_from_power
:And from there, I think, to the call to
_aggregate
and aresample
it performs:rdtools/rdtools/normalization.py
Lines 615 to 618 in d19fa83
The text was updated successfully, but these errors were encountered: