wavespectra.SpecDataset.to_octopus#

SpecDataset.to_octopus(filename, site_id='spec', fcut=0.125, missing_val=-99999, ntime=None, lons=None, lats=None, compresslevel=6)#

Save spectra in Octopus format.

Args:
  • filename (str): name for output OCTOPUS file.

  • site_id (str): used to construct LPoint header.

  • fcut (float): frequency for splitting spectra.

  • missing_value (int): missing value 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.

  • lons: (np.array, None): longitudes to use for each site if not in dataset.

  • lats: (np.array, None): latitudes to use for each site if not in dataset.

  • compresslevel (int): compression level for gzip compression (1-9).

Note:
  • Output files are gzipped if filename ends with .gz.

  • lons/lats parameters may be prescribed to set site locations if lon/lat are not variables in the dataset (their sizes must match the number of sites).

  • If lons/lats are not specified and the dataset does not have lon/lat coords, all coordinates default to zero.

  • multiple locations dumped at same file with one location header per site.

  • 1D spectra not 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.