pytuflow.INFO.maximum

Contents

pytuflow.INFO.maximum#

INFO.maximum(locations, data_types, time_fmt='relative')#

Returns a DataFrame containing the maximum values for the given data types. The returned DataFrame will include time of maximum results as well.

It’s possible to pass in a well known shorthand for the data type e.g. q for flow.

The location can also be a filter string, e.g. channel to extract the maximum values for all channels. The following filters are available for the INFO class:

  • None: returns all maximum values

  • 1d: returns all maximum values (same as passing in None for locations)

  • node

  • channel

The returned DataFrame will have an index column corresponding to the location IDs, and the columns will be in the format obj/data_type/[max|tmax], e.g. channel/flow/max, channel/flow/tmax

Parameters:
  • locations (str | list[str]) – The location to extract the maximum values for. None will return all locations for the given data_types.

  • data_types (str | list[str]) – The data types to extract the maximum values for. None will return all data types for the given locations.

  • time_fmt (str, optional) – The format for the time of max result. Options are relative or absolute

Returns:

The maximum, and time of maximum values

Return type:

pd.DataFrame

Examples

Extracting the maximum flow for a given channel:

>>> res = ...  # Assume res is loaded result class
>>> res.maximum('ds1', 'flow')
     channel/flow/max  channel/flow/tmax
ds1            59.423           1.383333

Extracting all the maximum results for a given channel:

>>> res.maximum(['ds1'], None)
     channel/Flow/max  ...  channel/Velocity/tmax
ds1            59.423  ...               0.716667

Extracting the maximum flow for all channels:

>>> res.maximum(None, 'flow')
         channel/flow/max   channel/flow/tmax
ds1                 59.423           1.383333
ds2                 88.177           1.400000
...                  ...              ...
FC04.1_C             9.530           1.316667
FC_weir1            67.995           0.966667