interpolate
- interpolate(fs, lats, lons)
- interpolate(fs, location)
- interpolate(fs, gpt)
Interpolate the values of
fsto a given location(s) using bilinear interpolation.- Parameters
- Return type
number or ndarray or
Geopointsor None
The interpolated point extraction depends on the arguments:
locationdefines a single location. The return value is a number whenfsonly contains one field, and a list otherwise. Where it is not possible to generate a sensible value due to lack of valid data infs, None is returned.latsandlonscan define either a single location (as number) or multiple locations (as ndarray). If a single location is specified the return value is the same as forlocation. For multiple locations an ndarray is returned (or a list of ndarrays if there are multiple fields).when
gptis specified only the first field offsis used. The result is aGeopointscontaining the the nearest gridpoint values for all the locations ingptand taking the date, time and level fromfs. Where it is not possible to generate a sensible value due to lack of valid data infs, NaN is used (this value can be removed from the output with the functionremove_missing_values()).
Note
See also
nearest_gridpoint().