pytuflow.TPC#
- class TPC(fpath)#
Bases:
INFO
,ITimeSeries2D
Class to handle the standard TUFLOW Time Series result file (
.tpc
).Supports:
1D, 2D, and Reporting Location (RL) results.
Supports varying time indexes between results e.g. 1D results can have a different output interval than 2D results. It also supports varying time indexes within a single domain e.g.
2d_po
results where one location has a different temporal resolution than another location. This is not something that TUFLOW Classic/HPC supports, however it is something that can occur in TUFLOW FV.Supports duplicate IDs across domains e.g. a 1D node called
test
, a PO point calledtest
, and an RL point calledtest
- these can all have the same ID with aWater Level
result attached.
The
TPC
class will only load basic properties on initialisation. These are typically properties that are easy to obtain from the file without having to load any of the time-series results. Once a method requiring more detailed information is called, the full results will be loaded. This makes theTPC
class very cheap to initialise.- Parameters:
fpath (PathLike) – The path to the output (.tpc) file.
- Raises:
ResultTypeError – Raises
pytuflow.results.ResultTypeError
if the file does not look like aTPC
file.
Examples
Loading a .tpc file:
>>> from pytuflow import TPC >>> res = TPC('path/to/file.tpc')
Querying all the available
2d_po
data types:>>> res.data_types('po') ['flow into region', 'volume', 'average water level', 'water level', 'velocity']
Querying all the available 1D channel IDs
>>> res.ids('channel') ['FC01.1_R', 'FC01.2_R', 'FC04.1_C']
Extracting the time-series information for a given channel and data type:
>>> res.time_series('FC01.1_R', 'flow') time channel/flow/FC01.1_R 0.000000 0.000 0.016667 0.000 0.033333 0.000 0.050000 0.000 0.066667 0.000 ... ... 2.933333 3.806 2.950000 3.600 2.966667 3.400 2.983334 3.214 3.000000 3.038
For more examples, see the documentation for the individual methods.
- __init__(fpath)#
- Parameters:
fpath (Path | str)
Methods
Not supported for
TPC
results.Returns all the available data types (result types) for the output given the filter.
Returns all the available IDs for the output.
Returns a dataframe containing the maximum values for the given data types.
Not supported for
TPC
results.Returns a long plot for the given location and data types at the given time.
Returns a time series dataframe for the given location(s) and data type(s).
Returns all the available times for the output.
Attributes
format of the results - options are 'CSV' or 'NC'.
The path to the source output file.
The unit system used in the output file.
Information on all 1D output objects.
Number of nodes
Number of channels
The result name
The reference time for the output
PO/2D output objects.
RL output objects.
Number of reporting location points
Number of reporting location lines
Number of reporting location polys