The CROTAn keywords cannot be applied in a straightforward way to more than two dimensions or to cases where the axes are not orthogonal. GC define the more general pixel coordinate (PC) matrix P to transform between the FITS array axes fj and axes in the direction of the physical coordinate system but on the array scale ai,
![]() |
(13) |
where the signify that positions are with respect to the
reference point. Keywords are used to specify the elements of the PC
matrix:
PCiiijjj (floating) is an multi-indexed keyword giving the value of the pixel coordinate matrix element Pij in equation 4.1.
The PC matrix technique permits considerable flexibility in transforming
between axes, including axes that are not orthogonal. Some of this
flexibility may be better left unused. In particular, it is possible to
transpose the axes when going from the pixel axes () to the
physical axes (
). Suppose the first two axes are
transposed, so that axis 2 in physical space corresponds to axis 1 in
pixel space and vice versa. The most rapidly varying axis is axis 1
(i in pixel space), described by the values of NAXIS1 and
CRPIX1. The corresponding physical axis is the one (y)
described by CTYPE2, CRVAL2, and CDELT2. CTYPE1
describes the first axis in physical space, which is now not the most
rapidly varying. If these concepts take some time to think through here,
imagine trying to understand them in a FITS file. Such complications
can be avoided if the tranformation is defined such that the diagonal
terms of the PC matrix predominate. Another potential application of the
PC matrix that is best unused is the ability to reverse the direction of
the axis. GC strongly recommend that the elements of the PC matrix
should be positive. Use the CDELTn keywords to reverse axis
directions.
Because the AIPS convention has been widely used, new software that
uses the PC matrix will still need to interpret files using the AIPS
conventions. Also, until FITS reading software routinely includes support
for the PC matrix, FITS files where the PC matrix represents a rotation
equivalent to that of the old CROTAn method should also include
the CROTAn keyword as well as the PC matrix. If is
the latitude angle represented by CROTAn in the AIPS convention,
and
is the value of CDELTn, then
P11 = | cos ![]() |
(4.2) |
P12 = | - (![]() ![]() ![]() |
(4.3) |
P21 = | (![]() ![]() ![]() |
(4.4) |
P22 = | cos ![]() |
(4.5) |
![]() |
= tan -1{-[(![]() ![]() |
(4.6) | |
=tan-1[(![]() ![]() |
(4.7) |
For a coordinate transformation following the AIPS convention, both
expressions give the same value. For more general tranformations, both
should be computed. If the difference between the two values of obtained is within the expected precision, use the average (to reduce
the round-off errors). If the difference is larger, then the coordinate
axes are not orthogonal and the CROTAn description cannot be
used (HW).