Information about the WCS
put in the Mosaic Headers
An email message from Lindsey Davis
Frank asked me to write up a description of how the coordinates are
computed from the fit below. The steps are as follows:
- Compute the first order standard coordinates xi and eta from the linear
part of the solution stored in CRPIX and the CD matrix.
xi = CD1_1 * (x - CRPIX1) + CD1_2 * (y - CRPIX2)
eta = CD2_1 * (x - CRPIX1) + CD2_2 * (y - CRPIX2)
- Apply the non-linear part of the solution if any (the part stored in
the lngcor and latcor strings in the WAT keywords).
xi' = xi + lngcor (xi, eta)
eta' = eta + latcor (xi, eta)
- Apply the standard tangent plane projection to xi' amd eta' using the
CRVAL values as the tangent point.
The main difficulty is interpreting the numbers in lngcor and latcor.
These numbers represent a surface fit for each coordinate with the entries
as followies
- The first number is the surface type encoded as a real (1=chebyshev,
2=legendre, 3=polynomial) Your header has 3 in this spot which is the
easiest surface polynomial to deal with.
- The next two numbers represent the order of the fit in x and y encoded
as reals, in your case both are 4 which means that cubic polynomials in
xi and eta were fit
- The next number defines the type of cross-terms encoded as a real
(0=no cross-terms, 1=full cross-terms, 2=half-cross terms). You have half
cross-terms which for a cubic polynomial of order 4 and 4 means you will
have 10
terms in each surface.
- The next 4 numbers describe the region of validity of the fits in
xi and eta space, e.g. ximin, ximax, etamin, etamax.
- The next 10 terms are the coefficients of the polynomial terms, i.e.
1, xi, xi**2, xi**3, eta, xi*eta, xi**2*eta, eta**2, eta**2*xi, and eta**3
respectively.
The units of xi, eta are degrees. The CRVALS are in degrees and the CD
matrix elements are in degrees / pixel.
Since I suspect your header is fairly standard I hope the above is enough
info to get you started decoding. You will have to do more work if:
- The surface fit was legendre or chebyshev. In this case you will need
to normalize the xi and eta coordinates going into lngcor and latcor to
the range -1.0 to 1.0 using ximin, ximax, etamin, etamax and of course
compute the appropriate polynomial terms.
- If your cross-terms options is not 2 then the number of terms will be
different, i.e. 7 if cross-terms = 0 and 16 if cross-terms=2.
If your data doesn't match the header below let me know I will try and
I will send more information.
Regards,
Lindsey Davis
PS. Assuming you can extract the lngcor and latcor strings from
the WAT keywords intact there is SPP code in the gsurfit package that
will make this a pretty trivial programming task.