Output#

Wavespectra provides functions to write SpecDataset objects into different file types. They are defined in module within wavespectra.output. They are attached as methods in the SpecDataset accessor.

Note

The following conventions are expected for defining output functions:

  • Funcions for different file types are defined in different modules within wavespectra.output subpackage.

  • Modules are named as filetype.py, e.g., swan.py.

  • Functions are named as to_`filetype`, e.g., to_swan.

  • Function must accept self as the first input argument.

These output functions are currently available as methods of SpecDataset:

SpecDataset.to_funwave

Write spectra in Funwave format.

SpecDataset.to_json

Write spectra in json format.

SpecDataset.to_netcdf

Write spectra in netCDF format using wavespectra conventions.

SpecDataset.to_octopus

Save spectra in Octopus format.

SpecDataset.to_orcaflex

Writes the spectrum to an Orcaflex model

SpecDataset.to_swan

Write spectra in SWAN ASCII format.

SpecDataset.to_ww3

Save spectra in native WW3 netCDF format.