wavespectra.SpecDataset.sel#
- SpecDataset.sel(lons, lats, method='idw', tolerance=2.0, **kwargs)[source]#
Select stations near or at locations defined by (lons, lats) vector.
- Parameters:
lons (-) – Longitude values of locations to select.
lats (-) – Latitude values of locations to select.
method (-) – Method to use for inexact matches: * idw: Inverse distance weighting selection. * nearest: Nearest site selection. * bbox: Sites inside bbox [min(lons), min(lats)], [max(lons), max(lats)]. * None: Only exact matches.
tolerance (-) – Maximum distance between locations and original stations for inexact matches.
kwargs (-) – Extra keywargs to pass to the respective sel function (i.e., sel_nearest, sel_idw).
- Returns:
Stations Dataset selected at locations defined by zip(lons, lats).
- Return type:
dset (SpecDataset)
Note
tolerance behaves differently with methods ‘idw’ and ‘nearest’. In ‘idw’ sites with no neighbours within tolerance are masked whereas in ‘nearest’ an exception is raised.