wavespectra.core.select.sel_nearest#

wavespectra.core.select.sel_nearest(dset, lons, lats, tolerance=2.0, unique=False, exact=False, dset_lons=None, dset_lats=None, missing='raise')[source]#

Select sites from nearest distance.

Args:

dset (Dataset): Stations SpecDataset to select from. lons (array): Longitude of sites to interpolate spectra at. lats (array): Latitude of sites to interpolate spectra at. tolerance (float): Maximum distance to use site for interpolation. unique (bool): Only returns unique sites in case of repeated inexact matches. exact (bool): Require exact matches. dset_lons (array): Longitude of stations in dset. dset_lats (array): Latitude of stations in dset. missing (str): Action to take if no site is found within tolerance:

  • ‘raise’: raise an error

  • ‘ignore’: skip site

Returns:

Selected SpecDataset at locations defined by (lons, lats).

Note:
Args dset_lons, dset_lats are not required but can improve performance when

dset is chunked with site=1 (expensive to access station coordinates) and improve precision if projected coordinates are provided at high latitudes.