CDx_y array
Robert Knop wrote on Jan 27, 1999
This is a basic question, which is probably documented somewhere, but I
haven't found where. It has to do with the coordinate transform
coefficients in the header; CRVAL1, CRPIX1, CD1_1, etc.
What I don't know is the orientation of the CD matrix. Which of these is
correct?
(1)
RA = CRVAL1 + CD1_1*(x-CRPIX1) + CD1_2*(y-CRPIX2)
Dec = CRVAL2 + CD2_1*(x-CRPIX1) + CD2_2*(y-CRPIX2)
or
(2)
RA = CRVAL1 + CD1_1*(x-CRPIX1) + CD2_1*(y-CRPIX2)
Dec = CRVAL2 + CD1_2*(x-CRPIX1) + CD2_2*(y-CRPIX2)
Thanks,
-Rob
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
==== Rob Knop ===== rknop@lbl.gov ====== http://panisse.lbl.gov/~rknop ======
Phil Hodge wrote on Jan 28, 1999
> This is a basic question, which is probably documented somewhere, but I > haven't found where. It has to do with the coordinate transform > coefficients in the header; CRVAL1, CRPIX1, CD1_1, etc. > > What I don't know is the orientation of the CD matrix. Which of these is > correct? > > (1) > RA = CRVAL1 + CD1_1*(x-CRPIX1) + CD1_2*(y-CRPIX2) > Dec = CRVAL2 + CD2_1*(x-CRPIX1) + CD2_2*(y-CRPIX2) > > or > > (2) > RA = CRVAL1 + CD1_1*(x-CRPIX1) + CD2_1*(y-CRPIX2) > Dec = CRVAL2 + CD1_2*(x-CRPIX1) + CD2_2*(y-CRPIX2) CDi_j is the partial derivative of the ith "world" coordinate (identified by CTYPEi) with respect to the jth pixel axis. So (1) is closer, but you need an additional conversion from angles in the tangent plane to RA & Dec. Roughly speaking, you need to divide CD1_1*(x-CRPIX1) + CD1_2*(y-CRPIX2) by cos (Dec) before adding CRVAL1. Phil
Last post on Jan 28, 1999