imgshift_header

sofia_redux.instruments.forcast.imgshift_header.imgshift_header(header, chop=True, nod=True, dither=True, dripconf=True)[source]

Calculates the shift_image in the pixel frame for merging an image

Reads the chop/nod/dither amplitudes, angles, and transform from the sky to the detector frame depending on the coordinate system.

The chop/nod angle was defined in the opposite sense in flights earlier than 103. This distinction is recorded in the ANGLCONV keyword value in the header. If “positive”, as for 99 and earlier, use the angle as written in the header; otherwise, angles will need to be converted to negative values.

The chop, nod, and dither coordinate systems (CHPCRSYS, NODCRSYS, DTHCRSYS in the header) may take values of SIRF (science instrument reference frame), TARF (telescope assembly reference frame), or ERF (equatorial reference frame). If these keywords are not available in the header, we check the CHPCOORD, NODCOORD, and DTHRCS) keywords. The COORD/CS keyword values are integers where 0=SIRF, 1=TARF, and 2=ERF. If the coordinate system cannot be be determined, SIRF is used by default. TARF is seen as equivalent to SIRF for the purposes of this algorithm.

Parameters:
headerastropy.io.fits.header.Header

A FITS header

chopbool, optional

Indicates whether to perform the calculation of chop shift_image

nodbool, optional

Indicates whether to perform the calculation of nod shift_image

ditherbool, optional

Indicates whether to perform the calculation of dither shift_image

dripconfbool, optional

Indicates whether configuration values can overwrite header keyword values.

Returns:
dict

A dict containing the X and Y shifts necessary to merge or coadd an image based on the header keywords.