TurbulentRegionFromThreshold#

class rojak.turbulence.analysis.TurbulentRegionFromThreshold(computed_diagnostic, severity, thresholds, threshold_mode, /, **sel_condition)[source]#

Computes a boolean mask of where a turbulence diagnostic falls within a given severity’s threshold bounds

Accepts either a single xarray.DataArray with a single TurbulenceThresholds, or an xarray.Dataset of diagnostics with a mapping from diagnostic name to that diagnostic’s TurbulenceThresholds.

Parameters:
__init__(computed_diagnostic, severity, thresholds, threshold_mode, /, **sel_condition)[source]#
Parameters:
  • computed_diagnostic (DataArray | Dataset) – Computed diagnostic value(s), either a single DataArray or a Dataset of diagnostics

  • severity (TurbulenceSeverity) – Turbulence severity to compute the boolean mask for

  • thresholds (TurbulenceThresholds | Mapping[DiagnosticName, TurbulenceThresholds]) – Threshold(s) to determine severity. Must be a mapping from diagnostic name to TurbulenceThresholds if computed_diagnostic is a Dataset, or a single TurbulenceThresholds if it is a DataArray

  • threshold_mode (TurbulenceThresholdMode) – Whether the thresholds are bounded intervals or lower bounds

  • **sel_condition – Passed to xarray.DataArray.sel()/xarray.Dataset.sel() to subset computed_diagnostic before computing the mask

Raises:
  • TypeError – If thresholds is not the shape (mapping or single value) expected for the type of computed_diagnostic

  • ValueError – If computed_diagnostic is a Dataset whose variables are not a subset of thresholds

Return type:

None

Methods

__init__(computed_diagnostic, severity, ...)

execute()

Compute the boolean turbulence mask(s) for self._computed_diagnostic