wavespectra.read_netcdf#

wavespectra.read_netcdf(filename_or_fileglob, chunks={}, freqname='freq', dirname='dir', sitename='site', specname='efth', lonname='lon', latname='lat', timename='time')[source]#

Read Spectra from generic netCDF format.

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

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

  • <coord>name :: coordinate name in netcdf, used for standarising dataset.

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.