shift

sofia_redux.instruments.forcast.shift.shift(data, offset, header=None, variance=None, order=None, crpix=None, resize=False, no_shift=False, missing=nan, **kwargs)[source]

Shift an image by the specified amount

Uses interpolation to do sub-pixel shifts if desired. Missing data should be represented with numpy.nans.

Parameters:
datanumpy.ndarray

The image array to shift (nrow, ncol)

offsetarray_like

The (x, y) offset by which to shift the image.

headerastropy.io.fits.header.Header

Header update with CRPIX

variancenumpy.ndarray, optional

Variance array (nrow, ncol) to update in parallel with the data output data array

orderint, optional
Interpolation order.

0 - nearest-neighbor 1 - bilinear >=2 - spline of the same order

crpixarray_like, optional

If provided, will be updated to match image shift_image [crpix1, crpix2]

resizebool, optional

Increase the size of the data array to accommodate offset

no_shiftbool, optional

If True, do not shift. Just return the original resized arrays prior to any shift.

missing

missing data fill value

Returns:
numpy.ndarray, numpy.ndarray

The shifted image (nrow, ncol) The shifted variance (nrow, ncol) or None if not supplied

Notes

Please see sofia_redux.toolkit.image.adjust.shift for full descriptions of available kwargs. The most useful parameters are listed below:

missing

value with which to replace missing values (NaNs)

modestr

edge handling mode. Default is ‘constant’