merge

sofia_redux.instruments.forcast.merge.merge(data, header, variance=None, normmap=None, skip_rotation=False, strip_border=True, rotation_order=1, resize=True)[source]

Merge positive and negative instances of the source in the images

After chop/nod subtraction, there are typically positive and negative instances of the sources in the same frame, although the number of images depends on the chop/nod mode. This function shifts, coadds, and normalizes these sources to provide a single image of the source with increased signal-to-noise. The method for determining the shift is read from the configuration file. In the configuration file, if CORMERGE is set to CENTROID, then a centroiding algorithm is used to determine the shift. If CORMERGE is XCOR, a cross-correlation algorithm is used. If CORMERGE is HEADER, then header data is used to determine the shift. If CORMERGE is NOSHIFT (or the calculated shift is greater than the MAXSHIFT parameter), then no shifting and coadding is attempted. IF the centroiding algorithm is selected and it fails for any reason, then a header shift algorithm is used instead. After the image is merged, it is rotated by the SKY_ANGL in the header and the WCS keywords are updated.

Parameters:
datanumpy.ndarray

Input data array (nrow, ncol)

headerastropy.io.fits.header.Header

Input FITS header; will be updated with a HISTORY message

variancenumpy.ndarray, optional

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

normmapnumpy.ndarray, optional

Array (nrow, ncol) of normalization values for each pixel. The normalization value corresponds to the number of exposures in each pixel.

skip_rotationbool, optional

If True, will skip rotation correction.

strip_borderbool, optional

If True, will strip off any unnecessary NaN padding at the edges of the image, after rotation.

rotation_orderint, optional

Order for spline interpolation when rotating

resizebool, optional

If True, image will be resized as necessary during merge.

Returns:
numpy.ndarray, np.ndarray

Merged array (nrow, ncol) Propagated variance array (nrow, ncol)