climpred.classes.HindcastEnsemble.plot_alignment#
- HindcastEnsemble.plot_alignment(alignment: str | List[str] | None = None, reference: str | List[str] | None = None, date2num_units: str = 'days since 1960-01-01', return_xr: bool = False, cmap: str = 'viridis', edgecolors: str = 'gray', **plot_kwargs: Any) Any[source]#
Plot
initializedvalid_timewhere matchingverificationtime.Depends on
alignment. Plotsdays since reference datecontrolled bydate2num_units.NaN/ white space shows where no verification is done.- Parameters:
alignment – which inits or verification times should be aligned?
"maximize": maximize the degrees of freedom by slicinginitializedandverifto a common time frame at each lead."same_inits": slice to a commoninitframe prior to computing metric. This philosophy follows the thought that each lead should be based on the same set of initializations."same_verif": slice to a common/consistent verification time frame prior to computing metric. This philosophy follows the thought that each lead should be based on the same set of verification dates.Nonedefaults to the three above.
reference – Type of reference forecasts with which to verify against. One or more of
["uninitialized", "persistence", "climatology"]. Defaults toNonemeaning no reference.date2num_units – passed to
cftime.date2numas unitsreturn_xr – if
Truereturnxarray.DataArrayelse plotcmap – color palette
edgecolors – color of the edges in the plot
**plot_kwargs – arguments passed to
plot.
- Returns:
xarray.DataArrayifreturn_xrelse plot
Example
>>> HindcastEnsemble.plot_alignment(alignment=None, return_xr=True) <xarray.DataArray 'valid_time' (alignment: 3, lead: 10, init: 61)> Size: 15kB array([[[-1826., -1461., -1095., ..., nan, nan, nan], [-1461., -1095., -730., ..., nan, nan, nan], [-1095., -730., -365., ..., nan, nan, nan], ..., [ 731., 1096., 1461., ..., nan, nan, nan], [ 1096., 1461., 1827., ..., nan, nan, nan], [ 1461., 1827., 2192., ..., nan, nan, nan]], [[ nan, nan, nan, ..., 19359., 19724., 20089.], [ nan, nan, nan, ..., 19724., 20089., nan], [ nan, nan, nan, ..., 20089., nan, nan], ..., [ nan, nan, 1461., ..., nan, nan, nan], [ nan, 1461., 1827., ..., nan, nan, nan], [ 1461., 1827., 2192., ..., nan, nan, nan]], [[-1826., -1461., -1095., ..., 19359., 19724., 20089.], [-1461., -1095., -730., ..., 19724., 20089., nan], [-1095., -730., -365., ..., 20089., nan, nan], ..., [ 731., 1096., 1461., ..., nan, nan, nan], [ 1096., 1461., 1827., ..., nan, nan, nan], [ 1461., 1827., 2192., ..., nan, nan, nan]]], shape=(3, 10, 61)) Coordinates: * init (init) object 488B 1954-01-01 00:00:00 ... 2014-01-01 00:00:00 * lead (lead) int32 40B 1 2 3 4 5 6 7 8 9 10 * alignment (alignment) <U10 120B 'same_init' 'same_verif' 'maximize' valid_time (lead, init) object 5kB 1955-01-01 00:00:00 ... 2024-01-01 00... Attributes: units: days since 1960-01-01
>>> HindcastEnsemble.plot_alignment( ... alignment="same_verifs" ... ) <matplotlib.collections.QuadMesh object at 0x1405c1520>