ts_shape.events.quality.measurement_uncertainty
| Name | Description |
|---|---|
MeasurementUncertaintyEvents | Quality: GUM-based Measurement Uncertainty Estimation |
MeasurementUncertaintyEvents
MeasurementUncertaintyEvents(
dataframe: pd.DataFrame,
signal_uuid: str,
*,
value_column: str = "value_double",
part_uuid: str | None = None,
event_uuid: str = "quality:uncertainty",
time_column: str = "systime"
) -> None
Bases: Base
Quality: GUM-based Measurement Uncertainty Estimation
Compute Type A (statistical) and Type B (external sources) uncertainty, combined and expanded uncertainty, and uncertainty budgets per ISO/IEC Guide 98-3 (GUM).
Methods:
- type_a_uncertainty: Statistical uncertainty from repeated measurements.
- type_b_uncertainty: Uncertainty from calibration certs, resolution, etc.
- combined_uncertainty: Root-sum-of-squares combination with expansion.
- uncertainty_budget: Contribution breakdown by source.
part_uuid is deprecated: it has no effect (no method groups by
part) and will be removed in the next major release; passing it emits a
DeprecationWarning.
| Name | Description |
|---|---|
type_a_uncertainty | Statistical (Type A) uncertainty from repeated measurements. |
type_b_uncertainty | Type B uncertainty from external sources (GUM method). |
combined_uncertainty | Combined and expanded uncertainty (GUM). |
uncertainty_budget | Uncertainty budget — contribution breakdown by source. |
| 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 measurement signal. | required |
value_column | str | Column holding the signal values. | 'value_double' |
part_uuid | str | None | Deprecated; has no effect and warns when given. | None |
event_uuid | str | UUID stamped on emitted events. | 'quality:uncertainty' |
time_column | str | Timestamp column. | 'systime' |
type_a_uncertainty
type_a_uncertainty(window: str = '8h') -> pd.DataFrame
Statistical (Type A) uncertainty from repeated measurements.
u_A = std / sqrt(n) per time window.
| Name | Type | Description | Default |
|---|---|---|---|
window | str | Resample window size. | '8h' |
| Type | Description |
|---|---|
DataFrame | Summary DataFrame with columns: start, end, duration_seconds |
DataFrame | (the window bounds), window_start (the resample label; a |
DataFrame | deprecated twin of start), mean, std, n_samples, |
DataFrame | type_a_uncertainty. |
DataFrame | Canonical twin columns: sample_count (after n_samples); each holds |
DataFrame | the same values as the deprecated column right before it, which is removed |
DataFrame | in the next major release. |
type_b_uncertainty
type_b_uncertainty(sources: list[dict[str, Any]]) -> pd.DataFrame
Type B uncertainty from external sources (GUM method).
| Name | Type | Description | Default |
|---|---|---|---|
sources | list[dict[str, Any]] | List of dicts, each with: - 'source': str (name, e.g. 'calibration', 'resolution') - 'half_width': float (half-width of distribution) - 'distribution': str ('rectangular' (default; also 'uniform'), 'triangular', 'normal' (also 'gaussian'), 'u-shaped' (also 'arcsine')). Any other name, or an unknown key, raises ValueError. | required |
| Type | Description |
|---|---|
DataFrame | DataFrame with columns: source, distribution, half_width, |
DataFrame | divisor, type_b_uncertainty. |
combined_uncertainty
combined_uncertainty(
window: str = "8h",
type_b_sources: list[dict[str, Any]] | None = None,
coverage_factor: float = 2.0,
) -> pd.DataFrame
Combined and expanded uncertainty (GUM).
u_c = sqrt(u_A² + sum(u_Bi²)) U = k × u_c
| Name | Type | Description | Default |
|---|---|---|---|
window | str | Resample window size. | '8h' |
type_b_sources | list[dict[str, Any]] | None | Type B sources (same format as type_b_uncertainty). | None |
coverage_factor | float | k value for expanded uncertainty (default 2.0 for ~95.45% coverage). | 2.0 |
| Type | Description |
|---|---|
DataFrame | Summary DataFrame with columns: start, end, duration_seconds |
DataFrame | (the window bounds), window_start (the resample label; a |
DataFrame | deprecated twin of start), type_a, type_b_combined, |
DataFrame | combined_uncertainty, expanded_uncertainty, coverage_factor. |
uncertainty_budget
uncertainty_budget(
window: str = "8h", type_b_sources: list[dict[str, Any]] | None = None
) -> pd.DataFrame
Uncertainty budget — contribution breakdown by source.
Shows which uncertainty source dominates (repeatability vs resolution vs calibration, etc).
| Name | Type | Description | Default |
|---|---|---|---|
window | str | Resample window size (uses mean Type A across windows). | '8h' |
type_b_sources | list[dict[str, Any]] | None | Type B sources. | None |
| Type | Description |
|---|---|
DataFrame | DataFrame with columns: source, uncertainty, pct_contribution. |
DataFrame | Canonical twin columns: contribution_pct (after pct_contribution); |
DataFrame | each holds the same values as the deprecated column right before it, which |
DataFrame | is removed in the next major release. |