wavespectra.read_ncswan#

wavespectra.read_ncswan(filename_or_fileglob, file_format='netcdf', mapping={'density': 'efth', 'depth': 'dpt', 'direction': 'dir', 'frequency': 'freq', 'latitude': 'lat', 'longitude': 'lon', 'points': 'site', 'time': 'time'}, chunks={})[source]#

Read Spectra from SWAN native netCDF format.

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.

  • mapping (dict): coordinates mapping from original dataset to wavespectra.

  • 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 ww3 file.

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