AnalysisData
AnalysisData(
exact=None,
interval=None,
threshold=None,
uncertain=None,
low_outlier_threshold=None,
mgbt_low_outliers=False,
)Censored observation data for an analysis.
Beyond a plain systematic record (exact), a frame can carry the censored observation types Bulletin 17C flood-frequency work depends on: historical or paleoflood observations known only within a range (interval), perception thresholds recording that nothing above a level occurred over a span of years (threshold), and observations whose measurement error is itself a distribution (uncertain).
This is the port of the RMC.BestFit DataFrame class, named AnalysisData to avoid colliding with :class:pandas.DataFrame.
Indexes are 0-based, matching the C# library and the shared C++ core, and are generated sequentially when not supplied. An index is a position in the record, so an interval observation at index 40 sits after the 40th exact observation in chronological order.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| exact | array_like or dict | Observations, or a mapping with a "value" key plus optional "index" and "is_low_outlier" keys. |
None |
| interval | dict | Mapping with "lower", "value", and "upper" keys plus an optional "index", giving observations known only to lie in a range. |
None |
| threshold | dict | Mapping with "start_index", "end_index", "value", and "number_above" keys, giving perception thresholds over spans of the record. |
None |
| uncertain | sequence of Distribution or dict | One distribution per observation, or a mapping with "index" and "distribution" keys. |
None |
| low_outlier_threshold | float | Values at or below it are treated as left-censored low outliers. | None |
| mgbt_low_outliers | bool | Let the Multiple Grubbs-Beck test pick the low outlier threshold from the data. Mutually exclusive with low_outlier_threshold and with explicit is_low_outlier flags. |
False |
Examples
>>> peaks = [12500, 15300, 8900, 22100, 18700, 14200, 9800, 28500]
>>> AnalysisData(peaks)
<AnalysisData 8 exact>Two historical floods known only within a range, and a perception threshold covering the 40 years before the gauge was installed:
>>> AnalysisData(
... exact=peaks,
... interval={"index": [8, 9], "lower": [30000, 26000],
... "value": [35000, 29000], "upper": [40000, 32000]},
... threshold={"start_index": 8, "end_index": 47,
... "value": 25000, "number_above": 2},
... )
<AnalysisData 8 exact, 2 interval, 1 threshold>Methods
| Name | Description |
|---|---|
| to_json | The frame as the JSON spec the shared C++ core parses. |
to_json
AnalysisData.to_json()The frame as the JSON spec the shared C++ core parses.