EvaluationDiagnosticSuite#
- class rojak.turbulence.diagnostic.EvaluationDiagnosticSuite(factory, diagnostics, severities=None, pressure_levels=None, probability_thresholds=None, edr_thresholds=TurbulenceThresholds(light=0.1, light_to_moderate=None, moderate=0.2, moderate_to_severe=None, severe=0.45), threshold_mode=None, distribution_parameters=None)[source]#
A
DiagnosticSuitecomputed on an evaluation dataset, with severity- and threshold-based post-processingBuilding on the thresholds and distribution parameters derived from a
CalibrationDiagnosticSuite, this class computes the probability of encountering turbulence of each severity (probabilities), maps diagnostic values onto the EDR scale (edr), and identifies boolean turbulent regions (compute_turbulent_regions()), for every diagnostic in the suite.- Parameters:
factory (DiagnosticFactory)
diagnostics (list[TurbulenceDiagnostics])
severities (list[TurbulenceSeverity] | None)
probability_thresholds (Mapping[DiagnosticName, TurbulenceThresholds] | None)
edr_thresholds (TurbulenceThresholds)
threshold_mode (TurbulenceThresholdMode | None)
distribution_parameters (Mapping[DiagnosticName, DistributionParameters] | None)
- __init__(factory, diagnostics, severities=None, pressure_levels=None, probability_thresholds=None, edr_thresholds=TurbulenceThresholds(light=0.1, light_to_moderate=None, moderate=0.2, moderate_to_severe=None, severe=0.45), threshold_mode=None, distribution_parameters=None)[source]#
- Parameters:
factory (DiagnosticFactory) – Factory used to compute
diagnosticsdiagnostics (list[TurbulenceDiagnostics]) – Turbulence diagnostics to include in the suite
severities (list[TurbulenceSeverity] | None) – Turbulence severities used by
probabilities,get_limits_for_severities(),get_edr_bounds(), andcompute_turbulent_regions(). Required by those methods.pressure_levels (list[float] | None) – Pressure levels used by
probabilitiesandcompute_turbulent_regions(). Required by those methods.probability_thresholds (Mapping[DiagnosticName, TurbulenceThresholds] | None) – Mapping from diagnostic name to its
TurbulenceThresholds, used byprobabilities,get_limits_for_severities(), andcompute_turbulent_regions(). Must have an entry for every diagnostic in the suite if provided.edr_thresholds (TurbulenceThresholds) – Thresholds (in EDR) used by
get_edr_bounds(). Defaults tomedium_transport_edr_thresholds.threshold_mode (TurbulenceThresholdMode | None) – Whether the thresholds are bounded intervals or lower bounds. Required by
probabilities,get_limits_for_severities(),get_edr_bounds(), andcompute_turbulent_regions().distribution_parameters (Mapping[DiagnosticName, DistributionParameters] | None) – Mapping from diagnostic name to its
DistributionParameters, used byedr. Must have an entry for every diagnostic in the suite if provided.
- Raises:
KeyError – If
distribution_parametersorprobability_thresholdsis provided but is missing an entry for one of the diagnostics in the suite- Return type:
None
Methods
__init__(factory, diagnostics[, severities, ...])as_dataset()Combine every diagnostic's computed value into a single Dataset
compute_turbulent_regions()Compute the boolean turbulent region mask for each severity, for every diagnostic in the suite
computed_values(progress_description)Iterate over the name and computed value of each diagnostic in the suite
computed_values_as_dict()Same as
computed_values(), collected eagerly into a dict (without a progress bar)diagnostic_names()Names of the diagnostics in the suite
export_as_zarr(output_path, /, *[, zarr_format])Export every diagnostic's computed value (see
as_dataset()) to a zarr storeget_edr_bounds()Iterate over the EDR threshold bounds for each severity
get_limits_for_severities()Iterate over the probability threshold bounds for each severity, for every diagnostic in the suite
get_prototype_computed_diagnostic()An arbitrary diagnostic's computed value, used where any one diagnostic's shape/coords will do
load_from_zarr(path, target_diagnostics, *)Construct a
DiagnosticSuitefrom a zarr store of previously-exported diagnostic valuesthresholds()Probability thresholds provided in
__init__(), if anyAttributes
edrDiagnostic values mapped onto the EDR scale, for every diagnostic in the suite
pressure_levelsPressure levels provided in
__init__(), if anyprobabilitiesProbability (in percent) of encountering turbulence of each severity, for every diagnostic in the suite