climpred.horizon.horizon#
- climpred.horizon.horizon(cond)[source]#
Calculate the predictability horizon based on a condition
`cond.- Parameters:
cond (
xr.DataArray, xr.Dataset) – User-defined boolean array where True means the system is predictable at the given lead. E.g., this could be based on the dynamical forecast beating a reference forecast, p values, confidence intervals, etc. cond should contain the dimension lead at the minimum.- Returns:
xr.DataArray, xr.Dataset – predictability horizon reduced by
leaddimension.
Example
>>> skill = PerfectModelEnsemble.verify( ... metric="acc", ... comparison="m2e", ... dim=["init", "member"], ... reference=["persistence"], ... ) >>> horizon(skill.sel(skill="initialized") > skill.sel(skill="persistence")) <xarray.Dataset> Size: 8B Dimensions: () Data variables: tos float64 8B 15.0 Attributes: units: years standard_name: forecast_period long_name: Lead description: Forecast period is the time interval between the forecast...
>>> bskill = PerfectModelEnsemble.bootstrap( ... metric="acc", ... comparison="m2e", ... dim=["init", "member"], ... reference="uninitialized", ... iterations=201, ... resample_dim="init", ... ) >>> horizon(bskill.sel(skill="uninitialized", results="p") <= 0.05) <xarray.Dataset> Size: 108B Dimensions: () Coordinates: skill <U13 52B 'uninitialized' results <U12 48B 'p' Data variables: tos float64 8B 2.0 Attributes: units: years standard_name: forecast_period long_name: Lead description: Forecast period is the time interval between the forecast...