sensortoolkit.datetime_utils._time_averaging.sensor_averaging

sensor_averaging(full_df_list, sensor_serials=None, name='', write_to_file=True, path=None, **kwargs)[source]

Write full (recorded), hourly, and daily averaged datasets to csv.

Wrapper function for computing hourly and daily averaged DataFrames.

Parameters
  • full_df_list (list) – List of sensor DataFrames at original recorded sampling frequency.

  • sensor_serials (dict) – A dictionary of unique serial identifiers for each sensor in the testing group.

  • name (str) – The make and model of the sensor being evaluated.

  • write_to_file (bool) – If true, datasets will be written to the path for data at original recorded sampling frequency (files ending in ‘_full.csv’), 1-hour averaged datasets (files ending in ‘_hourly.csv’), and 24-hour averaged datasets (files ending in ‘_daily.csv’).

  • path (str) – The full directory path to processed sensor data for a given sensor make and model.

Keyword Arguments:

Parameters

threshold (float) – The completeness threshold for averaging datasets to 1-hour or 24-hour intervals. Defaults to 75% (0.75).

Returns

Two-element tuple containing:

  • hourly_df_list (list of pandas DataFrames): List of sensor data frames of length N (where N is the number of sensor units in a testing group). frames indexed by DateTime at 1-hour averaged sampling frequency.

  • daily_df_list (list of pandas DataFrames): List of sensor data frames of length N (where N is the number of sensor units in a testing group). frames indexed by DateTime at 24-hour averaged sampling frequency.

Return type

(tuple)