wavespectra.SpecDataset#

class wavespectra.SpecDataset(xarray_dset)[source]#

Extends xarray’s Dataset to deal with wave spectra datasets.

Plugin functions defined in wavespectra/output/<module> are attached as methods in this accessor class.

Note

  • When the dataset_transforms option is set with wavespectra.set_options(dataset_transforms=True), methods that transform the spectral variable such as interp, smooth, split or oned return a Dataset in this accessor with the non-spectral variables from the underlying dataset preserved, rather than the bare spectral DataArray returned by the SpecArray accessor. This will become the default behaviour in wavespectra 5.0.

__init__(xarray_dset)[source]#

Methods

__init__(xarray_dset)

sel(lons, lats[, method, tolerance])

Select stations near or at locations defined by (lons, lats) vector.

to_funwave(filename[, clip])

Write spectra in Funwave format.

to_funwave_new(filename[, clip, phases])

Write spectra in Funwave WK_NEW_DATA2D wavemaker format.

to_json(filename[, mode, date_format])

Write spectra in json format.

to_netcdf(filename[, specname, ncformat, ...])

Write spectra in netCDF format using wavespectra conventions.

to_octopus(filename[, site_id, fcut, ...])

Save spectra in Octopus format.

to_orcaflex(model[, minEnergy])

Writes the spectrum to an Orcaflex model

to_swan(filename[, append, id, ntime, lons, ...])

Write spectra in SWAN ASCII format.

to_ww3(filename[, ncformat, compress])

Save spectra in native WW3 netCDF format.

Attributes

partition

Partition interface defined from the full dataset.