pytuflow.FMTS.maximum#
- FMTS.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
forflow
.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 theFMTS
class:None
: returns all maximum values1d
: returns all maximum values (same as passing in None for locations)node
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.node/flow/max
,node/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
orabsolute
- Returns:
The maximum, and time of maximum values
- Return type:
pd.DataFrame
Examples
Extracting the maximum flow for a given channel:
>>> res = FMTS('path/to/result.zzn', dat='path/to/result.dat') >>> res.maximum('ds1', 'flow') node/flow/max node/flow/tmax ds2 22.05114 1.583333
Extracting all the maximum results for a given channel:
>>> res.maximum(['ds1'], None) node/flow/max node/flow/tmax ... node/state/max node/state/tmax ds2 22.05114 1.583333 ... 0.0 0.0
Extracting the maximum flow for all channels:
>>> res.maximum(None, 'flow') node/flow/max node/flow/tmax FC01.36 0.840000 0.000000 FC01.35 10.011658 0.333333 FC01.351cu 3.337249 0.333333 FC01.351cd 3.337087 0.333333 FC01.351co 3.337087 0.333333 ... ... ... FC01.2_Rd5 4.428591 1.500000 FC01.2_Ro5 4.428591 1.500000 FC02 0.080000 0.000000 ds2_S 22.051140 1.583333 FC01 0.920000 0.000000