pygetm.legacy module
- class pygetm.legacy.DatFile(path: str | PathLike[str])[source]
Bases:
objectSupport for reading GETM dat files with comments indicated by ! or #. Whitespace-only lines are skipped.
- pygetm.legacy.domain_from_topo(path: str | PathLike[str], **kwargs) Domain[source]
Create a domain object from a topo.nc file used by legacy GETM.
- Parameters:
path – NetCDF file with legacy domain topography
**kwargs – keyword arguments that are ultimately passed to
pygetm.domain.Domain
Bottom roughness can be prescribed with keyword argument
z0, which will be passed topygetm.domain.Domain. This argument must be provided if the topo file does not contain bottom roughnessz0. Ifz0is present in the argument list as well as the topo file, the argument takes priority.
- pygetm.legacy.load_bdyinfo(domain: Domain, path: str | PathLike[str], type_2d: int | None = None, type_3d: int | None = None)[source]
Add open boundaries from bdyinfo.dat to domain.
- Parameters:
domain – domain to add open boundaries to
path – data file with open boundary information
type_2d – type of 2D open boundary condition to use. If provided, this overrides the type configured in the file.
type_3d – type of 3D open boundary condition to use. If provided, this overrides the type configured in the file.
- pygetm.legacy.load_riverinfo(domain: Domain, path: str | PathLike[str])[source]
Add rivers from riverinfo.dat to domain
Rivers that appear multiple times in the file are meant to be split over multiple cells. For each entry of such rivers, an index is appended to the river name to generate a unique name for the cell-specific “river mouth”. The original river name and the number of cells it is split over are stored as attributes
original_nameandsplit. These attributes can be used when accessing river forcing for all mouths combined, for instance, the combined flow rate stored underoriginal_namecan be divided bysplitto get the flow rate for each mouth.- Parameters:
domain – domain to add rivers to
path – data file with river information