wecopttool.waves.elevation_fd

elevation_fd(f1, nfreq, directions, nrealizations, amplitudes=None, phases=None, attr=None, seed=None)[source]

Construct the complex wave elevation xarray.DataArray.

This is the complex wave elevation (m) indexed by radial frequency (rad/s) and wave direction (rad). The coordinate units and names match those from Capytaine.

Parameters:
  • f1 (float) – Fundamental frequency f1 [Hz].

  • nfreq (int) – Number of frequencies (not including zero frequency), i.e., freq = [0, f1, 2*f1, ..., nfreq*f1].

  • directions (float | ArrayLike) – Wave directions in degrees. 1D array.

  • nrealizations (int) – Number of wave phase realizations.

  • amplitudes (ArrayLike | None) – Wave elevation amplitude in meters.

  • phases (ArrayLike | None) – Wave phases in degrees.

  • attr (Mapping | None) – Additional attributes (metadata) to include in the xarray.DataArray.

  • seed (float | None) – Seed for random number generator. Used for reproducibility. Generally should not be used except for testing.

Return type:

DataArray