RelationshipBetweenXAndTurbulence#

class rojak.turbulence.analysis.RelationshipBetweenXAndTurbulence(other_feature, turbulence_diagnostics, relationship_between, diagnostic_thresholds=None, feature_name=None, use_log=True, sum_over_dim='time')[source]#

Computes the association between a feature and every turbulence diagnostic in a Dataset

For each diagnostic in turbulence_diagnostics, constructs the appropriate RelationshipBetween (via RelationshipBetweenFactory) between other_feature and that diagnostic (optionally thresholded first, see diagnostic_thresholds), and collects the results into a Dataset keyed by diagnostic name.

Parameters:
__init__(other_feature, turbulence_diagnostics, relationship_between, diagnostic_thresholds=None, feature_name=None, use_log=True, sum_over_dim='time')[source]#
Parameters:
  • other_feature (DataArray) – Binary feature to compute the relationship against each turbulence diagnostic

  • turbulence_diagnostics (Dataset) – Dataset of turbulence diagnostics. If diagnostic_thresholds is not provided, these must already be boolean.

  • relationship_between (RelationshipBetweenTypes) – Type of association measure to compute for each diagnostic

  • diagnostic_thresholds (Mapping[str, float] | None) – Optional mapping from diagnostic name to a threshold value; if provided, each diagnostic is first thresholded (>=) to obtain a boolean DataArray. Must be a superset of turbulence_diagnostics’s variable names.

  • feature_name (str | None) – Name of other_feature, used in the progress bar description. Defaults to "feature".

  • use_log (bool) – Passed to RelationshipBetweenFactory.create(). Defaults to True.

  • sum_over_dim (str | list[str] | None) – Dimension(s) to sum over when computing the contingency table. Defaults to "time".

Raises:

AssertionError – If diagnostic_thresholds is provided but is not a superset of turbulence_diagnostics’s variable names

Return type:

None

Methods

__init__(other_feature, ...[, ...])

execute()

Compute the association measure between self._other_feature and each turbulence diagnostic