metobs_toolkit.sensordata.SensorData.interpolate_gaps#

SensorData.interpolate_gaps(method: str = 'time', max_gap_duration_to_fill: str | Timedelta = Timedelta('0 days 03:00:00'), n_leading_anchors: int = 1, n_trailing_anchors: int = 1, max_lead_to_gap_distance: Timedelta | str | None = None, max_trail_to_gap_distance: Timedelta | str | None = None, method_kwargs: dict = {}, overwrite_fill: bool = False) None[source]#

Interpolate gaps in the data.

Parameters:
  • method (str, optional) – Interpolation method, by default “time”.

  • max_gap_duration_to_fill (str or 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 3 hours.

  • n_leading_anchors (int, optional) – Number of leading anchors, by default 1.

  • n_trailing_anchors (int, optional) – Number of trailing anchors, by default 1.

  • max_lead_to_gap_distance (optional) – Maximum distance from leading anchor to gap.

  • max_trail_to_gap_distance (optional) – Maximum distance from trailing anchor to gap.

  • method_kwargs (dict, optional) – Additional keyword arguments for the interpolation method, by default {}.

  • overwrite_fill (bool, optional) – Whether to overwrite existing fills, by default False.