Skip to content

steady_state_detection

steady_state_detection ¤

SteadyStateDetectionEvents ¤

SteadyStateDetectionEvents(
    dataframe: DataFrame,
    signal_uuid: str,
    *,
    event_uuid: str = "eng:steady_state",
    value_column: str = "value_double",
    time_column: str = "systime"
)

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.

detect_steady_state ¤

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:

Name Type Description Default
window str

Rolling window for std computation.

'5min'
std_threshold float

Maximum rolling std to consider steady.

1.0
min_duration str

Minimum duration of a steady interval.

'10min'
interval_end str

"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:

Type Description
DataFrame

DataFrame with columns: start, end, uuid, source_uuid, is_delta,

DataFrame

mean_value, std_value, duration_seconds.

detect_transient_periods ¤

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:

Name Type Description Default
window str

Rolling window for std computation.

'5min'
std_threshold float

Minimum rolling std to consider transient.

1.0
interval_end str

"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:

Type Description
DataFrame

DataFrame with columns: start, end, uuid, source_uuid, is_delta,

DataFrame

max_std, duration_seconds.

steady_state_statistics ¤

steady_state_statistics(
    window: str = ...,
    std_threshold: float = ...,
    min_duration: str = ...,
    *,
    as_frame: Literal[True] = ...
) -> pd.DataFrame
steady_state_statistics(
    window: str = ...,
    std_threshold: float = ...,
    min_duration: str = ...,
    *,
    as_frame: Literal[False]
) -> dict[str, Any]
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:

Name Type Description Default
window str

Rolling window for the std computation (pandas offset string), passed to :meth:detect_steady_state.

'5min'
std_threshold float

Maximum rolling std, in signal units, to consider the signal steady.

1.0
min_duration str

Minimum duration of a steady interval.

'10min'
as_frame bool

When 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:

Name Type Description
DataFrame | dict[str, Any]

With as_frame=True (default), a one-row summary DataFrame with

columns DataFrame | 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.

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 ¤

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:

Name Type Description Default
window str

Rolling window for the std computation (pandas offset string), passed to :meth:detect_steady_state.

'5min'
std_threshold float

Maximum rolling std, in signal units, to consider the signal steady.

1.0
min_duration str

Minimum duration of a steady interval.

'10min'

Returns:

Type Description
DataFrame

DataFrame with columns: start, end, mean_value, lower_band,

DataFrame

upper_band, duration_seconds.