pytuflow.HydTablesCheck.section

pytuflow.HydTablesCheck.section#

HydTablesCheck.section(locations, data_types, time=-1, *args, **kwargs)#

Returns section data for the given locations and data types from the 1D tables check file.

This method supports returning multiple locations and data types. As a consequence, the returned DataFrame will use pd.MultiIndex columns since the returned DataFrame is not guaranteed to share a common index. The column index will be made up of 2 levels: the first level is the location name and what part of the processing stage the data came from (e.g. xs, processed, channel). The second level will be the normal column names, such as elevation and flow width. The first column of any grouped level 1 index, will be the index column.

E.g. if you are getting elevation and manning n data for cross-section XS001 the level 1 will all be XS001/xs and the level 2 indexes will be distance, elevation, manning n. The first column (distance) should be treated as the index column for this group.

Parameters:
  • locations (str or list[str]) – The locations to return data for. This can be a single location or a list of locations.

  • data_types (str or list[str]) – The data types to return. This can be a single data type or a list of data types.

  • time (TimeLike, optional) – The time to return data for. This is not used for this class and can be ignored.

Returns:

The section data for the given locations and data types.

Return type:

pd.DataFrame

Examples

Return the processed flow width for channel FC01.39:

>>> hyd_tables = HydTablesCheck('/path/to/1d_ta_tables_check.csv')
>>> hyd_tables.section('FC01.39', 'flow width')
   FC01.39/channel
         elevation flow width
0           45.500      0.002
1           45.517      0.929
2           45.717      3.781
3           45.917      4.414
4           46.117      5.069
...           ...         ...
30          51.317     23.462
31          51.517     23.655
32          51.717     23.848
33          51.917     24.172
34          51.926     24.194