cartopy.img_transform.warp_array#

cartopy.img_transform.warp_array(array, target_proj, source_proj=None, target_res=(400, 200), source_extent=None, target_extent=None, mask_extrapolated=False)[source]#

Regrid the data array from the source projection to the target projection.

Also see, regrid().

Parameters:
  • array – The numpy.ndarray of data to be regridded to the target projection.

  • target_proj – The target Projection instance for the data.

  • source_proj (optional) – The source PlateCarree projection.

  • target_res (optional) – The (nx, ny) resolution of the target projection. Where nx defaults to 400 sample points, and ny defaults to 200 sample points.

  • source_extent (optional) – The (x-lower, x-upper, y-lower, y-upper) extent in native source projection coordinates.

  • target_extent (optional) – The (x-lower, x-upper, y-lower, y-upper) extent in native target projection coordinates.

  • mask_extrapolated (optional) – Assume that the source coordinate is rectilinear and so mask the resulting target grid values which lie outside the source grid domain.

Returns:

array, extent – A tuple of the regridded numpy.ndarray in the target projection and the (x-lower, x-upper, y-lower, y-upper) target projection extent.