wavespectra.read_era5#
- wavespectra.read_era5(filename_or_fileglob, chunks={}, f0=0.03453, df=1.1, as_site=False)[source]#
Read Spectra from ECMWF ERA5 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).
f0 (float): First frequency value in Hz (e.g., 0.03453)
df (float): Multiplicative increment between frequencies.
as_site (bool): If True locations are defined by 1D site dimension.
- Returns:
dset (SpecDataset): spectra dataset object read from netcdf file.
- Note:
This reader also supports ECMWF spectra from the operational forecast.
Documentation describing how to construct the spectral grid can be found at https://www.ecmwf.int/en/forecasts/documentation-and-support/2d-wave-spectra.
If file is large to fit in memory, consider specifying chunks for ‘time’ and/or ‘latitude/longitude’ dims.