smash.Model.prcp_indices#
- Model.prcp_indices()[source]#
Compute precipitations indices of the Model.
4 precipitation indices are calculated for each gauge and each time step:
std: The precipitation spatial standard deviation,d1: The first scaled moment, [Zoccatelli et al., 2011]d2: The second scaled moment, [Zoccatelli et al., 2011]vg: The vertical gap. [Emmanuel et al., 2015]
Hint
See the User Guide for more.
- Returns:
- resPrcpIndicesResult
The precipitation indices results represented as a
PrcpIndicesResultobject.
See also
PrcpIndicesResultRepresents the precipitation indices result.
Examples
>>> setup, mesh = smash.load_dataset("cance") >>> model = smash.Model(setup, mesh) >>> res = model.prcp_indices() >>> res d1: array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], dtype=float32) ... vg: array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], dtype=float32)
Each attribute is a numpy.ndarray of shape (number of gauge, number of time step)
>>> res.d1.shape (3, 1440)
NaN value means that there is no precipitation at this specific gauge and time step. Using numpy.where to find the index where precipitation indices were calculated on the most downstream gauge for the first scaled moment.
>>> ind = np.argwhere(~np.isnan(res.d1[0,:])).squeeze()
Viewing the first scaled moment on the first time step where rainfall occured on the most downstream gauge.
>>> res.d1[0, ind[0]] 1.209175