wavespectra.SpecDataset.to_swan#

SpecDataset.to_swan(filename, append=False, id='Created by wavespectra', ntime=None)#

Write spectra in SWAN ASCII format.

Args:
  • filename (str): str, name for output SWAN ASCII file.

  • append (bool): if True append to existing filename.

  • id (str): used for header in output file.

  • ntime (int, None): number of times to load into memory before dumping output file if full dataset does not fit into memory, choose None to load all times.

Note:
  • Only datasets with lat/lon coordinates are currently supported.

  • Extra dimensions other than time, site, lon, lat, freq, dim not yet supported.

  • Only 2D spectra E(f,d) are currently supported.

  • ntime=None optimises speed as the dataset is loaded into memory however the dataset may not fit into memory in which case a smaller number of times may be prescribed.