webbpsf_ext.image_manip.fourier_imshift

webbpsf_ext.image_manip.fourier_imshift(image, xshift, yshift, pad=False, cval=0.0, **kwargs)[source]

Fourier shift image

Shift an image by use of Fourier shift theorem

Parameters
  • image (ndarray) – 2D image or 3D image cube [nz,ny,nx].

  • xshift (float) – Number of pixels to shift image in the x direction

  • yshift (float) – Number of pixels to shift image in the y direction

  • 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.

Returns

ndarray – Shifted image