constants
Routines for estimating the harmonic constants for ocean tides
Calling Sequence
import pyTMD.solve
amp, phase = pyTMD.solve.constants(time, h, con)
- pyTMD.solve.constants(t: float | ndarray, ht: ndarray, constituents: str | list | ndarray, deltat: float | ndarray = 0.0, corrections: str = 'OTIS', solver: str = 'lstsq', order: int = 0, bounds: tuple = (-inf, inf), max_iter: int | None = None)[source]
Estimate the harmonic constants for an elevation time series [19, 21, 45]
- Parameters:
- t: float or np.ndarray
days relative to 1992-01-01T00:00:00
- ht: np.ndarray
elevation time series (meters)
- constituents: str, list or np.ndarray
tidal constituent ID(s)
- deltat: float or np.ndarray, default 0.0
time correction for converting to Ephemeris Time (days)
- corrections: str, default ‘OTIS’
use nodal corrections from OTIS/ATLAS or GOT/FES models
- solver: str, default ‘lstsq’
least squares solver to use
'lstsq'
: least squares solution'gelsy'
: complete orthogonal factorization'gelss'
: singular value decomposition (SVD)'gelsd'
: SVD with divide and conquer method'bvls'
: bounded-variable least-squares
- order: int, default 0
degree of the polynomial to add to fit
- bounds: tuple, default (None, None)
Lower and upper bounds on parameters for
'bvls'
- max_iter: int or None, default None
Maximum number of iterations for
'bvls'
- Returns:
- amp: np.ndarray
amplitude of each harmonic constant (meters)
- phase: np.ndarray
phase of each harmonic constant (degrees)