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 DiagnosticSuite computed on an evaluation dataset, with severity- and threshold-based post-processing

Building 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:
__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 diagnostics

  • diagnostics (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(), and compute_turbulent_regions(). Required by those methods.

  • pressure_levels (list[float] | None) – Pressure levels used by probabilities and compute_turbulent_regions(). Required by those methods.

  • probability_thresholds (Mapping[DiagnosticName, TurbulenceThresholds] | None) – Mapping from diagnostic name to its TurbulenceThresholds, used by probabilities, get_limits_for_severities(), and compute_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 to medium_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(), and compute_turbulent_regions().

  • distribution_parameters (Mapping[DiagnosticName, DistributionParameters] | None) – Mapping from diagnostic name to its DistributionParameters, used by edr. Must have an entry for every diagnostic in the suite if provided.

Raises:

KeyError – If distribution_parameters or probability_thresholds is 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 store

get_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 DiagnosticSuite from a zarr store of previously-exported diagnostic values

thresholds()

Probability thresholds provided in __init__(), if any

Attributes

edr

Diagnostic values mapped onto the EDR scale, for every diagnostic in the suite

pressure_levels

Pressure levels provided in __init__(), if any

probabilities

Probability (in percent) of encountering turbulence of each severity, for every diagnostic in the suite