Skip to main content
Version: Next

ts_shape.events.engineering.steady_state_detection

Classes
NameDescription
SteadyStateDetectionEventsEngineering: Steady-State Detection

SteadyStateDetectionEvents​

classsource
SteadyStateDetectionEvents(
dataframe: pd.DataFrame,
signal_uuid: str,
*,
event_uuid: str = "eng:steady_state",
value_column: str = "value_double",
time_column: str = "systime"
) -> None

Bases: Base

Engineering: Steady-State Detection

Identify when a process signal has settled into a steady operating state (low variance, no trend) versus transient/dynamic periods.

Methods:

  • detect_steady_state: Intervals where rolling std stays below threshold.
  • detect_transient_periods: Inverse — intervals where signal is changing.
  • steady_state_statistics: Summary of steady vs transient time (one row).
  • steady_state_value_bands: Operating band (mean +/- std) per steady interval.
Functions
NameDescription
detect_steady_stateDetect intervals where signal is in steady state.
detect_transient_periodsDetect intervals where signal is in transient/dynamic state.
steady_state_statisticsSummary statistics of steady vs transient time.
steady_state_value_bandsOperating band (mean +/- std) for each steady-state interval.
Parameters
NameTypeDescriptionDefault
dataframeDataFrameLong-format timeseries frame (one row per sample, uuid identifies the signal).required
signal_uuidstrUUID of the signal to analyze.required
event_uuidstrUUID stamped on emitted events.'eng:steady_state'
value_columnstrColumn holding the signal values.'value_double'
time_columnstrTimestamp column.'systime'

detect_steady_state​

methodsource
detect_steady_state(
window: str = "5min",
std_threshold: float = 1.0,
min_duration: str = "10min",
*,
interval_end: str = "next_change"
) -> pd.DataFrame

Detect intervals where signal is in steady state.

Parameters
NameTypeDescriptionDefault
windowstrRolling window for std computation.'5min'
std_thresholdfloatMaximum rolling std to consider steady.1.0
min_durationstrMinimum duration of a steady interval.'10min'
interval_endstr"next_change" (default) ends an interval at the next sample (the transition), so the interval spans the time the condition held and change-encoded signals -- one row per change -- keep their duration. "last_sample" ends it at its last flagged sample. See :func:ts_shape.utils.intervals.interval_end_times.'next_change'
Returns
TypeDescription
DataFrameDataFrame with columns: start, end, uuid, source_uuid, is_delta,
DataFramemean_value, std_value, duration_seconds. mean_value and
DataFramestd_value (sample std; 0.0 for a single sample) are taken over
DataFramethe steady samples only -- the samples whose rolling std is below
DataFramestd_threshold -- not over the sample that ends the interval
DataFramewith interval_end="next_change".

detect_transient_periods​

methodsource
detect_transient_periods(
window: str = "5min",
std_threshold: float = 1.0,
*,
interval_end: str = "next_change"
) -> pd.DataFrame

Detect intervals where signal is in transient/dynamic state.

Parameters
NameTypeDescriptionDefault
windowstrRolling window for std computation.'5min'
std_thresholdfloatMinimum rolling std to consider transient.1.0
interval_endstr"next_change" (default) ends an interval at the next sample (the transition), so the interval spans the time the condition held and change-encoded signals -- one row per change -- keep their duration. "last_sample" ends it at its last flagged sample. See :func:ts_shape.utils.intervals.interval_end_times.'next_change'
Returns
TypeDescription
DataFrameDataFrame with columns: start, end, uuid, source_uuid, is_delta,
DataFramemax_std, duration_seconds.

steady_state_statistics​

methodsource
steady_state_statistics(
window: str = "5min",
std_threshold: float = 1.0,
min_duration: str = "10min",
*,
as_frame: bool = True
) -> pd.DataFrame | dict[str, Any]

Summary statistics of steady vs transient time.

Parameters
NameTypeDescriptionDefault
windowstrRolling window for the std computation (pandas offset string), passed to :meth:detect_steady_state.'5min'
std_thresholdfloatMaximum rolling std, in signal units, to consider the signal steady.1.0
min_durationstrMinimum duration of a steady interval.'10min'
as_frameboolWhen True (default), return a one-row DataFrame (see below). as_frame=False returns the dictionary form; it is deprecated, emits a DeprecationWarning and will be removed in the next major release.True
Returns
NameTypeDescription
DataFrame | dict[str, Any]With as_frame=True (default), a one-row summary DataFrame with
columnsDataFrame | dict[str, Any]start, end, duration_seconds (the span of the signal;
DataFrame | dict[str, Any]NaT / 0 without data), uuid (event uuid), source_uuid (signal
DataFrame | dict[str, Any]uuid), total_steady_seconds, total_transient_seconds, steady_pct,
DataFrame | dict[str, Any]num_steady_periods, avg_steady_duration_seconds. steady_pct
DataFrame | dict[str, Any]is NaN when the signal has no time span (no data, one sample, or
DataFrame | dict[str, Any]all samples at one instant) and avg_steady_duration_seconds
DataFrame | dict[str, Any]is NaN when there is no steady period to average.
DataFrame | dict[str, Any]With as_frame=False (deprecated), a dict with the same keys
DataFrame | dict[str, Any]from total_steady_seconds on.

steady_state_value_bands​

methodsource
steady_state_value_bands(
window: str = "5min",
std_threshold: float = 1.0,
min_duration: str = "10min",
) -> pd.DataFrame

Operating band (mean +/- std) for each steady-state interval.

Parameters
NameTypeDescriptionDefault
windowstrRolling window for the std computation (pandas offset string), passed to :meth:detect_steady_state.'5min'
std_thresholdfloatMaximum rolling std, in signal units, to consider the signal steady.1.0
min_durationstrMinimum duration of a steady interval.'10min'
Returns
TypeDescription
DataFrameDataFrame with columns: start, end, mean_value, lower_band,
DataFrameupper_band, duration_seconds.