wavespectra.SpecDataset.to_funwave_new#

SpecDataset.to_funwave_new(filename, clip=True, phases=True)#

Write spectra in Funwave WK_NEW_DATA2D wavemaker format.

Args:
  • filename (str): Name for output Funwave file.

  • clip (bool): Clip directions outside [-90, 90] range in cartesian convention.

  • phases (bool): Write random phases for each wave component, if False the phase block is omitted and Funwave generates random phases itself.

Note:
  • Format description: https://fengyanshi.github.io/build/html/wavemaker_coherence.html.

  • Unlike the gridded WK_DATA2D format written by to_funwave, this format describes individual wave components, one per spectral bin.

  • Directions converted from wavespectra (0N, CW, from) to Cartesian (0E, CCW, to).

  • Funwave only deals with directions in the [-90, 90] range in cartesian convention (components outside it are discarded by the model), use clip=True to clip spectra outside that range.

  • Both 2D \(E(f,d)\) and 1d \(E(f)\) spectra are supported.

  • If the SpecArray has more than one spectrum, multiple files are created in a zip archive defined by replacing the extension of filename by “.zip”.