read_series method interpolating impossible values for forecast.solar forecasts
Summary
When using the read_series
method in the ForecastSolarConnection
class to retrieve data within a specific time range, the method incorrectly interpolates values before and after the actual forecast data range provided by the forecast.solar API. This leads to unrealistic and impossible values being returned, particularly during times when the sun has not yet risen or has already set.
Explain your context
I attempted to retrieve a time series of solar forecast data for a specific date range using the read_series
method. The data provided by the forecast.solar API via the read_node
method correctly shows values starting from the first timestamp when the sun rises and ending when the sun sets, with values of zero before and after these times. However, the read_series
method interpolates data across the entire requested time range, including before sunrise and after sunset, leading to incorrect non-zero values being returned.
What is the expected correct behavior? What was your goal?
The expected behavior is that the read_series
method should return the correct forecast data as provided by the API, with zero values before the first sunrise timestamp and after the last sunset timestamp. Interpolation should only occur within the valid data range where the sun is above the horizon.
What is the current bug behavior?
The current behavior of the read_series
method results in interpolated non-zero values even during times before the sun has risen and after it has set, which is incorrect and physically impossible.
Was there an error message?
No specific error message is provided, but the resulting data is incorrect.
Steps to reproduce
- Initialize a
ForecastSolarConnection
object. - Initialize
NodeForecastSolar
node(s) with the desired values. - Use the
read_series
method to retrieve data for a node(s) over a time range (e.g. from today to tomorrow). - Observe that the returned data contains interpolated non-zero values before the first valid forecast timestamp and after the last valid forecast timestamp, instead of zero values.