pytuflow.FVBCTide#
- class FVBCTide(nc_fpath, node_string_gis_fpath, use_local_time=True)#
Bases:
TimeSeries
Class for FV BC Tide input time-series data. Point objects are generated along each nodestring based on the given chainage in the NetCDF file. Each point will be given the same name as the nodestring with _pt_N appended to the end (where N is the point number based on the order in the NetCDF file).
e.g. A nodestring called
Ocean
with 5 chainages along the line with water level data will have the following point names:Ocean_pt_0
,Ocean_pt_1
,Ocean_pt_2
,Ocean_pt_3
,Ocean_pt_4
.By default, locat time is used if it is available in the NetCDF file. This can be changed to use UTC time instead by setting
use_local_time=True
within the constructor.- Parameters:
nc_fpath (PathLike) – Path to the FV tide netCDF file.
node_string_gis_fpath (PathLike) – Path to the GIS node string file.
use_local_time (bool, optional) – Uses local time, by default True.
- Raises:
ResultTypeError – Raises
pytuflow.results.ResultTypeError
if the file does not look like aFVBCTide
file.
Examples
Load TUFLOW FV tide boundary data - this requires the NetCDF data that contains the tabular data and the GIS file that contains the spatial location.
>>> from pytuflow import FVBCTide >>> bndry = FVBCTide('path/to/fv_bc_tide.nc', 'path/to/fv_bc_tide.shp')
Plot a time-series of water level from a location along the boundary:
>>> bndry.time_series('Ocean_pt1', 'water level') time point/water level/Ocean_pt_1 289258.00 -0.228474 289258.25 -0.196456 289258.50 -0.160042 289258.75 -0.119967 289259.00 -0.076996 ... ... 290025.00 0.073840 290025.25 0.018794 290025.50 -0.034604 290025.75 -0.085668 290026.00 -0.133717
Plot the long section along the nodestring at a specific datetime (relative time in hours can also be used):
>>> from datetime import datetime >>> 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
- __init__(nc_fpath, node_string_gis_fpath, use_local_time=True)#
- Parameters:
nc_fpath (Path | str)
node_string_gis_fpath (Path | str)
use_local_time (bool)
- Return type:
None
Methods
Not supported for
FVBCTide
results.Returns all the available data types (result types) for the given filter.
Returns all the available IDs for the given filter.
Returns a DataFrame containing the maximum values for the given data types.
Not supported for
FVBCTide
results.Returns a DataFrame containing the long plot data for the given location(s) and data type(s).
Returns a time-series DataFrame for the given location(s) and data type(s).
Returns all the available times for the given filter.
Attributes
Path to the FV tide netCDF file.
Path to the GIS node string file.
Uses local time.
FV BC Tide provider object.
Result objects
Number of nodes
Number of node strings
The result name
The reference time for the output