pytuflow.DAT.minimum#
- DAT.minimum(data_types, averaging_method=None, split_vector_components=False)#
Returns the minimum values for the given data types.
Some formats store minimum values in the metadata (e.g. XMDF), if this is the case, the minimum values will be returned directly from the metadata. If the format does not store minimum values, the minimum values will be calculated from the data. In this case, the minimum 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 minimum depth data.If multiple data types are requested, a DataFrame will be returned with the data types as the index and the minimum 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 minimum values for.
averaging_method (str, optional) –
The depth-averaging method to use. Only applicable for 3D results. If set to
None(the default), then the minimum will be calculated from all vertical levels. If a depth averaging method is used, then the minimum will be calculated from the depth-averaged data.The averaging methods are:
Nonesinglelevelmultileveldepthheightelevationsigma
The averaging method parameters can be adjusted by building them into the method string in a URI style format. The format is as follows:
<method>?dir=<dir>&<value1>&<value2>The averaging method parameters can be adjusted by building them into the method string in a URI style format. The format is as follows:
<method>?dir=<dir>&<value1>&<value2>Where
<method>is the averaging method name<dir>is the direction,toporbottom(i.e. from top or from bottom) - only used by certain averaging methods<value1>,<value2>… are the values to be used in the averaging method (the number required to be passed depends on the averaging method)
e.g.
'singlelevel?dir=top&1'uses the single level averaging method and takes the first vertical layer from the top. Or'sigma&0.1&0.9'uses the sigma averaging method and averages values located between the 10th and 90th water column depth.split_vector_components (bool, optional) – Whether to split vector components into separate x and y values and calculate minimums for each component separately. Only applicable for vector data types. Components are calculated separately and do not necessarily represent a single point in space and time and magnitudes should not be calculated from the returned values. Components will be returned as a tuple i.e.
[vec-x, vec-y].
- Returns:
The minimum value(s) for the given data type(s).
- Return type:
float | tuple[float, float] | pd.DataFrame
Examples
Get the minimum water level for a given mesh:
>>> mesh = ... # Assume mesh is a loaded Mesh result >>> mesh.minimum('water level') 33.456789
Get the minimum velocity and depth for multiple data types:
>>> mesh.minimum(['vector velocity', 'depth']) minimum vector velocity 0. depth 0.