GOT
Reads files for Richard Ray’s Global Ocean Tide (GOT) models
Spatially interpolates tidal constituents to input coordinates
Calling Sequence
import pyTMD.io
amp,ph,c = pyTMD.io.GOT.extract_constants(ilon, ilat, model_files,
method='spline')
- pyTMD.io.GOT.extract_constants(ilon: ndarray, ilat: ndarray, model_files: str | pathlib.Path | list | None = None, **kwargs)[source]
Reads files for Richard Ray’s Global Ocean Tide (GOT) models
Makes initial calculations to run the tide program
Spatially interpolates tidal constituents to input coordinates
- Parameters
- ilon: np.ndarray
longitude to interpolate
- ilat: np.ndarray
latitude to interpolate
- model_files: str, list, pathlib.Path or NoneType, default None
list of model files for each constituent
- method: str, default ‘spline’
Interpolation method
'bilinear'
: quick bilinear interpolation'spline'
: scipy bivariate spline interpolation'linear'
,'nearest'
: scipy regular grid interpolations
- extrapolate: bool, default False
Extrapolate model using nearest-neighbors
- cutoff: float, default 10.0
Extrapolation cutoff in kilometers
Set to
np.inf
to extrapolate for all points- grid: str, default ‘ascii’
Tide model file type to read
'ascii'
: traditional GOT ascii format'netcdf'
: GOT netCDF4 format
- compressed: bool, default False
Input files are gzip compressed
- scale: float, default 1.0
Scaling factor for converting to output units
- Returns
- amplitude: np.ndarray
amplitudes of tidal constituents
- phase: np.ndarray
phases of tidal constituents
- constituents: np.ndarray
list of model constituents
- pyTMD.io.GOT.read_constants(model_files: str | pathlib.Path | list | None = None, **kwargs)[source]
Reads files for Richard Ray’s Global Ocean Tide (GOT) models
- Parameters
- model_files: str, list, pathlib.Path or NoneType, default None
list of model files for each constituent
- grid: str, default ‘ascii’
Tide model file type to read
'ascii'
: traditional GOT ascii format'netcdf'
: GOT netCDF4 format
- compressed: bool, default False
Input files are gzip compressed
- Returns
- constituents: obj
complex form of tide model constituents
- pyTMD.io.GOT.interpolate_constants(ilon: ndarray, ilat: ndarray, constituents, **kwargs)[source]
Interpolate constants from GOT tidal models to input coordinates
Makes initial calculations to run the tide program
- Parameters
- ilon: np.ndarray
longitude to interpolate
- ilat: np.ndarray
latitude to interpolate
- constituents: obj
Tide model constituents (complex form)
- method: str, default ‘spline’
Interpolation method
'bilinear'
: quick bilinear interpolation'spline'
: scipy bivariate spline interpolation'linear'
,'nearest'
: scipy regular grid interpolations
- extrapolate: bool, default False
Extrapolate model using nearest-neighbors
- cutoff: float, default 10.0
Extrapolation cutoff in kilometers
Set to
np.inf
to extrapolate for all points- scale: float, default 1.0
Scaling factor for converting to output units
- Returns
- amplitude: np.ndarray
amplitudes of tidal constituents
- phase: np.ndarray
phases of tidal constituents
- pyTMD.io.GOT.read_ascii_file(input_file: str | pathlib.Path, **kwargs)[source]
Read Richard Ray’s Global Ocean Tide (GOT) model file
- Parameters
- input_file: str or pathlib.Path
Model file
- compressed: bool, default False
Input file is gzip compressed
- Returns
- hc: np.ndarray
complex form of tidal constituent oscillation
- lon: np.ndarray
longitude of tidal model
- lat: np.ndarray
latitude of tidal model
- cons: str
tidal constituent ID
- pyTMD.io.GOT.read_netcdf_file(input_file: str | pathlib.Path, **kwargs)[source]
Read Richard Ray’s Global Ocean Tide (GOT) netCDF4 model file
- Parameters
- input_file: str or pathlib.Path
model file
- compressed: bool, default False
Input file is gzip compressed
- Returns
- hc: np.ndarray
complex form of tidal constituent oscillation
- lon: np.ndarray
longitude of tidal model
- lat: np.ndarray
latitude of tidal model
- cons: str
tidal constituent ID
- pyTMD.io.GOT.output_netcdf_file(FILE: str | pathlib.Path, hc: ndarray, lon: ndarray, lat: ndarray, constituent: str)[source]
Writes tidal constituents to netCDF4 files in GOT format
- Parameters
- FILE: str or pathlib.Path
output GOT model file name
- hc: np.ndarray
Eulerian form of tidal constituent
- lon: np.ndarray
longitude coordinates
- lat: np.ndarray
latitude coordinates
- constituent: str
tidal constituent ID