shift¶
- sofia_redux.toolkit.image.adjust.shift(data, offset, order=1, missing=nan, nan_interpolation=0.0, missing_limit=0.001, mode='constant')[source]¶
Shift an image by the specified amount.
Uses interpolation to do sub-pixel shifts if desired. NaNs are safely handled.
- Parameters:
- datanumpy.ndarray
The image array to shift_image (nrow, ncol)
- offsetarray_like
The shift along each axis. If a float, shift is the same for all axis. If an array, shift should contain one value for each axis.
- orderint, optional
Interpolation order. 0 shifts by integer pixels; 1 shifts using bilinear interpolation; 2-5 shift_image using cubic-spline interpolation of the same order.
- missingfloat or int, optional
Value to fill past edges of input if
edge
is ‘constant’.- nan_interpolationfloat, optional
NaN values must be replaced by a real value before shifting. Setting this value to None will result in NaN values being replaced by an interpolated value using the Clough-Tocher scheme.
- missing_limitfloat, optional
The fraction of NaNs that were excluded from the interpolation. If the interpolation exceeds this limit, the value will be replaced by
missing
.- modestr, optional
Points outside the boundaries of the input are filled according to the given mode (‘constant’, ‘nearest’, ‘reflect’, or ‘wrap’).
- Returns:
- numpy.ndarray
shifted image image array (nrow, ncol)