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 appropriateRelationshipBetween(viaRelationshipBetweenFactory) betweenother_featureand that diagnostic (optionally thresholded first, seediagnostic_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_thresholdsis 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 ofturbulence_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 toTrue.sum_over_dim (str | list[str] | None) – Dimension(s) to sum over when computing the contingency table. Defaults to
"time".
- Raises:
AssertionError – If
diagnostic_thresholdsis provided but is not a superset ofturbulence_diagnostics’s variable names- Return type:
None
Methods
__init__(other_feature, ...[, ...])execute()Compute the association measure between
self._other_featureand each turbulence diagnostic