[daip] simple FITS WCS question - creation of CD matrix

Eric Greisen egreisen at nrao.edu
Mon Mar 4 15:15:28 EST 2019


On 03/04/2019 11:25 AM, Joseph Postma wrote:
> Dear Eric,
> 
> I would like some additional information as to how the CD matrix is 
> supposed to be 1) created and 2) used for the different coordinate 
> transformation (CTYPE) types.
> 
> For a linear transformation, one simply has the CRPIX and CRVAL 
> reference points of an identified source in the image, and then one 
> forms the set of deltas in x/y and sky coordinates (say RA/Dec) relative 
> to the reference given other sources with known positions in the image.
> 
> Thus, one has a set of deltas in pixel x/y, and their corresponding 
> deltas in RA/Dec.  The CD matrix then transforms between these with 
> scaling and rotation, and so one simply performs a least squares fit to 
> determine the terms of the CD matrix.  The CD matrix is thus created for 
> a linear transformation, converting arbitrary pixel position deltas to 
> sky coordinate deltas, which are then transformed to absolute sky 
> coordinates by adding the sky reference CRVAL1/2.
> 
> 
> So this is simple for a linear transformation.  Please confirm.
> 
> How is the CD matrix created when the CTYPE is non-linear?
> 
> 
> At the first step, all we have are pixel coordinates of sources in x & 
> y, and their corresponding sky coordinates in, say, RA & Dec.  This is 
> all of the information we have.  In a linear transformation we convert 
> directly from x/y to RA/Dec via the CD matrix with scaling and rotation 
> and with the reference pixel values subtracted from the pixel 
> coordinates during that transformation, then adding the reference sky 
> values to that result.
> 
> 
> So given the limited information of two sets of corresponding 
> coordinates, how is the CD matrix created and utilized when the 
> transformation is non-linear, say, for Tangent plane projection?

To be honest, I have not had to think about these questions.  The CDi_j
(and PCi_j) are creations of folks from the optical community.  In 
radio, we control the coordinates and so only use CDELTi and perhaps a 
rotation.

The issue for AIPS is to convert CDi_j on input into coordinates we 
understand - namely CDELTi and CROTAi.  If the coordinates of your image 
are straightforward, the the CD matrix is a simple scale and rotate.  It 
can contain skew and our software has a special task to re-image the 
input to remove the skew.  That is all that the CD can do - it 
represents the change in physical coordinate wrt to pixel coordinate at 
the reference pixel.  If the image is, for example, -TAN, then your 
fitting task will need to have extra math to take that into account 
whilst solving for the derivative of Ra/Dec at the chosen reference pixel.

There is a task in aips called XTRAN that attempts to fit for 
coordinates and re-grid or re-describe an image.  Subroutine PCHDR tries 
to convert a CD matrix to a standard aips header (CDELT and CROTA). 
Task DSKEW reads the CD matrix out of the history file and does a 
re-gridding to account for the skew and rotation.

AIPS is available lots of places - the main web site starts at 
www.aips.nrao.edu.

Eric Greisen





More information about the Daip mailing list