metobs_toolkit.gap.Gap.debiased_model_gapfill#
- Gap.debiased_model_gapfill(sensordata: SensorData, modeltimeseries: ModelTimeSeries, leading_period_duration: str | Timedelta, min_leading_records_total: int, trailing_period_duration: str | Timedelta, min_trailing_records_total: int) None[source]#
Fill the gaps using model data corrected for the bias.
This method fills the gap using model data corrected for bias. The bias is estimated using a leading (before the gap) and trailing (after the gap) period. The bias is computed by combining the leading and trailing period, and comparing the model with the observations (not labeled as outliers). The model data is then interpolated to the missing records, and corrected with the estimated bias.
- Parameters:
sensordata (SensorData) – The corresponding SensorData used in the computation of the bias. Only the observations that are not labeled as outliers are used to compute the bias.
modeltimeseries (ModelTimeSeries) – The model time series used to fill the gap records. The model data must be compatible (equivalent obstype and related to the same Station as the gap.)
leading_period_duration (str or pd.Timedelta) – The duration of the leading period.
min_leading_records_total (int) – The minimum number of records required in the leading period.
trailing_period_duration (str or pd.Timedelta) – The duration of the trailing period.
min_trailing_records_total (int) – The minimum number of records required in the trailing period.
- Return type:
None.
Notes
A schematic description of the debiased modeldata gap fill:
Check the compatibility of the ModelTimeSeries with the gap.
Construct a leading and trailing sample, and test if they meet the required conditions.
Compute the bias of the modeldata (combine leading and trailing samples).
Fill the gap records by using raw (interpolated) modeldata that is corrected by subtracting the bias.
Update the gap attributes with the interpolated values, labels, and details.