webbpsf_ext.image_manip.fshift

webbpsf_ext.image_manip.fshift(inarr, delx=0, dely=0, pad=False, cval=0.0, interp='linear', **kwargs)[source]

Fractional image shift

Ported from IDL function fshift.pro. Routine to shift an image by non-integer values.

Parameters
  • inarr (ndarray) – 1D, or 2D array to be shifted. Can also be an image cube assume with shape [nz,ny,nx].

  • delx (float) – shift in x (same direction as IDL SHIFT function)

  • dely (float) – shift in y

  • pad (bool) – Should we pad the array before shifting, then truncate? Otherwise, the image is wrapped.

  • cval (sequence or float, optional) – The values to set the padded values for each axis. Default is 0. ((before_1, after_1), … (before_N, after_N)) unique pad constants for each axis. ((before, after),) yields same before and after constants for each axis. (constant,) or int is a shortcut for before = after = constant for all axes.

  • interp (str) – Type of interpolation to use during the sub-pixel shift. Valid values are ‘linear’, ‘cubic’, and ‘quintic’.

Returns

ndarray – Shifted image