windkit.spatial.warp

windkit.spatial.warp(obj, to_crs, resolution=None, method='nearest', nodata=None, coerce_to_float=True)[source]

Warp cuboid WindKit object to another in a new CRS using data interpolation.

Parameters:
  • obj (xarray.DataArray or xarray.Dataset) – WindKit object to warp.

  • to_crs (int, dict, str or CRS) – Value to create CRS object or an existing CRS object

  • resolution (tuple (x resolution, y resolution) or float, optional) – Target resolution, in units of target coordinate reference system. Default: None calculates a resolution in the target crs similar to the resolution of the original crs.

  • method (str) – Interpolation method, passed to rasterio.warp.reproject. Defaults to “nearest”.

  • nodata (scalar) – Initial data to fill output arrays, passed to rasterio.warp.reproject. Defaults to numpy.nan.

Returns:

Warped WindKit object.

Return type:

xarray.DataArray or xarray.Dataset

See also

reproject