8.2.1. spectral_wave_data.tools.airy.write_swd

The following function available in the sub-package spectral_wave_data.tools generates a SWD-file for a general set of Airy waves. All conventions follow the definitions described by shape 6.

8.2.1.1. Examples

First we establish access to the function:

from spectral_wave_data.tools import airy

In the first example we assume that wave numbers are explicitly defined and the water depth is infinite. In all examples we assume that both phases and propagation directions are given in the unit [deg]

amps = [...]   # Single wave amplitudes for each component
dirs = [...]   # Wave propagation directions for each component
phases = [...] # Phase angles for each component
kwaves = [...] # Wave numbers for each component
airy.write_swd('my_airy.swd', amps, dirs, phases, kwaves=kwaves,
               depth=-1.0, is_deg_dirs=True, is_deg_phases=True)

In case wave numbers are implicitly defined by wave periods:

Twaves = [...] # Wave periods for each component
airy.write_swd('my_airy.swd', amps, dirs, phases, Twaves=Twaves,
               depth=-1.0, is_deg_dirs=True, is_deg_phases=True)

In case wave numbers are implicitly defined by wave frequencies:

omegas = [...] # Wave frequencies for each component
airy.write_swd('my_airy.swd', amps, dirs, phases, omegas=omegas,
               depth=-1.0, is_deg_dirs=True, is_deg_phases=True)

In case wave numbers are implicitly defined by wave lengths:

Lwaves = [...] # Wave lengths for each component
airy.write_swd('my_airy.swd', amps, dirs, phases, Lwaves=Lwaves,
               depth=-1.0, is_deg_dirs=True, is_deg_phases=True)

In case Twaves or omegas is applied the linear wave dispersion relation is applied to establish the corresponding wave numbers to be stored in the SWD file. This function is available from the same Python module: