smash.Model.event_segmentation#

Model.event_segmentation(peak_quant=0.995, max_duration=240)[source]#

Compute segmentation information of flood events over all catchments of the Model.

Hint

See the User Guide and Math / Num Documentation for more.

Parameters:
peak_quant: float, default 0.995

Events will be selected if their discharge peaks exceed the peak_quant-quantile of the observed discharge timeseries.

max_duration: float, default 240

The expected maximum duration of an event (in hours). If multiple events are detected, their duration may exceed this value.

Returns:
respandas.DataFrame

Flood events information obtained from segmentation algorithm. The dataframe has 6 columns which are

  • ‘code’ : the catchment code.

  • ‘start’ : the beginning of event.

  • ‘end’ : the end of event.

  • ‘maxrainfall’ : the moment that the maximum precipation is observed.

  • ‘flood’ : the moment that the maximum discharge is observed.

  • ‘season’ : the season that event occurrs.

Examples

>>> setup, mesh = smash.load_dataset("cance")
>>> model = smash.Model(setup, mesh)

Perform segmentation algorithm and display flood events infomation:

>>> res = model.event_segmentation()
>>> res
       code               start                   flood  season
0  V3524010 2014-11-03 03:00:00 ... 2014-11-04 19:00:00  autumn
1  V3515010 2014-11-03 10:00:00 ... 2014-11-04 20:00:00  autumn
2  V3517010 2014-11-03 08:00:00 ... 2014-11-04 16:00:00  autumn

[3 rows x 6 columns]