zoom_xarray

metpy.calc.zoom_xarray(input_field, zoom, output=None, order=3, mode='constant', cval=0.0, prefilter=True)

Apply a spline interpolation to the data to effectively reduce the grid spacing.

This function applies scipy.ndimage.zoom to increase the number of grid points and effectively reduce the grid spacing over the data provided.

Parameters
  • input_field (xarray.DataArray) – The 2D data array to be interpolated.

  • zoom (float or sequence) – The zoom factor along the axes. If a float, zoom is the same for each axis. If a sequence, zoom should contain one value for each axis.

  • order (int, optional) – The order of the spline interpolation, default is 3. The order has to be in the range 0-5.

  • mode ({‘reflect’, ‘grid-mirror’, ‘constant’, ‘grid-constant’, ‘nearest’, ‘mirror’,) – ‘grid-wrap’, ‘wrap’}, optional See scipy.ndimage.zoom documentation for details.

  • cval (scalar, optional) – See scipy.ndimage.zoom documentation for details.

  • prefilter (bool (default = True)) – See scipy.ndimage.zoom documentation for details.

Returns

zoomed_data (xarray.DataArray) – The zoomed input with its associated coordinates and coordinate reference system, if available.