ts_shape.events.engineering.steady_state_detection
Classes
| Name | Description |
|---|---|
SteadyStateDetectionEvents | Engineering: Steady-State Detection |
SteadyStateDetectionEvents
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
| Name | Description |
|---|---|
detect_steady_state | Detect intervals where signal is in steady state. |
detect_transient_periods | Detect intervals where signal is in transient/dynamic state. |
steady_state_statistics | Summary statistics of steady vs transient time. |
steady_state_value_bands | Operating band (mean +/- std) for each steady-state interval. |
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
dataframe | DataFrame | Long-format timeseries frame (one row per sample, uuid identifies the signal). | required |
signal_uuid | str | UUID of the signal to analyze. | required |
event_uuid | str | UUID stamped on emitted events. | 'eng:steady_state' |
value_column | str | Column holding the signal values. | 'value_double' |
time_column | str | Timestamp column. | 'systime' |
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. mean_value and |
DataFrame | std_value (sample std; 0.0 for a single sample) are taken over |
DataFrame | the steady samples only -- the samples whose rolling std is below |
DataFrame | std_threshold -- not over the sample that ends the interval |
DataFrame | with interval_end="next_change". |
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 = "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. 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
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. |