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:

Hint

See the User Guide for more.

Returns:
resPrcpIndicesResult

The precipitation indices results represented as a PrcpIndicesResult object.

See also

PrcpIndicesResult

Represents 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