metobs_toolkit.sensordata.SensorData#
- class SensorData(stationname: str, datarecords: ~numpy.ndarray, timestamps: ~numpy.ndarray, obstype: ~metobs_toolkit.obstypes.Obstype, datadtype: type = <class 'numpy.float32'>, timezone: str | ~pandas._libs.tslibs.timedeltas.Timedelta = 'UTC', freq_estimation_method: ~typing.Literal['highest', 'median'] = 'median', freq_estimation_simplify_tolerance: ~pandas._libs.tslibs.timedeltas.Timedelta | str = Timedelta('0 days 00:01:00'), origin_simplify_tolerance: ~pandas._libs.tslibs.timedeltas.Timedelta | str = Timedelta('0 days 00:01:00'), timestamp_tolerance: ~pandas._libs.tslibs.timedeltas.Timedelta | str = Timedelta('0 days 00:04:00'))[source]#
Holds data for one station for one sensor.
- Parameters:
stationname (str) – Name of the station.
datarecords (np.ndarray) – Array of data records.
timestamps (np.ndarray) – Array of timestamps.
obstype (Obstype) – Observation type.
datadtype (type, optional) – Data type of the records, by default np.float32.
timezone (str or pd.Timedelta, optional) – Timezone of the timestamps, by default ‘UTC’.
freq_estimation_method ({'highest', 'median'}, optional) – Method to estimate frequency, by default ‘median’.
freq_estimation_simplify_tolerance (pd.Timedelta or str, optional) – Tolerance for frequency estimation simplification, by default pd.Timedelta(‘1min’).
origin_simplify_tolerance (pd.Timedelta or str, optional) – Tolerance for origin simplification, by default pd.Timedelta(‘1min’).
timestamp_tolerance (pd.Timedelta or str, optional) – Tolerance for timestamp matching, by default pd.Timedelta(‘4min’).
- __init__(stationname: str, datarecords: ~numpy.ndarray, timestamps: ~numpy.ndarray, obstype: ~metobs_toolkit.obstypes.Obstype, datadtype: type = <class 'numpy.float32'>, timezone: str | ~pandas._libs.tslibs.timedeltas.Timedelta = 'UTC', freq_estimation_method: ~typing.Literal['highest', 'median'] = 'median', freq_estimation_simplify_tolerance: ~pandas._libs.tslibs.timedeltas.Timedelta | str = Timedelta('0 days 00:01:00'), origin_simplify_tolerance: ~pandas._libs.tslibs.timedeltas.Timedelta | str = Timedelta('0 days 00:01:00'), timestamp_tolerance: ~pandas._libs.tslibs.timedeltas.Timedelta | str = Timedelta('0 days 00:04:00'))[source]#
Methods
__init__(stationname, datarecords, ...[, ...])Convert all outliers to gaps.
Convert the data records to the standard units defined in the observation type.
duplicated_timestamp_check()Check for duplicated timestamps in the series.
fill_gap_with_modeldata(modeltimeseries[, ...])Fill gaps using model data.
get_info([printout])Retrieve and optionally print basic information about the sensor data.
Generate quality control (QC) frequency statistics.
gross_value_check(**qckwargs)Perform a gross value check on the series.
interpolate_gaps([method, max_consec_fill, ...])Interpolate gaps in the data.
invalid_value_check(skip_records)Check for invalid values in the series.
persistence_check(**qckwargs)Perform a persistence check on the series.
repetitions_check(**qckwargs)Perform a repetitions check on the series.
resample(target_freq[, shift_tolerance, ...])Resample to a new time resolution.
step_check(**qckwargs)Perform a step check on the series.
window_variation_check(**qckwargs)Perform a window variation check on the series.
Attributes
Return a DataFrame of the sensor records.
Return the end datetime of the series.
Return the frequency of the series.
gapsdfReturn a DataFrame of the gap records.
outliersdfReturn a DataFrame of the outlier records.
Return the start datetime of the series.
Return the name of the station this SensorData belongs to.
Return the timezone of the stored timestamps.