diagnostic.diagnostic.Ensemble2Ref#
- class Ensemble2Ref(diagnostic_function, plotting_function, name=None, description=None)[source]#
Bases:
Diagnostic
A class representing a diagnostic that compares an ensemble to a reference.
- __init__(diagnostic_function, plotting_function, name=None, description=None)[source]#
Initialize the Ensemble2Ref diagnostic.
Methods
__init__
(diagnostic_function, plotting_function)Initialize the Ensemble2Ref diagnostic.
apply
(dt, ref, **kwargs)Apply the diagnostic to the data.
plot
(result[, facetted])Plot the diagnostic.
Attributes
Generate the docstring for the diagnostic.
- apply(dt: DataTree, ref, **kwargs)[source]#
Apply the diagnostic to the data.
- Parameters:
dt (DataTree) – The data to apply the diagnostic to.
ref (xr.DataSet or DataTree) – The reference data to compare the data to.
- Returns:
The data after applying the diagnostic as a DataTree or a dictionary of results with the tree nodes as keys.
- Return type:
DataTree or dict
- property description#
Generate the docstring for the diagnostic.
- plot(result, facetted=True, **kwargs)[source]#
Plot the diagnostic.
If axes are provided, the diagnostic is plotted facetted. If ax is provided, the diagnostic is plotted non-facetted. If neither axes nor ax are provided, the diagnostic is plotted on the current axis and no facetting is applied.
- Parameters:
result (DataTree) – The result of applying the ensemble diagnostic to a DataTree.
- Returns:
The figure representing the diagnostic.
- Return type:
Figure