metobs_toolkit.dataset.Dataset.fill_gaps_with_raw_modeldata#

Dataset.fill_gaps_with_raw_modeldata(obstype: str, overwrite_fill: bool = False, modelname: str | None = None, modelvariable: str | None = None, max_gap_duration_to_fill: str | Timedelta = Timedelta('0 days 12:00:00'), min_value: float | None = None, max_value: float | None = None) None[source]#

Fill the gap(s) using model data without correction.

This method fills all the gaps of a specific obstype, by directly interpolating the model data to the missing records.

Parameters:
  • obstype (str) – The target obstype to fill the gaps for.

  • overwrite_fill (bool, optional) – If True, the status of a gap and present gapfill info will be ignored and overwritten. If False, only gaps without gapfill data are filled. Defaults to False.

  • modelname (str, optional) – The model name to filter by when multiple model data sources exist for the same observation type. If None, no filtering by model name is applied. The default is None.

  • modelvariable (str, optional) – The model variable to filter by when multiple model variables exist for the same observation type and model. If None, no filtering by model variable is applied. The default is None.

  • max_gap_duration_to_fill (Union[str, pandas.Timedelta], optional) – The maximum gap duration of to fill with interpolation. The result is independent on the time-resolution of the gap. Defaults to 12 hours.

  • min_value (float, optional) – Minimum threshold for the filled values. Values below this threshold will be clipped to this minimum. If None, no minimum threshold is applied. The default is None.

  • max_value (float, optional) – Maximum threshold for the filled values. Values above this threshold will be clipped to this maximum. If None, no maximum threshold is applied. The default is None.

Return type:

None

Notes

A schematic description of the raw model data gap fill:

  1. Check if the obstype is knonw, and if the corresponding modeldata is present.

  2. Iterate over the gaps of the obstype.

  3. Check the compatibility of the ModelTimeSeries with the gap.

  4. Ensure both the ModelTimeSeries and gap have the same timezone.

  5. Interpolate the model data to match the missing records in the gap.

  6. Clip filled values to the range [min_value, max_value] if specified.

  7. Update the gap attributes with the interpolated values, labels, and details.