Cartesian models#

class pyfes.core.Axis#

Bases: pybind11_object

A coordinate axis a variable that specifies one of the coordinates of a variable’s values.

__init__(self: pyfes.core.Axis, points: numpy.ndarray[numpy.float64[m, 1]], epsilon: float = 1e-06, is_circular: bool = False) None#

Default constructor.

Parameters:
  • points – The axis points.

  • epsilon – The tolerance used to determine if the axis is circular.

  • is_circular – True if the axis is circular. For example, longitude is circular.

end(self: pyfes.core.Axis) float#

Return the last value of the axis.

find_index(self: pyfes.core.Axis, value: float, bounded: bool = True) int#

Find the index of the axis point closest to the given value.

Parameters:
  • value – The value to find the index for.

  • bounded – If true, the index will be bounded by the axis domain.

Returns:

The index of the axis point closest to the given value.

find_indices(self: pyfes.core.Axis, values: float) tuple[int, int] | None#

Find the indices of the axis points closest to the given values.

Parameters:

values – The values to find the indices for.

Returns:

The indices of the axis points closest to the given values.

property is_ascending#

Return true if the axis is ascending.

property is_circular#

Return true if the axis is circular.

max_value(self: pyfes.core.Axis) float#

Return the maximum value of the axis.

min_value(self: pyfes.core.Axis) float#

Return the minimum value of the axis.

property start#

Return the first value of the axis.

property step#

Return the step of the axis.

class pyfes.core.tidal_model.CartesianComplex64#

Bases: AbstractTidalModelComplex64

A tidal model that uses a Cartesian grid to store the wave models.

__init__(self: pyfes.core.tidal_model.CartesianComplex64, lon: pyfes.core.Axis, lat: pyfes.core.Axis, tide_type: pyfes.core.TideType = <TideType.kTide: 1>, longitude_major: bool = True) None#

Construct a Cartesian tidal model.

Parameters:
  • lon – The longitude axis.

  • lat – The latitude axis.

  • tide_type – The type of tide.

  • longitude_major – If true, the longitude axis is the major axis.

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.

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.

lat(self: pyfes.core.tidal_model.CartesianComplex64) pyfes.core.Axis#

Get the latitude axis.

Returns:

The latitude axis.

lon(self: pyfes.core.tidal_model.CartesianComplex64) pyfes.core.Axis#

Get the longitude axis.

Returns:

The longitude axis.

property tide_type#

Return the type of tide.

class pyfes.core.tidal_model.CartesianComplex128#

Bases: AbstractTidalModelComplex128

A tidal model that uses a Cartesian grid to store the wave models.

__init__(self: pyfes.core.tidal_model.CartesianComplex128, lon: pyfes.core.Axis, lat: pyfes.core.Axis, tide_type: pyfes.core.TideType = <TideType.kTide: 1>, longitude_major: bool = True) None#

Construct a Cartesian tidal model.

Parameters:
  • lon – The longitude axis.

  • lat – The latitude axis.

  • tide_type – The type of tide.

  • longitude_major – If true, the longitude axis is the major axis.

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.

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.

lat(self: pyfes.core.tidal_model.CartesianComplex128) pyfes.core.Axis#

Get the latitude axis.

Returns:

The latitude axis.

lon(self: pyfes.core.tidal_model.CartesianComplex128) pyfes.core.Axis#

Get the longitude axis.

Returns:

The longitude axis.

property tide_type#

Return the type of tide.