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

Align the observation data to the forecast data.

  • fx_obs (solarforecastarbiter.datamodel.ForecastObservation, solarforecastarbiter.datamodel.ForecastAggregate) – Pair of forecast and observation.
  • fx_data (pandas.Series or pandas.DataFrame) – Timeseries data of the forecast.
  • obs_data (pandas.Series) – Timeseries data of the observation/aggregate after processing the quality flag column and resampling to match fx_obs.forecast.interval_length.
  • ref_data (pandas.Series or pandas.DataFrame or None) – Timeseries data of the reference forecast.
  • tz (str) – Timezone to which processed data will be converted.

  • forecast_values (pandas.Series or pandas.DataFrame)
  • observation_values (pandas.Series)
  • reference_forecast_values (pandas.Series or pandas.DataFrame or None)
  • results (dict) – Keys are strings and values are typically integers that describe number of discarded and undefined data points.


This function does not currently account for mismatches in the interval_label of the fx_obs.observation and fx_obs.forecast.

If obs_data will be subsampled if it is higher frequency than fx_data, but users should not rely on this behavior. Instead, use filter_resample() to match the input observations to the forecast data.