interpolate
- interpolate(fs, lats, lons)
- interpolate(fs, location)
- interpolate(fs, gpt)
Interpolate the values of
fs
to a given location(s) using bilinear interpolation.- Parameters
- Return type
number or ndarray or
Geopoints
or None
The interpolated point extraction depends on the arguments:
location
defines a single location. The return value is a number whenfs
only 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.lats
andlons
can 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
gpt
is specified only the first field offs
is used. The result is aGeopoints
containing the the nearest gridpoint values for all the locations ingpt
and 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()
.