align_wcs

ndmapper.lib.gmos.spec.ifu.align_wcs(*args, **kwargs)[source] [edit on github]

Measure spatial offsets between IFU data cubes, by comparing their image features (summed over wavelength), and update their WCS zero points accordingly, to match the first cube in inputs. This provides the alignment information needed for subsequent co-addition with mosaic.

Users should compare the registration of output WCSs carefully (for which the mosaic.separate option may be useful) and adjust the CRVAL keywords manually in case of errors.

This function depends on the pyfu PyRAF/Python package, which must be installed separately.

Parameters:

inputs : DataFileList or DataFile

Reduced data cubes (normally from resample_to_cube or Gemini IRAF’s gfcube), with any cosmic ray flux removed. For meaningful results, their fields of view must overlap sufficiently to identify one or more spatial peaks in common.

method : {‘correlate’, ‘centroid’}

Spatial registration algorithm to use (after collapsing each cube in wavelength to form an image). The default of ‘correlate’ should always be used where image structure is nebulous or multi-peaked. The simple ‘centroid’ algorithm can be used for sources that have a single well-defined peak (but is unreliable in the presence of cosmic rays). In limited testing to date, ‘correlate’ has been found to work comparably well to the original ‘centroid’ for single-peaked sources, so has been made the default in this wrapper.

Processing is currently performed using the PyFU function “pyfalign”.

Returns:

DataFileList

The input images with their WCS zero-points adjusted. Pyfalign modifies its inputs, rather than creating a new copy (since no information is lost in the process, with the first file retaining the original WCS). The files are consequently always re-processed. It is possible that this will change in future.