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.

Parameters:
  • filename_or_fileglob (-) – filename, fileglob specifying multiple files, or a file object to read.

  • file_format (-) – format of file to open, one of netcdf or zarr.

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

Returns:

spectra dataset object read from netcdf file

Return type:

  • dset (SpecDataset)

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.