- pyfes.core.evaluate_tide(tidal_model: pyfes.core.AbstractTidalModelComplex64 | pyfes.core.AbstractTidalModelComplex128, date: VectorDateTime64, longitude: VectorFloat64, latitude: VectorFloat64, settings: pyfes.core.Settings | None = None) Tuple[VectorFloat64, VectorFloat64, VectorFloat8]#
Ocean tide calculation.
- Parameters:
tidal_model – Tidal model used to interpolate the modelized waves
date – Date of the tide calculation
longitude – Longitude in degrees for the position at which the tide is calculated
latitude – Latitude in degrees for the position at which the tide is calculated
settings – Settings for the tide computation.
num_threads – Number of threads to use for the computation. If 0, the number of threads is automatically determined.
- Returns:
- A tuple of three elements that contains:
The height of the the diurnal and semi-diurnal constituents of the tidal spectrum (cm)
The height of the long period wave constituents of the tidal spectrum (cm)
The quality flag indicating the reliability of the tide calculation at the given position:
0: the tide is undefined (no model data available at the given position).
Positive values: the tide is interpolated at the given position using
Ndata points (whereNis the number of data points used for the interpolation).Negative values: the tide is extrapolated at the given position using
-Ndata points (whereNis the number of data points used for the extrapolation).
Note
Computed height of the diurnal and semi-diurnal constituents is set to nan if no data is available at the given position. The long period wave constituents is always computed because this value does not depend on model data.
- pyfes.core.darwin.evaluate_equilibrium_long_period(dates: numpy.ndarray, latitudes: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], settings: pyfes.core.FesRuntimeSettings | None = None) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']#
Compute the long-period equilibrium ocean tides.
The complete tidal spectral lines from the Cartwright-Tayler-Edden tables are summed over to compute the long-period tide.
- Parameters:
dates – Dates of the tide calculation
latitudes – Latitude in degrees for the position at which the long-period tide is calculated
settings – Settings for the tide computation.
- Returns:
The computed long-period tide, in centimeters.
- pyfes.core.evaluate_tide_from_constituents(constituents: collections.abc.Mapping[str, tuple[SupportsFloat, SupportsFloat]], date: numpy.ndarray, latitude: SupportsFloat, settings: pyfes.core.Settings) tuple[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']]#
Ocean tide calculation from known constituents.
Unlike evaluate_tide() which interpolates constituents from a tidal model, this function computes the tidal prediction directly from a list of tidal constituents whose properties (amplitude and phase) are already known. This is typically used for tide gauge analysis and prediction, where the constituents have been previously determined from harmonic analysis of observed sea level data.
- Parameters:
constituents – A dictionary mapping constituent names (e.g., “M2”, “S2”) to tuples of (amplitude, phase) where phase is in degrees.
date – Date of the tide calculation (numpy.datetime64 array).
latitude – Latitude in degrees for the position at which the tide is calculated.
settings – Settings for the tide computation. Use FesRuntimeSettings for the FES/Darwin engine or PerthRuntimeSettings for the PERTH5 engine.
- Returns:
The height of the diurnal and semi-diurnal constituents of the tidal spectrum (same units as the input constituents).
The height of the long period wave constituents of the tidal spectrum (same units as the input constituents).
- Return type:
A tuple containing
Example
>>> import numpy as np >>> from pyfes import core >>> constituents = { ... "M2": (1.5, 120.0), # amplitude=1.5m, phase=120 degrees ... "S2": (0.5, 45.0), ... "K1": (0.3, 200.0), ... } >>> dates = np.array(['2024-01-01T00:00:00'], dtype='datetime64[ns]') >>> tide, lp = core.evaluate_tide_from_constituents( ... constituents, dates, latitude=45.0, ... settings=core.FesRuntimeSettings())