coadd_centroid¶
- sofia_redux.instruments.forcast.register.coadd_centroid(data, reference, header=None, variance=None, crpix=None, border=0, rot_angle=None, missing=nan, shift_order=None, rotation_order=1, get_offsets=False)[source]¶
Shift an image for coadding using a centroid algorithm
- Steps are:
Rotate data and variance wrt reference (if rot_angle is provided)
Run peakfind on data wrt reference on 1 peak
Return rotated data (if it was rotated) should peakfind fail.
Shift image by offsets calculated wrt reference using peakfind.
Record the shifts in the header with the COADX0, COADY0 keywords.
- Parameters:
- datanumpy.ndarray
input image array (nrow, ncol)
- referencenumpy.ndarray
input reference array to compare data to (nrow, ncol)
- headerastropy.fits.header.Header
FITS header of input data
- borderint
exclude
border
pixels from the outside edges when attempting to find peaks in the image and reference- shift_orderint, optional
Order of interpolation for the shift. The shift order must be between 0 and 5, with a default of 3
- rotation_order: int, optional
Order of interpolaton for the rotation. The rotation order must be between 0 and 5, with a default of 3
- variancenumpy.ndarray
propagate provided variance if set (nrow, ncol)
- rot_anglefloat
Indicates that the data image is rotated wrt the reference image by this amount. The data image (and variance if supplied) will be rotated clockwise by
rot_angle
degrees- crpixlist, optional
If provided, will be updated to the new [CRPIX1, CRPIX2] values following the shift
- get_offsetsbool, optional
Do not shift the image. Only return the (x, y) offset
- missingfloat, optional
Value to represent missing data during shift
- Returns:
- 2-tuple
numpy.ndarray : The shifted image (nrow, ncol) numpy.ndarray : The shifted variance (nrow, ncol)