wavespectra.read_wavespectra#

wavespectra.read_wavespectra(filename_or_fileglob, file_format='netcdf', chunks={})[source]#

Read Spectra from from netCDF or ZARR format in Wavespectra convention.

Args:
  • filename_or_fileglob (str, list, fileobj): filename, fileglob specifying multiple files, or a file object to read.

  • file_format (str): format of file to open, one of netcdf or zarr.

  • chunks (dict): chunk sizes for dimensions in dataset. By default dataset is loaded using single chunk for all dimensions (see xr.open_mfdataset documentation).

Returns:
  • dset (SpecDataset): spectra dataset object read from netcdf file

Note:
  • Assumes frequency in \(Hz\), direction in \(degree\) and spectral energy in \(m^{2}degree^{-1}{s}\).

  • If file is large to fit in memory, consider specifying chunks for ‘time’ and/or ‘station’ dims.