model

Retrieves tide model parameters for named tide models and from model definition files

Source code

General Attributes and Methods

class pyTMD.io.model(directory: str | pathlib.Path | None = None, **kwargs)[source]

Retrieves tide model parameters for named models or from a model definition file for use in the pyTMD tide prediction programs

Attributes
atl03: str

HDF5 dataset string for output ATL03 tide heights

atl06: str

HDF5 dataset string for output ATL06 tide heights

atl07: str

HDF5 dataset string for output ATL07 tide heights

atl10: str

HDF5 dataset string for output ATL10 tide heights

atl11: str

HDF5 dataset string for output ATL11 tide heights

atl12: str

HDF5 dataset string for output ATL12 tide heights

compressed: bool

Model files are gzip compressed

constituents: list

Model constituents for FES models

description: str

HDF5 description attribute string for output tide heights

directory: str, pathlib.Path or None, default None

Working data directory for tide models

flexure: bool

Flexure adjustment field for tide heights is available

format: str

Model format

  • OTIS

  • ATLAS

  • TMD3

  • netcdf

  • GOT

  • FES

gla12: str

HDF5 dataset string for output GLA12 tide heights

grid_file: pathlib.Path

Model grid file for OTIS, ATLAS and TMD3 models

gzip: bool

Suffix if model is compressed

long_name: str

HDF5 long_name attribute string for output tide heights

model_directory: pathlib.Path

Full path to model directory

model_file: pathlib.Path or list

Model constituent file or list of files

name: str

Model name

projection: str

Model projection for OTIS, ATLAS and TMD3 models

scale: float

Model scaling factor for converting to output units

suffix: str

Suffix if ATLAS model is 'netcdf' format

type: str

Model type

  • z

  • u

  • v

verify: bool

Verify that all model files exist

version: str

Tide model version

grid(m: str)[source]

Create a model object from known tide grid files

Parameters
m: str

model name

elevation(m: str)[source]

Create a model object from known tidal elevation models

Parameters
m: str

model name

current(m: str)[source]

Create a model object from known tidal current models

Parameters
m: str

model name

property gzip: str

Returns suffix for gzip compression

property suffix: str

Returns format suffix for netCDF4 ATLAS files

property atl03: str

Returns ICESat-2 ATL03 attribute string for a given variable

property atl06: str

Returns ICESat-2 ATL06 attribute string for a given variable

property atl07: str

Returns ICESat-2 ATL07 attribute string for a given variable

property atl10: str

Returns ICESat-2 ATL07 attribute string for a given variable

property atl11: str

Returns ICESat-2 ATL11 attribute string for a given variable

property atl12: str

Returns ICESat-2 ATL12 attribute string for a given variable

property gla12: str

Returns ICESat GLA12 attribute string for a given variable

property long_name: str

Returns long_name attribute string for a given variable

property description: str

Returns description attribute string for a given variable

static global_ocean() list[source]

Returns list of global ocean tide elevation models

static global_load() list[source]

Returns list of global load tide elevation models

static global_current() list[source]

Returns list of global tidal current models

static antarctic_ocean() list[source]

Returns list of Antarctic ocean tide elevation models

static antarctic_load() list[source]

Returns list of Antarctic load tide elevation models

static antarctic_current() list[source]

Returns list of Antarctic tidal current models

static arctic_ocean() list[source]

Returns list of Arctic ocean tide elevation models

static arctic_load() list[source]

Returns list of Arctic load tide elevation models

static arctic_current() list[source]

Returns list of Arctic tidal current models

static ocean_elevation() list[source]

Returns list of ocean tide elevation models

static load_elevation() list[source]

Returns list of load tide elevation models

static ocean_current() list[source]

Returns list of tidal current models

static OTIS() list[source]

Returns list of OTIS format models

static ATLAS_compact() list[source]

Returns list of ATLAS compact format models

static TMD3() list[source]

Returns list of TMD3 format models

static ATLAS() list[source]

Returns list of ATLAS format models

static GOT() list[source]

Returns list of GOT format models

static FES() list[source]

Returns list of FES format models

pathfinder(model_file: str | pathlib.Path | list)[source]

Completes file paths and appends file and gzip suffixes

Parameters
model_file: str, pathlib.Path or list

model file(s) to complete

from_file(definition_file: str | pathlib.Path | io.IOBase)[source]

Create a model object from an input definition file

Parameters
definition_file: str, pathlib.Path or io.IOBase

model definition file for creating model object

parse_constituents() list[source]

Parses tide model files for a list of model constituents

static parse_file(model_file: str | pathlib.Path, raise_error: bool = False)[source]

Parses a model file for a tidal constituent name

Parameters
model_file: str or pathlib.Path

Tide model file to parse

raise_error: bool, default False

Raise exception if constituent is not found in file name

Returns
constituent: str or list

constituent name

from_dict(d: dict)[source]

Create a model object from a python dictionary

Parameters
d: dict

Python dictionary for creating model object

to_bool(val: str) bool[source]

Converts strings of True/False to a boolean values

Parameters
val: str

string for converting to True/False