** Next:** From Pixel to Physical
** Up:** Sky Images
** Previous:** Pixel Regularization

The coordinate system of the FITS file data array, will, in general,
be determined by the geometry of the instrumentation; consequently,
the direction of the axes in the FITS file will need to be
transformed to a coordinate system more natural to the physical system
being measured. The initial FITS paper (Wells, Greisen, and Harten 1981)
specifies use of the `CROTA`*n* keywords for describing how the
axes of the FITS array are rotated to yield physical coordinates but
does not define precisely how they are to be used. AIPS uses the
`CROTA2` keyword to represent the angle, in decimal degrees, of the
declination or latitude axis with respect to the 2 axis of the data
array, measured in the counterclockwise direction. AIPS does not use the
`CROTA1` keyword and assumes a default value of zero for the
`CROTA2` keyword. The `CROTA`*n* keywords are necessary only
when the physical coordinates are rotated relative to the array
coordinates. These AIPS conventions were endorsed at the
Charlottesville meeting, have been widely used, and will be generally
understood. However, some individual FITS files may define the
`CROTA`*n* differently. Check the comments.
The `CROTA`*n* 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 *f*_{j} and axes in the
direction of the physical coordinate system but on the array scale *a*_{i},

| |
(13) |

where the signify that positions are with respect to the
reference point. Keywords are used to specify the elements of the PC
matrix:

`PC`*iiijjj* (floating) is an multi-indexed keyword giving
the value of the pixel coordinate matrix element *P*_{ij}
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 `CDELT`*n* 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 `CROTA`*n* method should also include
the `CROTA`*n* keyword as well as the PC matrix. If is
the latitude angle represented by `CROTA`*n* in the AIPS convention,
and is the value of `CDELT`*n*, then

P_{11} = |
cos |
(4.2) |

P_{12} = |
**-** (_{2}
/ _{1}) sin |
(4.3) |

P_{21} = |
(_{1}
/ _{2}) sin |
(4.4) |

P_{22} = |
cos |
(4.5) |

It is always possible to express the `CROTA`*n* rotation in
the PC matrix form. However, not all of the more general rotations described by
the PC matrix can be described using `CROTA`*n*. When the coordinate
transformation follows the AIPS convention, the *P*() relation can be inverted to yield two separate and equivalent
expressions for :

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 `CROTA`*n* description cannot be
used (HW).

** Next:** From Pixel to Physical ** Up:** Sky Images ** Previous:** Pixel Regularization