LGP2 models#

class pyfes.core.tidal_model.LGP2Complex64#

Bases: AbstractTidalModelComplex64

Handle the wave models loaded from finite elements using LGP2 discretization.

__init__(self: pyfes.core.tidal_model.LGP2Complex64, index: pyfes.core.mesh.Index, codes: numpy.ndarray[numpy.int32[m, 6]], tide_type: pyfes.core.TideType = <TideType.kTide: 1>, max_distance: float = 0) None#

Construct a LGP2 tidal model.

Parameters:
  • index – The index of the finite elements.

  • codes – The LGP2 codes.

  • tide_type – The type of tide handled by the model.

  • max_distance – The maximum distance allowed to extrapolate the wave models. By default, extrapolation is disabled, all points outside the finite elements will be considered undefined.

accelerator(self: pyfes.core.AbstractTidalModelComplex64, formulae: pyfes.core.Formulae = <Formulae.kSchuremanOrder1: 0>, time_tolerance: float = 0.0) pyfes.core.Accelerator#

Get the accelerator used to speed up the interpolation of the tidal model.

Returns:

The accelerator.

add_constituent(self: pyfes.core.AbstractTidalModelComplex64, name: str, wave: numpy.ndarray[numpy.complex64[m, 1]]) None#

Add a tidal constituent to the model.

Parameters:
  • name – The name of tidal constituent to add. Search is not case sensitive. So Msqm, MSQM and msqm are equivalent.

  • wave – The wave model.

clear(self: pyfes.core.AbstractTidalModelComplex64) None#

Clear the loaded wave models from memory.

property dynamic#

Dynamic tidal constituents that are not interpolated by the model. The constituents declared here will be considered as part of the model components and will not be calculated by admittance and excluded from the long-period equilibrium wave calculation routine (lpe_minus_n_waves).

identifiers(self: pyfes.core.AbstractTidalModelComplex64) list[pyfes.core.Constituent]#

Return the identifiers of the loaded wave models.

index(self: pyfes.core.tidal_model.LGP2Complex64) pyfes.core.mesh.Index#

Get the index of the finite elements.

Returns:

The index of the finite elements.

interpolate(*args, **kwargs)#

Overloaded function.

  1. interpolate(self: pyfes.core.AbstractTidalModelComplex64, lon: numpy.ndarray[numpy.float64[m, 1]], lat: numpy.ndarray[numpy.float64[m, 1]], num_threads: int = 0) -> tuple[dict[pyfes.core.Constituent, numpy.ndarray[numpy.complex128[m, 1]]], numpy.ndarray[numpy.int8[m, 1]]]

Interpolate the wave models loaded at the given coordinates.

Parameters:
  • lon – The longitude of the point to interpolate at.

  • lat – The latitude of the point to interpolate at.

  • num_threads – The number of threads to use. If 0, the number of threads is determined by the number of cores.

Returns:

A tuple containing the interpolated wave models stored in a dictionary and a flag indicating if the point was extrapolated, interpolated or if the model is undefined.

  1. interpolate(self: pyfes.core.AbstractTidalModelComplex64, lon: float, lat: float, wave_table: pyfes.core.WaveTable) -> pyfes.core.Quality

Interpolate the wave models loaded at the given position.

Parameters:
  • lon – The longitude of the point to interpolate at.

  • lat – The latitude of the point to interpolate at.

  • wave_table – The wave table to store the interpolated wave models.

Returns:

A flag indicating if the point was extrapolated, interpolated or if the model is undefined.

property tide_type#

Return the type of tide.

class pyfes.core.tidal_model.LGP2Complex128#

Bases: AbstractTidalModelComplex128

Handle the wave models loaded from finite elements using LGP2 discretization.

__init__(self: pyfes.core.tidal_model.LGP2Complex128, index: pyfes.core.mesh.Index, codes: numpy.ndarray[numpy.int32[m, 6]], tide_type: pyfes.core.TideType = <TideType.kTide: 1>, max_distance: float = 0) None#

Construct a LGP2 tidal model.

Parameters:
  • index – The index of the finite elements.

  • codes – The LGP2 codes.

  • tide_type – The type of tide handled by the model.

  • max_distance – The maximum distance allowed to extrapolate the wave models. By default, extrapolation is disabled, all points outside the finite elements will be considered undefined.

accelerator(self: pyfes.core.AbstractTidalModelComplex128, formulae: pyfes.core.Formulae = <Formulae.kSchuremanOrder1: 0>, time_tolerance: float = 0.0) pyfes.core.Accelerator#

Get the accelerator used to speed up the interpolation of the tidal model.

Returns:

The accelerator.

add_constituent(self: pyfes.core.AbstractTidalModelComplex128, name: str, wave: numpy.ndarray[numpy.complex128[m, 1]]) None#

Add a tidal constituent to the model.

Parameters:
  • name – The name of tidal constituent to add. Search is not case sensitive. So Msqm, MSQM and msqm are equivalent.

  • wave – The wave model.

clear(self: pyfes.core.AbstractTidalModelComplex128) None#

Clear the loaded wave models from memory.

property dynamic#

Dynamic tidal constituents that are not interpolated by the model. The constituents declared here will be considered as part of the model components and will not be calculated by admittance and excluded from the long-period equilibrium wave calculation routine (lpe_minus_n_waves).

identifiers(self: pyfes.core.AbstractTidalModelComplex128) list[pyfes.core.Constituent]#

Return the identifiers of the loaded wave models.

index(self: pyfes.core.tidal_model.LGP2Complex128) pyfes.core.mesh.Index#

Get the index of the finite elements.

Returns:

The index of the finite elements.

interpolate(*args, **kwargs)#

Overloaded function.

  1. interpolate(self: pyfes.core.AbstractTidalModelComplex128, lon: numpy.ndarray[numpy.float64[m, 1]], lat: numpy.ndarray[numpy.float64[m, 1]], num_threads: int = 0) -> tuple[dict[pyfes.core.Constituent, numpy.ndarray[numpy.complex128[m, 1]]], numpy.ndarray[numpy.int8[m, 1]]]

Interpolate the wave models loaded at the given coordinates.

Parameters:
  • lon – The longitude of the point to interpolate at.

  • lat – The latitude of the point to interpolate at.

  • num_threads – The number of threads to use. If 0, the number of threads is determined by the number of cores.

Returns:

A tuple containing the interpolated wave models stored in a dictionary and a flag indicating if the point was extrapolated, interpolated or if the model is undefined.

  1. interpolate(self: pyfes.core.AbstractTidalModelComplex128, lon: float, lat: float, wave_table: pyfes.core.WaveTable) -> pyfes.core.Quality

Interpolate the wave models loaded at the given position.

Parameters:
  • lon – The longitude of the point to interpolate at.

  • lat – The latitude of the point to interpolate at.

  • wave_table – The wave table to store the interpolated wave models.

Returns:

A flag indicating if the point was extrapolated, interpolated or if the model is undefined.

property tide_type#

Return the type of tide.