radarx.retrieve.nowcast_verification.rank_histogram#
- radarx.retrieve.nowcast_verification.rank_histogram(ensemble, observed, *, member_dim='member', seed=None)[source]#
Rank histogram (Talagrand diagram) of an ensemble.
The rank of the observation among the sorted members, from 0 (below all) to
m(above all), is counted over all points. A flat histogram is necessary for a reliable ensemble; a U shape means too little spread, a dome too much (Hamill 2001 [1]). Where the observation equals some members (the no-echo value, for one) its rank is drawn at random among the tied positions, so that ties do not fill the lowest rank. Points where the observation or a member is NaN are left out.- Parameters:
ensemble (
xarray.DataArray) – Forecast with a member dimension.observed (
xarray.DataArray) – Observation, broadcast against the ensemble without the members.member_dim (
str, optional) – Name of the member dimension. Default"member".seed (
int, optional) – Seed of the random numbers for the ties.
- Returns:
xarray.DataArray– Counts on the dimensionrank(0 tom).- Raises:
ValueError – If the ensemble has no dimension
member_dim.
Notes
Dask. This function computes the dask array: it ranks the observation among the members everywhere. The input is loaded into memory and the result is held in memory.
See also
References
Examples
>>> hist = radarx.retrieve.rank_histogram(ens, truth)