constituents
Calculates constituent parameters and nodal arguments
Note
Originally based on Richard Ray’s ARGUMENTS fortran subroutine
- pyTMD.constituents.arguments(MJD: ndarray, constituents: list | ndarray, **kwargs)[source]
Calculates the nodal corrections for tidal constituents [18, 22, 58, 66]
- Parameters:
- MJD: np.ndarray
Modified Julian day of input date
- constituents: list
Tidal constituent IDs
- 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, FES or GOT models
- climate_solar_perigee: bool, default False
Compute climatologically affected terms without \(P_s\)
- M1: str, default ‘perth5’
Coefficients to use for M1 tides
'Doodson''Ray''Schureman''perth5'
- Returns:
- pu: np.ndarray
Nodal correction angle (radians)
- pf: np.ndarray
Nodal modulation factor
- G: np.ndarray
Phase correction (degrees)
- pyTMD.constituents.minor_arguments(MJD: ndarray, **kwargs)[source]
Calculates the nodal corrections for minor tidal constituents in order to infer their values [18, 20, 22, 66]
- Parameters:
- MJD: np.ndarray
Modified Julian day of input date
- 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, FES or GOT models
- Returns:
- pu: np.ndarray
Nodal correction angle (radians)
- pf: np.ndarray
Nodal modulation factor
- G: np.ndarray
Phase correction (degrees)
- pyTMD.constituents.coefficients_table(constituents: list | tuple | ndarray | str, **kwargs)[source]
Doodson table coefficients for tidal constituents [17, 18, 58]
- Parameters:
- constituents: list, tuple, np.ndarray or str
Tidal constituent IDs
- corrections: str, default ‘OTIS’
Use coefficients from OTIS, FES or GOT models
- climate_solar_perigee: bool, default False
Compute climatologically affected terms without \(P_s\)
- file: str or pathlib.Path, default `coefficients.json`
JSONfile of Doodson coefficients
- Returns:
- coef: np.ndarray
Doodson coefficients (Cartwright numbers) for each constituent
- pyTMD.constituents.doodson_number(constituents: str | list | ndarray, **kwargs)[source]
Calculates the Doodson or Cartwright number for tidal constituents [17]
- Parameters:
- constituents: str, list or np.ndarray
Tidal constituent ID(s)
- corrections: str, default ‘OTIS’
Use arguments from OTIS, FES or GOT models
- formalism: str, default ‘Doodson’
Constituent identifier formalism
'Cartwright''Doodson''Extended'
- raise_error: bool, default True
Raise
ValueErrorif constituent is unsupported
- Returns:
- numbers: float, np.ndarray or dict
Doodson or Cartwright number for each constituent
- pyTMD.constituents.nodal_modulation(n: ndarray, p: ndarray, constituents: list | tuple | ndarray | str, **kwargs)[source]
Calculates the nodal corrections for tidal constituents [18, 22, 59, 66]
Calculates factors for compound tides using recursion
- Parameters:
- n: np.ndarray
Mean longitude of ascending lunar node (degrees)
- p: np.ndarray
Mean longitude of lunar perigee (degrees)
- constituents: list, tuple, np.ndarray or str
Tidal constituent IDs
- corrections: str, default ‘OTIS’
Use nodal corrections from OTIS, FES or GOT models
- M1: str, default ‘perth5’
Coefficients to use for M1 tides
'Doodson''Ray''Schureman''perth5'
- Returns:
- u: np.ndarray
Nodal correction angle (radians)
- f: np.ndarray
Nodal modulation factor
- pyTMD.constituents.group_modulation(h: ndarray, n: ndarray, p: ndarray, ps: ndarray, constituents: list | tuple | ndarray | str, **kwargs)[source]
Calculates the generalized modulations for tidal groups [59, 62]
Uses the default nodal modulations for unsupported tidal groups
- Parameters:
- h: np.ndarray
Mean longitude of sun (degrees)
- n: np.ndarray
Mean longitude of ascending lunar node (degrees)
- p: np.ndarray
Mean longitude of lunar perigee (degrees)
- ps: np.ndarray
Mean longitude of solar perigee (degrees)
- constituents: list, tuple, np.ndarray or str
Tidal constituent IDs
- Returns:
- f: np.ndarray
Modulation factor
- u: np.ndarray
Angle correction (radians)
- pyTMD.constituents.frequency(constituents: list | ndarray, **kwargs)[source]
Wrapper function for calculating the angular frequency for tidal constituents [59]
- Parameters:
- constituents: list
Tidal constituent IDs
- corrections: str, default ‘OTIS’
Use nodal corrections from OTIS, FES or GOT models
- M1: str, default ‘perth5’
Coefficients to use for M1 tides
'Doodson''Ray''Schureman''perth5'
- Returns:
- omega: np.ndarray
Angular frequency (radians per second)
- pyTMD.constituents.aliasing_period(constituents: list | ndarray, sampling: float | ndarray, **kwargs)[source]
Calculates the tidal aliasing for a repeat period
- Parameters:
- constituents: list
Tidal constituent IDs
- sampling: float
Sampling repeat period (seconds)
- corrections: str, default ‘OTIS’
Use nodal corrections from OTIS, FES or GOT models
- M1: str, default ‘perth5’
Coefficients to use for M1 tides
'Doodson''Ray''Schureman''perth5'
- Returns:
- period: np.ndarray
Tidal aliasing period (seconds)
- pyTMD.constituents._constituent_parameters(c: str | list, **kwargs)[source]
Loads parameters for a given tidal constituent [20]
- Parameters:
- c: str or list
Tidal constituent ID(s)
- raise_error: bool, default False
Raise
ValueErrorif constituent is unsupported
- Returns:
- amplitude: float or np.ndarray
Amplitude of equilibrium tide for tidal constituent(s) (meters)
- phase: float or np.ndarray
Phase of tidal constituent(s) (radians)
- omega: float or np.ndarray
Angular frequency of constituent(s) (radians)
- alpha: float or np.ndarray
Load Love number of tidal constituent(s)
- species: int or np.ndarray
Spherical harmonic dependence of tidal constituent(s)
- pyTMD.constituents._parse_tide_potential_table(table: str | Path, skiprows: int = 1, columns: int = 1, include_degree: bool = True, include_planets: bool = False)[source]
Parse tables of tide-generating potential
- Parameters:
- table: str or pathlib.Path
Table of tide-generating potentials
- skiprows: int, default 1
Number of header rows to skip in the table
- columns: int, default 1
Number of amplitude columns in the table
- include_degree: bool, default True
Table includes spherical harmonic degree
- include_planets: bool, default False
Table includes coefficients for mean longitudes of planets
- Returns:
- CTE: np.ndarray
Cartwright-Tayler-Edden table values
- pyTMD.constituents._parse_rotation_rate_table()[source]
Parse table of tidal constituent rotation rates from Ray and Erofeeva [63]
- Returns:
- ZROT: np.ndarray
Rotation rate table values
- pyTMD.constituents._parse_name(constituent: str) str[source]
Parses for tidal constituents using regular expressions and remapping of known cases
- Parameters:
- constituent: str
Text containing the name of a tidal constituent
- pyTMD.constituents._to_constituent_id(coef: list | ndarray, **kwargs)[source]
Converts Cartwright numbers into a tidal constituent ID
- Parameters:
- coef: list or np.ndarray
Doodson coefficients (Cartwright numbers) for constituent
- corrections: str, default ‘GOT’
Use coefficients from OTIS, FES or GOT models
- climate_solar_perigee: bool, default False
Use climatologically affected terms without \(P_s\)
- arguments: int, default 7
Number of astronomical arguments to use
- file: str or pathlib.Path, default `coefficients.json`
JSONfile of Doodson coefficients- raise_error: bool, default True
Raise
ValueErrorif constituent is unsupported
- Returns:
- c: str
Tidal constituent ID
- pyTMD.constituents._to_doodson_number(coef: list | ndarray, **kwargs)[source]
Converts Cartwright numbers into a Doodson number
- Parameters:
- coef: list or np.ndarray
Doodson coefficients (Cartwright numbers) for constituent
- astype: type, default float
Output data type for default case
- raise_error: bool, default True
Raise
ValueErrorif constituent is unsupported
- Returns:
- DO: float or string
Doodson number for constituent
- pyTMD.constituents._to_extended_doodson(coef: list | ndarray, **kwargs)[source]
Converts Cartwright numbers into an UKHO Extended Doodson number
- Parameters:
- coef: list or np.ndarray
Doodson coefficients (Cartwright numbers) for constituent
- Returns:
- XDO: string
Extended Doodson number for constituent