radarx.retrieve.qpe_ensemble.qpe_error_ensemble#
- radarx.retrieve.qpe_ensemble.qpe_error_ensemble(accumulation, *, sigma_ln, correlation_length, shares=(0.3, 0.5, 0.2), members=30, seed=0, scale=None)[source]#
Ensemble of a rainfall accumulation under a multiplicative lognormal error.
Member
kisaccumulation * exp(s w z_k - s**2 w**2 / 2)(see the module description), so the mean of the members is the accumulation and the variance of one member of a constant fieldAisA**2 (exp(s**2 w**2) - 1). The members are reproducible: memberkis drawn fromnumpy.random.SeedSequence(seed).spawn(members)[k], so the same seed gives the same members and more members do not change the first ones.- Parameters:
accumulation (
xarray.DataArray) – Depth in mm (or any positive quantity that adds up in time) on a regular grid with 2-D dimensions and coordinates in metres (the last two dimensions are taken as y and x).sigma_ln (
float) – Standard deviationsofln(truth / estimate)(0.3 is about 30 %), between 0 and 3.correlation_length (
float) – Correlation lengthLof the spatially correlated part, in metres.shares (sequence of
three floats, optional) – Shares of the variance ofzin(common, spatial, nugget): non-negative and adding up to 1. Default(0.3, 0.5, 0.2), an assumption, not a measurement; take them fromqpe_error_model()when gauges are available.members (
int, optional) – Number of members, 2 or more. Default 30.seed (
int, optional) – Seed of the random numbers. Default 0.scale (
xarray.DataArrayorarray_like, optional) –w: scales the error cell by cell (for example the relative uncertainty of the estimate divided by its median). Default 1.
- Returns:
xarray.DataArray–float32members on the dimensionmemberfollowed by the dimensions ofaccumulation, in the units ofaccumulation.- Raises:
ValueError – For wrong
sigma_ln,shares,members,correlation_lengthor an irregular grid.
Notes
Dask. This function computes the dask array: it simulates correlated fields over the whole grid. The input is loaded into memory and the result is held in memory.
See also
qpe_error_model,exceedance_probability,reliabilityReferences
Examples
>>> ens = radarx.retrieve.qpe_error_ensemble( ... acc, sigma_ln=0.35, correlation_length=25e3, members=100 ... ) >>> p = radarx.retrieve.exceedance_probability(ens, 25.0)