SensorData#

The SensorData class stores timeseries data from sensors at a station. It is used for handling, processing, and analyzing observational data.

SensorData objects are usually accessed via the .sensordata attribute of Station or Dataset objects.

Constructor#

SensorData(stationname, datarecords, ...)

Holds data for one station for one sensor.

Attributes#

A summary of all the attributes (and properties) of the SensorData class.

SensorData.df

SensorData DataFrame constructor.

SensorData.outliersdf

Return a DataFrame of the outlier records.

SensorData.gapsdf

Return a DataFrame of the gap records.

SensorData.stationname

Return the name of the station this SensorData belongs to.

SensorData.tz

Return the timezone of the stored timestamps.

SensorData.start_datetime

Return the start datetime of the series.

SensorData.end_datetime

Return the end datetime of the series.

SensorData.freq

Return the frequency of the series.

Methods#

A summary of all methods in the SensorData class.

SensorData.get_info([printout])

Retrieve and optionally print basic information about the sensor data.

SensorData.convert_outliers_to_gaps()

Convert all outliers to gaps.

SensorData.gap_overview_df()

Create gap status overview DataFrame with one row per gap period.

SensorData.resample(target_freq[, ...])

Resample to a new time resolution.

SensorData.get_qc_freq_statistics()

Generate quality control (QC) frequency statistics.

SensorData.fill_gap_with_modeldata(...[, ...])

Fill gaps using model data.

SensorData.interpolate_gaps([method, ...])

Interpolate gaps in the data.

SensorData.convert_to_standard_units()

Convert the data records to the standard units defined in the observation type.

SensorData.pd_plot([show_labels])

A wrapper on the pandas.series.plot function for SensorData.

SensorData.gross_value_check(**qckwargs)

Perform a gross value check on the series.

SensorData.persistence_check(**qckwargs)

Perform a persistence check on the series.

SensorData.repetitions_check(**qckwargs)

Perform a repetitions check on the series.

SensorData.step_check(**qckwargs)

Perform a step check on the series.

SensorData.window_variation_check(**qckwargs)

Perform a window variation check on the series.

SensorData.to_xr()

Convert Sensordata (observations, including labels) to an xarray.Dataset.

Special methods#

The SensorData class implements several Python special methods for convenience:

  • __add__: Combine two SensorData objects, using the ‘other’ for duplicated timestamps. Note that all gaps and outliers are reset!

  • __eq__: Test equality between two SensorData objects.

  • __str__ and __repr__: String representations for printing and debugging.

  • copy: Create a (deep) copy of the Sensordata.