pywasp.wasp.interpolate_gwc#
- pywasp.wasp.interpolate_gwc(gwc, /, output_locs, method='nearest', engine='windkit', fill_value=nan)[source]#
Spatially interpolate GWC data to a grid of locations.
- The interpolation is done in several steps:
Calculate the moments of the Weibull distribution from the A and k parameters.
Spatially interpolate the moments to the output locations.
Fit new A and k parameters from the interpolated moments.
The first and third moments as well as the frequency of wind speeds greater than the mean are used, corresponding to WASP methodology. For geostrophic wind climates, the geostrophic wind frequency and turning angle as well as additional roughness parameters are interpolated drectly.
Warning
This function is experimental and its signature may change. The default engine is “fortran”, but this will be deprecated in the future and the default will be “windkit”.
- Parameters:
gwc (
Dataset) – GWC or GeoWC datasetoutput_locs (
windkit.spatial.BBox) – Output locationsmethod (
str, optional) – Interpolation method. By default “nearest”. Options are: - “nearest” for nearest neighbor interpolation - “linear” for bilinear interpolation - “natural” for natural neighbor interpolationengine (
{'windkit','fortran'}) – Backend to use for interpolation. The fortran engine is deprecated and should not be used.fill_value (
{float, None}, optional) – The value given to points that cannot be interpolated from the points contained in gwc. If None, these points will be filled with nearest neighbor interpolation.
- Returns:
Dataset– Interpolated GWC dataset.- Raises:
ValueError – If the GWC contains any of “__m1__”, “__m3__”, “__fgtm__”. These are reserved for internal use.
UserWarning – If the GWC is in geographic coordinates and method is “nearest”, “linear”, or “natural”. Interpolation in geographic coordinates can be inaccurate.
UserWarning – If the interpolation results in NaN’s. These can be filled with nearest neighbor interpolation by setting
fill_value=None.FutureWarning – If engine is “fortran”. This engine is deprecated.