perda.core_data_structures.split_helpers#

perda.core_data_structures.split_helpers.split_single_run_data(data, split_timestamps)[source]#

Split a SingleRunData into segments defined by a list of boundary timestamps.

Each consecutive pair of timestamps in split_timestamps defines one segment. The result is keyed by 1-based segment number.

Parameters:
  • data (SingleRunData)

  • split_timestamps (list[float]) – Ordered boundary timestamps in the same unit as data.timestamp_unit. Must contain at least 2 values.

Return type:

List[SingleRunData]

perda.core_data_structures.split_helpers.trim_single_run_data(data, ts_start, ts_end)[source]#

Return a new SingleRunData with every variable trimmed to [ts_start, ts_end].

Parameters:
  • data (SingleRunData)

  • ts_start (float) – Timestamps in the same unit as data.timestamp_unit.

  • ts_end (float) – Timestamps in the same unit as data.timestamp_unit.

Returns:

Fresh object; the original is not mutated.

Return type:

SingleRunData