metobs_toolkit.sensordata.SensorData.resample#
- SensorData.resample(target_freq: str | Timedelta, shift_tolerance: Timedelta = Timedelta('0 days 00:04:00'), origin=None, origin_simplify_tolerance: Timedelta = Timedelta('0 days 00:04:00')) None[source]#
Resample to a new time resolution.
All observational records, outliers, and gaps are resampled to a new target frequency. Each present timestamp is mapped to a target timestamp, present at the timeseries of target_freq, respecting a maximum shift set by the shift_tolerance.
A new origin (start timestamp) can be set by the argument, or it can be deduced from the current present origin.
- Parameters:
target_freq (str or pandas.Timedelta) – The target frequency to coarsen all records to.
shift_tolerance (pandas.Timedelta, optional) – The maximum translation (in time) to map a timestamp to a target timestamp.
origin (datetime.datetime, optional) – Define the origin (first timestamp) for the observations.
origin_simplify_tolerance (pandas.Timedelta, optional) – Tolerance for origin simplification.
Warning
Since the gaps depend on the record’s frequency and origin, all gaps are removed and re-located. All progress in gap filling will be lost.
Note
It is technically possible to increase the time resolution. This will not result in an information increase; more gaps are created instead.