pytuflow.NCGrid.maximum

Contents

pytuflow.NCGrid.maximum#

NCGrid.maximum(data_types)#

Returns the maximum values for the given data types.

Some formats store maximum values in the metadata (e.g. XMDF), if this is the case, the maximum values will be returned directly from the metadata. If the format does not store maximum values, the maximum values will be calculated from the data. In this case, the maximum and temporal datasets will be treated as separate. For example, if "depth" is requested as a data type, it will be calculated from the temporal depth data. If "max depth" is requested, it will be calculated from the maximum depth data.

If multiple data types are requested, a DataFrame will be returned with the data types as the index and the maximum values as the column. Vector results will return the magnitude of the vector.

Parameters:

data_types (str | list[str]) – The data types to return the maximum values for.

Returns:

The maximum value(s) for the given data type(s).

Return type:

float | pd.DataFrame

Examples

Get the maximum water level for a given mesh:

>>> grid = ... # Assume grid is a loaded Grid result
>>> grid.maximum('water level')
45.672345

Get the maximum velocity and depth for multiple data types:

>>> grid.maximum(['velocity', 'depth'])
                  maximum
velocity         1.234567
depth            5.678901