solarforecastarbiter.metrics.preprocessing.resample_and_align

solarforecastarbiter.metrics.preprocessing.resample_and_align(fx_obs, fx_data, obs_data, ref_data, tz)[source]

Resample the observation to the forecast interval length and align to remove overlap.

Parameters:
Returns:

  • forecast_values (pandas.Series or pandas.DataFrame)
  • observation_values (pandas.Series)
  • reference_forecast_values (pandas.Series or pandas.DataFrame or None)
  • results (dict)

Notes

In the case where the interval_label of the obs and fx do not match, this function currently returns a ProcessedForecastObservation object with a interval_label the same as the fx, regardless of whether the interval_length of the fx and obs are the same or different.

Raises:
  • ValueError – If fx_obs.reference_forecast is not None but ref_data is None or vice versa
  • ValueError – If fx_obs.reference_forecast.interval_label or interval_length does not match fx_obs.forecast.interval_label or interval_length