pytuflow.FVBCTide.section

pytuflow.FVBCTide.section#

FVBCTide.section(locations, data_types, time, *args, **kwargs)#

Returns a DataFrame containing the long plot data for the given location(s) and data type(s).

Multiple locations can be passed in as a list. To be consistent with section data extraction, the data is stored vertically with the branch_id and node_string columns denoting the locations of the different plotted nodestrings.

The returned DataFrame will have the following columns:

  • branch_id: The ID of the branch (nodestring) that the data is from (starts at zero and increments).

  • node_string: The name of the nodestring.

  • offset: The offset along the nodestring.

  • data_type: The data type (e.g. water level).

Parameters:
  • locations (str | list[str]) – The location to extract the long plot data for (i.e. the nodestring names).

  • data_types (str | list[str]) – The data types to extract the long plot data for. Only water level is supported.

  • time (TimeLike) – The time to extract the long plot data for.

Returns:

The long plot data.

Return type:

pd.DataFrame

Examples

>>> from datetime import datetime
>>> bndry = FVBCTide('/path/to/fv_bc_tide.nc', '/path/to/fv_bc_tide.shp')
>>> bndry.section('Ocean', 'water level', datetime(2023, 1, 1, 12, 0, 0))
    branch_id node_string        offset  water level
0           0       Ocean      0.000000    -0.136288
1           0       Ocean   2665.236328    -0.136288
2           0       Ocean   5330.472656    -0.136658
3           0       Ocean   7995.708984    -0.137053
4           0       Ocean  10660.945312    -0.137360
5           0       Ocean  13326.181641    -0.137726
6           0       Ocean  15991.417969    -0.138077
7           0       Ocean  18656.654297    -0.138393
8           0       Ocean  21321.890625    -0.138562
9           0       Ocean  23987.126953    -0.138638
10          0       Ocean  26652.363281    -0.138558
11          0       Ocean  29317.599609    -0.138558