pytuflow.DATCrossSections

pytuflow.DATCrossSections#

class DATCrossSections(fpath, driver=None)#

Bases: TabularOutput

Class for reading Flood Modeller cross-sections from the .dat format.

Parameters:
  • fpath (PathLike) – The path to the .dat file.

  • driver (Any)

Raises:

ResultTypeError – Raises pytuflow.results.ResultTypeError if the file does not look like a Flood Modeller .dat file.

Examples

Load a cross-section layer:

>>> from pytuflow import DATCrossSections
>>> xs = DATCrossSections('path/to/model.dat')

Access the cross-section IDs:

>>> xs.ids()
['US_1', 'US_2', 'US_3', 'DS_1', 'DS_2', 'DS_3', 'DS_4']

Access the cross-section data for a given location:

>>> xs.section('US_1', ['xz', 'n'])
  US_1
     x     z manning n
0  0.0  99.0     0.001
1  0.0  98.0     0.001
2  5.0  98.0     0.001
3  5.0  99.0     0.001
__init__(fpath, driver=None)#
Parameters:
  • fpath (Path | str)

  • driver (Any)

Methods

curtain

Not supported for CrossSection results.

data_types

Returns the cross-section types.

ids

Returns the IDs from the cross-section layer.

profile

Not supported for CrossSection results.

section

Return the cross-section data for given location and cross-section data type.

time_series

Not supported for CrossSection results.

times

CrossSections results are static and will not return any times.

Attributes

ATTRIBUTE_TYPES

DOMAIN_TYPES

GEOMETRY_TYPES

ID_COLUMNS

cross_sections

List of loaded cross-sections.

fpath

The path to the source output file.

objs

DataFrame of cross-sections information.

cross_section_count

Number of cross-sections

name

The result name

has_reference_time

Does the result have an inherent reference time.

reference_time

The reference time for the output