A&A 395, 1061-1075 (2002)
DOI: 10.1051/0004-6361:20021326
E. W. Greisen1 - M. R. Calabretta2
1 - National Radio Astronomy Observatory,
PO Box O,
Socorro, NM 87801-0387,
USA
2 - Australia Telescope National Facility,
PO Box 76,
Epping, NSW 1710, Australia
Received 24 July 2002 / Accepted 9 September 2002
Abstract
The initial descriptions of the FITS format provided a simplified
method for describing the physical coordinate values of the image
pixels, but deliberately did not specify any of the detailed
conventions required to convey the complexities of actual image
coordinates. Building on conventions in wide use within astronomy,
this paper proposes general extensions to the original methods for
describing the world coordinates of FITS data. In subsequent
papers, we apply these general conventions to the methods by which
spherical coordinates may be projected onto a two-dimensional plane
and to frequency/wavelength/velocity coordinates.
Key words: methods: data analysis - techniques: image processing - astronomical data bases: miscellaneous
The Flexible Image Transport System, or FITS format, was first described by Wells et al. (1981). This format is characterized by a fixed logical record length of 2880 bytes, and the use of an unlimited number of character-format "header'' records with an 80-byte, keyword-equals-value substructure. The header is followed by the header-specified number of binary data records, which are optionally followed by extension records of the specified length, but, at that time, of unspecified format. Since then, a number of authors have suggested various types of extensions (e.g. Greisen & Harten 1981; Grosbøl et al. 1988; Harten et al. 1988; Cotton et al. 1995). Because of its great flexibility, the FITS format has been, and continues to be, very widely used in astronomy. In fact, the FITS tape format was recommended (resolution C1) for use by all observatories by Commission 5 at the 1982 meeting of the IAU at Patras (1983) and the General Assembly of the IAU adopted (resolution R11) the recommendations of its commissions, including the FITS resolution. A committee of the NASA/Science Office of Standards and Technology has codified the current state of FITS into a document which has been accepted as the official definition of the standard (Hanisch et al. 2001).
Wells et al. (1981) anticipated the need to specify the physical, or world, coordinates to be attached to each pixel of an N-dimensional image. By world coordinates, we mean coordinates that serve to locate a measurement in some multi-dimensional parameter space. They include, for example, a measurable quantity such as the frequency or wavelength associated with each point in a spectrum or, more abstractly, the longitude and latitude in a conventional spherical coordinate system which define a direction in space. World coordinates may also include enumerations such as "Stokes parameters'', which do not form an image axis in the normal sense since interpolation along such axes is not meaningful.
Wells et al. (1981) viewed each axis of the image as having a coordinate type and a reference point for which the pixel coordinate, a coordinate value, and an increment were given. Note that this reference point was not required to occur at integer pixel locations nor even to occur within the image. An undefined "rotation'' parameter was also provided for each axis. Since there are, in general, more coordinates to be attached to a pixel than there are "real'' axes in the N-dimensional image, the convention of declaring axes with a single pixel was also established in both examples given by Wells et al. The keywords defined were
CRVAL n | coordinate value at reference point |
CRPIX n | array location of the reference point in pixels |
CDELT n | coordinate increment at reference point |
CTYPE n | axis type (8 characters) |
CROTA n | rotation from stated coordinate type. |
The simplicity of this initial description was deliberate. It was felt that a detailed specification of coordinate types was a lengthy and complicated business, well beyond the scope intended for the initial paper. In addition, the authors felt that a detailed specification would probably be somewhat controversial and thus likely to compromise the possibility of wide-spread agreement on, and use of, the basic structures of the format. Hindsight also suggests that we were rather naive at the time concerning coordinates and it is fortunate that the detailed specification was postponed until greater experience could be obtained.
The descriptions of coordinates in the initial FITS paper are simply inadequate. They provide no description of the meaning of the world coordinates and suggest a rather incomplete list of coordinate types. The use of a single rotation per axis cannot describe any general rotation of more than two axes.
While participating in the development of the AIPS software package of the National Radio Astronomy Observatory, Greisen (1983, 1986) found it necessary to supply additional details to the coordinate definitions for both spectral and celestial coordinates. Since the latter have been widely used, a NASA-sponsored conference held in January 1988 recommended that they form the basis for a more general coordinate standard (Hanisch & Wells 1988); such a standard is described below.
The present work generalizes the set of world coordinate system (WCS) FITS keywords with a view to describing non-linear coordinate systems and any parameters that they may require. Alternate keywords which should be supported are described. It also addresses the questions of units, multiple coordinate descriptions, uncertainties in the coordinate values, and various other coordinate related matters. Conventions for attaching coordinate information to tabular data are also described. Paper II (Calabretta & Greisen 2002) and Paper III (Greisen et al. 2003) extend these concepts to the ideal, but non-linear angular and spectral coordinates used in astronomy. Paper IV (Calabretta et al. 2003) then provides methods to describe the distortions inherent in the image coordinate systems of real astronomical data. The complex questions related to time systems and to other kinds of coordinates will be deferred.
![]() |
Figure 1:
Conversion of pixel coordinates to world coordinates
shown as a multi-step process. In the first step a linear
transformation is applied via matrix multiplication of the pixel
coordinate vector. This linear transformation may be restricted to
the geometrical effects of rotation and skewness with scaling to
physical units deferred until the second step (
![]() ![]() |
Open with DEXTER |
In the current proposal, we regard the conversion of pixel coordinates to world coordinates as a multi-step process. This is illustrated conceptually in Fig. 1, which shows only the steps to be discussed here. Later extensions may interpose additional steps as required. For example, Paper II divides the final step into two with the computation of intermediate spherical coordinates that are subsequently converted to celestial coordinates via a spherical rotation. Paper IV interposes optional distortion corrections between the first and/or second steps of Fig. 1. Generally these are intended to account for small residuals that cannot be described by one of the standard world coordinate transformations. These may arise in a variety of ways; naturally (e.g. aberration or atmospheric refraction), via complex instrumental response functions (e.g. data cubes produced by a Fabry-Perot interferometer for which surfaces of constant wavelength are curved), by the intrinsic nature of the system under study (e.g. surface coordinates of the asteroid Eros), or as a result of instrumental peculiarities.
For all coordinate types, the first step is a linear transformation
applied via matrix multiplication of the vector of pixel
coordinate elements, pj:
The mij matrix is a non-singular square matrix of dimension
.
In the first instance, N is given by the NAXIS
keyword value, but this will be generalized with the introduction of
the WCSAXES keyword in Sect. 2.2 so that the
dimension of the world coordinates need not match that of the data
array.
The elements, qi, of the resulting intermediate pixel
coordinate vector are offsets, in dimensionless pixel units, from the
reference point along axes coincident with those of the intermediate world coordinates. Thus the conversion of qi to the
corresponding intermediate world coordinate element, xi, is a
simple scale:
The third step in the process of computing world coordinates depends on the CTYPE i. For simple linear axes, the xi are interpreted as offsets to be added to the coordinate value at the reference point given by CRVAL i. Otherwise, the CTYPE i define a function of the xi, the CRVAL i, and, perhaps, other parameters that must be established by convention and agreement. Any CTYPE i not covered by convention and agreement shall be taken to be linear.
Non-linear coordinate systems will be signaled by CTYPE i in "4-3'' form: the first four characters specify the coordinate type, the fifth character is a '-', and the remaining three characters specify an algorithm code for computing the world coordinate value, for example 'ABCD-XYZ'. We explicitly allow the possibility that the coordinate type may augment the algorithm code, for example 'FREQ-F2W' and 'VRAD-F2W' may denote somewhat different algorithms (see Paper III). Coordinate types with names of less than four characters are padded on the right with '-', and algorithm codes with less than three characters are padded on the right with blanks, for example 'RA--UV '. However, we encourage the use of three-letter algorithm codes.
Particular coordinate types and algorithm codes must be established by convention. Paper II constructs the framework for celestial coordinate systems, and Paper III does so for spectral axes (frequency-wavelength-velocity). CTYPE i values that are not in "4-3'' form should be interpreted as linear axes. It is possible that there may be old FITS files with a linear axis for which CTYPE i is, by chance, in 4-3 form. However, it is very unlikely that it will match a recognized algorithm code (use of three-letter codes will reduce the chances). In such a case the axis should be treated as linear.
The proposal to replace the CROTA i keywords of Wells et al. (1981) with a general linear transformation matrix dates from Hanisch & Wells (1988), although the details of its implementation have undergone considerable evolution. The main point of divergence has been whether the matrix should completely replace or simply augment the CDELT i, but there are also important differences relating to the default values of the matrix elements.
In defining a nomenclature which augments the CDELT i we have been guided by the following considerations:
header cards, and si as CDELT i. The i and jindices are used without leading zeroes, e.g. PC1_1 and
CDELT1. The default values for
are 1.0 for i = j and
0.0 otherwise. The
matrix must not be singular; it must have an
inverse. Furthermore, all CDELT i must be non-zero. In other
words, invertibility means that transformations which project from an
initial coordinate system of dimensionality WCSAXES to a world
coordinate system of dimensionality less than WCSAXES are
forbidden.
In the
formalism Eqs. (1) and (2) are
combined as
and the
keywords encode the product
si mij. The i and jindices are used without leading zeroes, e.g. CD1_1. The
matrix must not be singular; it must have an inverse.
CDELT i and CROTA i are allowed to coexist with
as an
aid to old FITS interpreters, but are to be ignored by new readers.
The default behavior for
differs from that for
;
if one
or more
cards are present then all unspecified
default
to zero. If no
cards are present then the header is assumed to
be in
form whether or not any
cards are present since
this results in an interpretation of CDELT i consistent with Wells
et al. (1981).
We specifically prohibit mixing of the
and
nomenclatures
in any FITS header data unit. With this restriction, translation from
the
formalism to the
formalism is effected simply in the
keyword parsing stage of header interpretation; the CDi_j should be considered equivalent to the
subject
to the considerations for default values noted above and with
CDELT i set to unity. Similarly,
can be calculated from
and CDELT i following Eq. (3).
The proposal presented in this and the subsequent papers is not simple and provides wide latitude for mistakes in describing the WCS and in writing the FITS headers. The result of an improperly described WCS is simply undefined; it is the job of the FITS writer to produce a correct description. A simple error which could be made in a WCS description, or with other parts of a header, is a repetition of keywords with different values assigned to them. If, for example, BUNIT were repeated with a new value, the data would have unknown units but would be read correctly. In binary tables, a second value for TFORM n would cause the tabular data to be read incorrectly.
This is a very general proposal! The linear transformation matrix allows for skew and fully general rotations. The reader should note that this allows dissimilar axes to be rotated into one another. This is meaningful in imaging; for example, one may wish to re-sample a spectral-line cube from some special viewing angle in the three-space of two celestial coordinates and one frequency coordinate. Such rotations are, however, forbidden into axes whose coordinate values are, by convention, only integral. Thus, if CTYPE i0 indicates a world coordinate of integral type, then row i0 of the linear transformation matrix must contain only one non-zero element, and this would normally be 1.0 or at least integral. Additionally, it must be the only non-zero element in the column containing it. The STOKES axis is one such coordinate; see Sect. 5.4.
The linear transformation matrix could also be used to represent
images that have been transposed, e.g.
Equations (1) and (2) allow considerable
flexibility in the way the linear transformation is partitioned
between the
and CDELT i. In the absence of any formal
constraints, the normal expectation would be that the CDELT i be
used as scaling parameters as in the past. This is straightforward if
is orthogonal, i.e. defines a pure rotation or simple
reflection, but not if it has an element of skewness. In general, a
reasonable approach is to choose CDELT i so that
Note that integer pixel numbers refer to the center of the pixel
in each axis, so that, for example, the first pixel runs from pixel
number 0.5 to pixel number 1.5 on every axis. Note also that the
reference point location need not be integer nor need it even occur
within the image. The original FITS paper (Wells et al. 1981)
defined the pixel numbers to be counted from 1 to NAXIS j
(1) on each axis in a Fortran-like order as presented in the
FITS image
.
A WCS representation should be invertible in the sense that a
pixel coordinate, when transformed to a world coordinate, must be
uniquely recoverable from that world coordinate. Note that this does
not require that each pixel coordinate in an image have a valid world
coordinate; as an example, pixel coordinates in the corner of a
Hammer-Aitoff projection of the full sky fall outside the map
boundary. Nor need each valid world coordinate correspond to a pixel
coordinate; for example, the divergent poles of the Mercator
projection are inaccessible. In practical terms, it means that two or
more different pixel coordinates should not map to the same world
coordinate, as exemplified by a cylindrical projection in which the
longitude spans more than
.
Such coordinate systems, while
easy to construct, may be very difficult to interpret properly in all
respects, including that of drawing a coordinate grid. Thus, while
they are not explicitly prohibited, it may be expected that general
WCS interpreting software may not handle them properly.
An additional convention is needed where non-linear axes must be grouped, for example, the two axes which form a map plane. In general, all axes in the group must have identical algorithm codes and a scheme must be established by convention for associating members of the group and, if necessary, their order. For example, Paper II introduces the 'xLON/xLAT' and 'yzLN/yzLT' conventions for associating longitude/latitude coordinate pairs. This should serve as a model for other cases. Note that grouping is not required for linear axes which are always separable (in the mathematical sense) by means of a rotation or skew applied via the linear transformation matrix.
Some non-linear algorithms require parameter values, for example, conic projections require the latitudes of the two standard parallels. Where necessary, numeric parameter values will be specified via
PV i_m (floating-valued) |
keywords, where i is the intermediate world coordinate axis number and m is the parameter number. Leading zeros are not allowed and m may have only those values defined for the particular non-linear algorithm in the range 0 through 99 only. There may also be auxiliary keywords which are required to define, for example, the frames of reference used for celestial and velocity coordinates.
A few non-linear algorithms may also require character-valued parameters, for example, table lookups require the names of the table extension and the columns to be used. Where necessary, character-valued parameters will be specified via
PS i_m (character-valued) |
keywords, where i is the intermediate world coordinate axis number and m is the parameter number. Leading zeros are not allowed and m may have only those values defined for the particular non-linear algorithm in the range 0 through 99 only.
The keywords proposed above and throughout the main body of this manuscript apply to the relatively simple images stored in the main FITS image data and in IMAGE extensions Ponz et al. 1994). When coordinates are used to describe image fragments in BINTABLE extension tables (Cotton et al. 1995), additional nomenclature conventions are required. These are described in Sect. 3.
The number of world coordinate elements associated with a datum can exceed the number of pixel coordinate elements which locate it in the image data array. For example, long-slit optical spectra are naturally two-dimensional; normally the slit is aligned with one (spatial) pixel axis and the dispersion coincides with the other (spectral) pixel axis. While the spectral representation is straightforward - one spectral pixel coordinate transforms to just one spectral world coordinate (frequency, wavelength or velocity) - the spatial representation would appear to be problematic. Since the slit can be oriented at any angle on the sky, the single pixel coordinate which locates a datum along the length of the slit must transform to two spatial (angular) coordinates, typically a right ascension and a declination, neither of which need be constant.
In fact, this problem was solved very early in the history of FITS. Wells et al. (1981) illustrate headers containing degenerate axes, i.e. axes having NAXIS j = 1, and this, combined with the meaning assigned to CROTA i by Greisen (1983), provides a fully functional solution. While not previously documented outside the AIPS project, this solution is well known and has been used extensively. Basically the idea is simply to increment the number of pixel coordinate elements as required by introducing degenerate axes.
For the long slit example, we set NAXIS = 3 and NAXIS = 1. Supposing without loss of generality that CTYPE1 is
the spectral axis, we represent CTYPE2 as right ascension and
CTYPE3 as declination. CROTA i in the original formulation
is here replaced by
,
so that pixel coordinates along the length
of the slit,
(p2, p3=1), transform to intermediate world
coordinates (x,y). Thus the slit's locus in the xy-plane is a
straight line whose orientation can be controlled via the
matrix. Details of the transformation of (x,y) to celestial
spherical coordinates are properly the subject of Paper II. However,
given that the xy-plane is to be interpreted as the map plane of a
spherical projection, it should be clear that rotating the slit in the
xy-plane via the
matrix corresponds to rotating it on
the sky. Paper II discusses this long slit example in detail.
There is concern that requiring the use of degenerate pixel axes would have severe repercussions for a significant fraction of existing software programs which were not written to deal with such usage. For example, some software intended to handle two-dimensional images would reject a FITS header with NAXIS = 3, even if the third axis is degenerate. At the same time, degenerate axes are a widespread and natural representation for images in a multi-dimensional space. Furthermore, as shown in Fig. 1 of Wells et al. (1981), explicit specification of degenerate axes allows them to appear in any order. Such usage may facilitate image building and sub-imaging operations.
To provide a solution for this world-coordinate dimensionality problem that does not require the use of degenerate axes, we reserve the keyword
WCSAXES (integer-valued)
to specify the highest value of the index of any WCS keyword
in the header (i.e. CRPIX j,
or
,
CDELT i, CTYPE i,
CRVAL i, or CUNIT i). The default value is the larger of NAXIS and the largest index of these keywords found in the FITS
header. This keyword, if present, must precede all WCS keywords
(other than the NAXIS j). The use of this keyword also solves the
problem posed by alternate axis descriptions (Sect. 2.5)
which may have an intrinsically different coordinate dimensionality.
In the slit example, an alternate description of the x,y coordinates
on the detector has no use for a third axis. It is a good idea to
provide a coordinate description, even if it is only a "pixel'' axis,
for all array axes having more than one pixel.
There is debate within the community as to whether the official definition of FITS (Hanisch et al. 2001) prohibits the occurrence of WCS-related keywords with indices greater than the value of NAXIS. We make no claims one way or the other, but rather assert that in order to accommodate WCS specifications whose dimensionality exceeds NAXIS without the use of degenerate coordinate axes, such use must be allowed. Consistent with Hanisch et al. (2001), however, no NAXIS j keywords may exist for j > NAXIS. Thus, calculations related to determining the total length of the data array, which relies upon a product of the NAXIS j values, are unaffected. Accordingly, all axes with axis number greater than NAXIS must be one pixel in length implicitly rather than explicitly.
The original FITS paper (Wells et al. 1981) assumed that the units along each axis could be implied simply by the contents of the CTYPE i keyword. This has not turned out to be true in general. Therefore, we propose adding a new indexed, keyword
CUNIT i (character-valued) |
with which the units of CRVAL i and CDELT i may be specified. Restrictions on the nature and range of units, if any, will be determined by the agreements applying to the specific axes. If they are not so limited, units should conform with the recommendations of the IAU Style Manual (McNally 1988). Particular conventions for CUNIT i values are discussed in Sect. 4. Case will be significant in the values assigned to CUNIT i since, for example, it is necessary to represent both milli and Mega prefixes for units such as mJy and MJy. The values assigned to CUNIT i cannot exceed 68 characters, but may well be longer than the 8 characters which has been a traditional - but optional - limit for character-valued but non-mandatory keywords.
The original FITS paper also assumed that the coordinate keywords, if present, would all be present and, therefore did not define defaults for the standard keywords. We therefore define the defaults to be
WCSAXES | NAXIS or largest i or j |
CRVAL i | 0.0 |
CRPIX j | 0.0 |
CDELT i | 1.0 |
CTYPE i | ' ' (i.e. a linear undefined axis) |
CUNIT i | ' ' (i.e. undefined) |
PC i_j | 1.0 when i = j |
PC i_j | 0.0 when ![]() |
CD i_j | 0.0 but see Sect. 2.1.2. |
In some cases, an axis of an image may be described as having more
than one coordinate type. An example of this would be the frequency,
velocity, and wavelength along a spectral axis (only one of which, of
course, could be linear). One can also describe the position on a
CCD camera chip (or photographic plate) in meters as well as in
degrees on the sky. To allow up to 26 additional descriptions of each
axis, we propose the addition of the following optional, but now
reserved, keywords defined in Table 1,
where j and i are pixel and intermediate world
coordinate axis numbers, respectively, and a is a character A through Z specifying the coordinate version. The axis numbers
are restricted by this convention to the range 1-99 and the
coordinate parameter m is restricted to the range 0-99, both
with no leading zeros. Note that the primary version of the
coordinate description is that specified with a as the blank
character. If an alternate coordinate description is specified, all
coordinate keywords for that version must be given even if they do not
differ from those of the primary version. Rules for the default
values of alternate coordinate descriptions are the same as those for
the primary description. The alternate coordinate descriptions are
computed in the same fashion as the primary coordinates. The type of
coordinate depends on the value of CTYPE
and may be linear in
one of the alternate descriptions and non-linear in another.
WCSAXES a | number of axes in WCS description |
(integer) | |
CRVAL
![]() |
coordinate value at reference point |
(real floating) | |
CRPIX
![]() |
pixel coordinate of the reference point |
(real floating) | |
PC i_
![]() |
linear transformation matrix |
(real floating) | |
CDELT
![]() |
coordinate increment |
(real floating) | |
CD i_
![]() |
linear transformation matrix (with scale) |
(real floating) | |
CTYPE ![]() |
axis type |
(8 characters) | |
CUNIT
![]() |
units of CRVAL
![]() ![]() |
(character) | |
PV i_
![]() |
coordinate parameter m |
(real floating) | |
PS i_
![]() |
coordinate parameter m |
(character) |
Alternate axis descriptions are optional, but may only be specified if a primary axis description is specified. The alternate version codes are selected by the FITS writer; there is no requirement that the codes be used in alphabetic sequence and no requirement that one coordinate version differ in its parameter values from another.
An optional keyword
is also defined to name, and otherwise document, the various versions of world coordinate descriptions. This keyword can be used to give the user simple names by which to request the various versions of the coordinates. It may also be used, for example, to distinguish coordinates used during data acquisition from those determined later by astrometrically rigorous reductions. It might also be used to specify which are data pixels and which are calibration pixels in a CCD image.
The coordinates of a pixel may not always be known exactly. Instead, they are often subject to both random, statistical errors and various systematic errors. The former are not particularly correlated between pixels, whereas the latter may have a high degree of correlation across the whole data set. For example, single-dish radio images may be accurate on a pixel-to-pixel basis to a fraction of an arcsec, but have a 5-10 arcsec uncertainty in the reference point value. Two optional keywords are hereby reserved to specify these uncertainties in coordinates. They are
CRDER i a | random error in coordinate |
(real floating) | |
CSYER i a | systematic error in coordinate |
(real floating) |
where both are given in units of CUNIT
and
have default value zero. They are understood to give a representative
average value of the error over the range of the coordinate in the
data file. The total error in the coordinate would be given by
summing the two errors in quadrature.
The errors in actual coordinates may be very much more complex than this simple representation. In the most general case, one might require, at each pixel, a covariance matrix to describe the dependence of the uncertainty in one coordinate on the uncertainties in the others. Furthermore, the errors in one coordinate description may, or may not, be completely predictable from those of an alternate description. Such usages, while perhaps important under some circumstances, are well beyond the needs of most users and the scope of this manuscript.
Keyword | Primary | BINTABLE vector | Pixel List | ||
Description | Array | primary | alternate | primary | alternate |
Coordinate dimensionality | WCSAXES a | WCAX n a | - | ||
Axis type | CTYPE
![]() |
i CTYP n | i CTY n a | TCTYP n | TCTY n a |
Axis units | CUNIT
![]() |
i CUNI n | i CUN n a | TCUNI n | TCUN n a |
Reference value | CRVAL
![]() |
i CRVL n | i CRV n a | TCRVL n | TCRV n a |
Coordinate increment | CDELT
![]() |
i CDLT n | i CDE n a | TCDLT n | TCDE n a |
Reference point | CRPIX
![]() |
j CRPX n | j CRP n a | TCRPX n | TCRP n a |
Transformation matrix | PC i_
![]() |
ij PC n a | TP n_ k a | ||
Transformation matrix | CD i_ j a | ij CD n a | TC n_ k a | ||
Coordinate parameter | PV i_
![]() |
i V n_ m a | TV n_ m a | ||
Coordinate parameter array | - | i V n_X a | - | ||
Coordinate parameter | PS i_
![]() |
i S n_ m a | TS n_ m a | ||
Coordinate name | WCSNAME a | WCSN n a | TWCS n a | ||
Random error | CRDER i a | i CRD n a | TCRD n a | ||
Systematic error | CSYER i a | i CSY n a | TCSY n a | ||
WCS cross-ref. target | - | WCST n a | - | ||
WCS cross reference | - | WCSX n a | - | ||
![]() |
CROTA i | i CROT n | TCROT n |
CROTA i form is deprecated. It may be
used only when
,
PV i_m, and PS i_m are not used
and when a is blank.
In addition to the image format discussed in the previous sections of
this paper (i.e. an -dimensional array in a FITS primary array or
FITS IMAGE extension), there are two other FITS image
representations that are used commonly by the astronomical community
in binary tables extensions (Cotton et al. 1995) in the
forms of:
The NOST (Hanisch et al. 2001) standard provides that the interpretation of raw field values found in any column n of a FITS table (either ASCII or binary) may be transformed into true physical values by the presence of the keywords TZERO n and TSCAL n for that column. The tabular WCS keywords defined in this section (and in the corresponding tabular keyword sections of subsequent WCS papers) operate on the true physical values, not on the raw field values. Therefore any transformation specified by TZERO n and TSCAL n is to be applied before these tabular WCS computations.
A vector column in a binary table (BINTABLE) extension can be used to store a multi-dimensional image in each element (i.e. each row) of the column. In the simple case in which all the images have the same fixed size, the TDIMn keyword can be used to specify the dimensions. In the more general case, a variable length vector may be used to store different-sized images within the same column.
Because two or more columns in a binary table can contain images, the naming convention for these coordinate system keywords must encode the column number containing the image to which the keyword applies as well as the axis number within the image. The naming convention described here uses the keyword prefix to specify the axis number and the keyword suffix to specify the column number containing the image (e.g. the 2CRVL15 keyword applies to the second axis of the image in Col. 15 of the table).
An image may also be represented as a list of
pixel
coordinates in a binary or ASCII table extension. This representation
is frequently used in high-energy astrophysics as a way of recording
the position and other properties of individually detected photons.
This image format requires a minimum of n table columns which give
the
(axes 1 through n) pixel coordinate of
the corresponding event in the virtual n-D image; any number of
other columns may be included in the table to store other parameters
associated with each event such as arrival time or photon energy.
This virtual image may be converted into a real image by computing the
n-dimensional histogram of the number of listed events that occur in
each pixel of the image (i.e. the intensity value assigned to each
pixel (
)
of the image is equal to the number of
rows in the table which have axis 1 coordinate = p1, axis 2
coordinate = p2), etc.
A variation on this pixel list format may be used to specify explicitly the intensity value of each image pixel. This case requires at least n+1 table columns which specify the axis 1 coordinate, the axis 2 coordinate, etc. plus the value of the pixel at that coordinate. In this representation each pixel coordinate would only be listed at most once in the table; pixels with a value = 0 may be omitted entirely from the table to conserve space.
Each axis of the image in this representation translates into a separate column of the table, so the suffix of the coordinate system keywords all refer to a column number rather than an axis number (e.g. the TCRP12 keyword applies to the coordinates listed in the 12th column of the table). This form of WCS keyword may only be used with columns containing scalar values; the BINTABLE form must be used with columns containing more than one value per table cell.
The presence of data from each column within a particular row of a
table implies an association of those data with each other. However,
no formal method has previously been defined for identifying and
associating the columns which contain image pixel coordinates,
although informal conventions using new keywords have been used. Past
practice has been to use distinctive column names
(e.g. TTYPE n keywords with values of 'DETX' and
'DETY', or 'X' and 'Y') which a human interpreter may use
to form associations. However, this is not generally suitable for
interpretation by software.
The keywords defined for pixel lists in Table 2
partially remedy this by identifying the pixel coordinate columns.
For example, the presence of TCTY
in the header of a
binary table identifies column n as containing a pixel coordinate
rather than, say, a pixel value. In so doing it also identifies the
binary table as a pixel list. Moreover, where a pixel list contains
multiple coordinate representations, the presence of a complete set of
TPn_ka keywords would also provide a method of
associating the coordinate axes of each representation.
Thus, pending a formal solution of this problem, it is suggested that a complete set of TPn_ka (or TCn_ka) keywords be included in the pixel list header to define an association of coordinate axes. It should be noted that, while such an association is unordered, this is not a concern for the computation of world coordinates.
Table 2 lists the corresponding set of coordinate system keywords for use with each type of FITS image representation. The data type of the table keyword matches that of the corresponding primary image keyword. The allowed values for these keywords are identical for all three types of images as defined in the main body of this paper. The old and now deprecated keyword CROTA i has been used with tables and is included since readers will need to understand this keyword even if writers should no longer write it. See Paper II for a discussion of this point. To support current usage, the keywords are given in their current form to be used for the primary coordinate representation (a is blank) and a new form to support the new capability to specify alternate coordinates for the same axis (a is A through Z). For new keywords, the two forms are identical and are shown in a single column midway between the columns for old primary and new alternate WCS keywords. The following notes apply to the naming conventions used in Table 2:
In the case of the binary table vector representation, all the images contained in a given column of the table may not necessarily have the same coordinate transformation values. For example, the pixel location of the reference point may be different for each image/row in the table, in which case a single 1CRPn keyword in the header is not sufficient to record the individual value required for each image. In such cases, the keyword must be replaced by a column with the same name (i.e. TTYPEm = '1CRPn') which can then be used to store the pixel location of the reference point appropriate for each row of the table. This convention for expanding a keyword into a table column (or conversely, collapsing a column of identical values into a single header keyword) is commonly known as part of the "Greenbank Convention'' for FITS keywords and is illustrated in the example header shown in Paper II (Table 9).
There are several restrictions which may be too limiting for the parameters of certain types of coordinates and, in particular, for the distortion parameters to be introduced in Paper IV. The limitation to 8 characters limits the number of columns to 999, the number of axes to 9, and the number of parameters to as few as 10 (numbered 0 through 9, for column numbers exceeding 99). To avoid this difficulty, we introduce the concept of a parameter array as a single column of a table. All the parameters of a coordinate are given up to the maximum dimension of the column (given by keyword TFORMn) with no omitted parameters. Such parameter arrays are signaled by replacing the _m in the table column name with _X.
The Greenbank and parameter-array conventions are not needed with pixel lists since they are used to represent a single image.
While a coordinate representation may be shared amongst image arrays within the same column of a binary table, it may also happen that several image arrays within the same row of a binary table must share the same coordinate representation. For example, each row of a table might store a raw optical spectrum, the corresponding sky background spectrum, a flux-calibrated spectrum derived from these, and a spectrum of the error in each channel. It would not be appropriate to coerce these into a 2-dimensional data array with a heterogeneous second axis, and in any case this would complicate the addition or removal of spectra, say, as the result of data reduction. It also may not be satisfactory simply to repeate the coordinate description for each spectrum. For example, it would be preferable to apply a wavelength calibration to one shared representation rather than several identical copies.
This situation is handled by introducing coordinate system cross-references. These apply only to binary tables containing multiple image array columns, they are not relevant to primary image arrays or to pixel lists which represent only a single data set.
Coordinate system cross-references allow an image array in one column to reference the coordinate system defined for an image array in another column. The cross-reference is specified by the keyword pair
WCST
![]() |
for the referred-to (target) coordinate system, and
WCSX
![]() |
for the referring (cross-referencing) system, and these must
have identical, case-sensitive, keyword values. WCSX
must not be combined with any Table 2 coordinate
keywords that use the same alternate descriptor. With regard to the
Greenbank convention (Sect. 3.4), when WCST
and/or
WCSX
are columns of the table, the scope of the
keyword(s) is limited to one row of the table. Thus the same value of
WCST
and WCSX
may be reused in different rows.
On encountering WCSX
,
FITS header-parsing software must
resolve the reference by searching for WCST
with the same
value, extracting the column number and alternate descriptor suffix
encoded in the keyword itself, and then searching for and loading the
associated coordinate keywords.
To continue the example above, suppose that Col. 12 contains a raw
optical spectrum for which the coordinate system is fully specified,
and that WCST12B has been set to 'XREF1'. Then a sky
background spectrum in Col. 13 might reference this coordinate
system by setting WCSX13A = 'XREF1'. In this case, Col. 13
must not contain any of the Table 2 keywords for
alternate descriptor a = A, although it might contain
keywords for some other value of a. The example illustrates that
the alternate descriptor suffixes for WCST
and
WCSX
need not match; the association is via the keyword
value alone.
String | Meaning |
str1 str2 |
Multiplication |
str1*str2 |
Multiplication |
str1.str2 |
Multiplication |
str1/str2 |
Division |
str1**expr |
Raised to the power expr |
str1^expr |
Raised to the power expr |
str1expr |
Raised to the power expr |
log(str1) |
Common Logarithm (to base 10) |
ln(str1) |
Natural Logarithm |
exp(str1) |
Exponential ( e<tex2htmlverbmark>14<tex2htmlverbmark>) |
sqrt(str1) |
Square root |
Submult | Prefix | Char | Mult | Prefix | Char |
10-1 | deci | d |
10 | deca | da |
10-2 | centi | c |
102 | hecto | h |
10-3 | milli | m |
103 | kilo | k |
10-6 | micro | u |
106 | mega | M |
10-9 | nano | n |
109 | giga | G |
10-12 | pico | p |
1012 | tera | T |
10-15 | femto | f |
1015 | peta | P |
10-18 | atto | a |
1018 | exa | E |
10-21 | zepto | z |
1021 | zetta | Z |
10-24 | yocto | y |
1024 | yotta | Y |
Quantity | Unit | Meaning | Notes |
String | |||
SI base & supplementary units | |||
length | m |
meter | |
mass | kg |
kilogram | g gram okay |
time | s |
second | |
plane angle | rad |
radian | |
solid angle | sr |
steradian | |
temperature | K |
kelvin | |
electric current | A |
ampere | |
amount of substance | mol |
mole | |
luminous intensity | cd |
candela | |
IAU-recognized derived units | |||
frequency | Hz |
hertz | s-1 |
energy | J |
joule | N m |
power | W |
watt | J s-1 |
electric potential | V |
volt | J C-1 |
force | N |
newton | kg m s-2 |
pressure, stress | Pa |
pascal | N m-2 |
electric charge | C |
coulomb | A s |
electric resistance | Ohm |
ohm | V A-1 |
electric conductance | S |
siemens | A V-1 |
electric capacitance | F |
farad | C V-1 |
magnetic flux | Wb |
weber | V s |
magnetic flux density | T |
tesla | Wb m-2 |
inductance | H |
henry | Wb A-1 |
luminous flux | lm |
lumen | cd sr |
illuminance | lx |
lux | lm m-2 |
Quantity | Unit | Meaning | Notes | |
String | ||||
plane angle | deg |
degree of arc | ![]() |
|
arcmin |
minute of arc | 1/60 deg | ||
arcsec |
second of arc | 1/3600 deg | ||
mas |
milli-second of arc | 1/3 600 000 deg | ||
time | min |
minute | ||
h |
hour | |||
d |
day | 86 400 s | ||
![]() |
a |
year (Julian) | 31 557 600 s (365.25 d), peta a
(Pa ) forbidden |
|
![]() |
yr |
year (Julian) | a is IAU-style |
|
energy* | ![]() |
eV |
electron volt |
![]() |
![]() |
erg |
erg | 10-7 J | |
Ry |
rydberg |
![]() |
||
mass* | solMass |
solar mass |
![]() |
|
u |
unified atomic mass unit |
![]() |
||
luminosity | solLum |
Solar luminosity |
![]() |
|
length | ![]() |
Angstrom |
angstrom | 10-10 m |
solRad |
Solar radius |
![]() |
||
AU |
astronomical unit |
![]() |
||
lyr |
light year |
![]() |
||
![]() |
pc |
parsec |
![]() |
|
events | count |
count | ||
ct |
count | |||
photon |
photon | |||
ph |
photon | |||
flux density | ![]() |
Jy |
jansky | 10-26 W m-2 Hz-1 |
![]() |
mag |
(stellar) magnitude | ||
![]() |
R |
rayleigh |
![]() |
|
magnetic field | ![]() |
G |
gauss | 10-4 T |
area | pixel |
(image/detector) pixel | ||
pix |
(image/detector) pixel | |||
![]() |
barn |
barn | 10-28 m2 | |
Miscellaneous "units'' | ||||
D |
debye |
![]() |
||
Sun |
relative to Sun | e.g. abundances | ||
chan |
(detector) channel | |||
bin |
numerous applications | (including the 1-d analogue of pixel) | ||
voxel |
3-d analogue of pixel | |||
![]() |
bit |
binary information unit | ||
![]() |
byte |
(computer) byte | 8 bit | |
adu |
Analog-to-digital converter | |||
beam |
beam area of observation | as in Jy/beam |
Unless agreed otherwise, units should conform with the recommendations
of the IAU Style Manual (McNally 1988). Unfortunately,
this manual defines units as they would appear in a published document
rather than as they must appear in plain character form. George & Angelini (1995) and Ochsenbein et al. (1996) have
prepared detailed documents on this subject upon which the following
remarks are based. In particular, the following tables are taken from
George & Angelini's manuscript (with some changes and additions).
Readers should consult these references for examples and expanded
discussion. We allow the possibility that the interpretation of
CUNIT
may depend on conventions established for the
CTYPE
associated with them. For example, units specified by "s'' might mean SI seconds or seconds of sidereal time.
The basic units string, called str1 and str2 in
Table 3, is composed of a unit string taken from Col. 2
of the IAU-recognized units in Table 5 or the extended
astronomical units in Table 6. All units from the
former and selected units from the latter may be preceded, with no
intervening blanks by a single character (two for deca) taken from
Table 4 and representing scale factors mostly in steps
of 103. Compound prefixes (e.g., ZYeV
for 1045 eV)
are prohibited. A compound string may then be created from these
simple strings by one of the notations in Table 3. A
unit raised to a power is indicated by the unit string followed, with
no intervening blanks, by the optional symbols **
or ^
followed by the power given as a numeric expression, called
expr
in Table 3. The power may be a simple
integer, with or without sign, optionally surrounded by parentheses.
It may also be a decimal number (e.g., 1.5, .5) or a ratio of two
integers (e.g. 7/9), with or without sign, which are always surrounded
by parentheses. Thus meters squared is indicated by m**(2)
,
m**+2
, m+2
, m2
, m^2
, m^(+2)
,
etc. and per meter cubed is indicated by m**-3
, m-3
,
m^(-3)
, /m3
, and so forth. Meters to the three halves
may be indicated by m(1.5)
, m^(1.5)
, m**(1.5)
,
m(3/2)
, m**(3/2)
, and m^(3/2)
, but not by
m^3/2
or m1.5
.
Note that functions such as log actually require dimensionless
arguments, so, by log(Hz), for example, we actually mean log(x/1Hz). The final string to be given as the value of
CUNIT
is the compound string, or a compound of compounds,
preceded by an optional numeric multiplier of the form 10**k, 10^k, or 10
where k is
an integer, optionally surrounded by parentheses with the sign
character required in the third form in the absence of parentheses.
FITS writers are encouraged to use the numeric multiplier only when
the available standard scale factors of Table 4 will
not suffice. Parentheses are used for symbol grouping and are strongly
recommended whenever the order of operations might be subject to
misinterpretation. A blank character implies multiplication which can
also be conveyed explicitly with an asterisk or a period. Therefore,
although blanks are allowed as symbol separators, their use is
discouraged. Two examples are '10**(46)erg/s'
and 'sqrt(erg/pixel/s/GHz)'. Note that case is significant throughout.
The IAU style manual forbids the use
of more than one solidus (/) character in a units string. In the present conventions, normal
mathematical precedence rules are assumed to apply, and we, therefore,
allow more than one solidus. However, authors might wish to consider,
for example, 'sqrt(erg/(pixel.s.GHz))' instead of the form given
previously.
It is very helpful to adopt a convention for the display of images transferred via the FITS format. Many of the current image processing systems have converged upon such a convention. Therefore, we recommend that FITS writers order the pixels so that the first pixel in the FITS file (for each image plane) be the one that would be displayed in the lower-left corner (with the first axis increasing to the right and the second axis increasing upwards) by the imaging system of the FITS writer. This convention is clearly helpful in the absence of a description of the world coordinates. It does not preclude a program from looking at the axis descriptions and overriding this convention, or preclude the user from requesting a different display. This convention also does not excuse FITS writers from providing complete and correct descriptions of the image coordinates, allowing the user to determine the meaning of the image. The ordering of the image for display is simply a convention of convenience, whereas the coordinates of the pixels are part of the physics of the observation.
If the units of the keyword value are specified in the comment of the
header keyword, it is recommended that the units string be
enclosed in square brackets at the beginning of the comment field,
separated from the slash ('/') comment field delimiter by a
single space character. This widespread, but optional, convention
suggests that square brackets should be used in comment fields only
for this purpose. Nonetheless, no software should depend on there
being units expressed in this fashion within a keyword comment, nor
should any software depend on any string within square brackets in a
comment field containing a proper units string. This convention is
purely for the human reader, although software could be written which
would interpret the string only if present and of proper content.
If there is an established convention for the units of a keyword, then
only those units may be used. An example, using a non-standard
keyword, is
EXPTIME = 1200./[s] exposure time in seconds.
Binary extension tables (Cotton et al. 1995) use the NAXIS2 keyword, invented for simple images, to specify the number of rows in a table. It has been suggested that, if the rows of the table are regularly spaced in some world coordinate, that world coordinate could be described with the other axis-2 keywords such as CTYPE2a, CRVAL2a, CDELT2a, and PC2_2a. Since we know of no software system using this convention with these general keywords, we deprecate the suggestion. There are very powerful and useful general operators such as sorting, editing, and concatenation which alter the value of the row number and therefore corrupt the value of the implied coordinate. If FITS were solely used as an interchange mechanism, these operators would not be relevant. But FITS is now used as the internal format of several software systems for which the general operators are important. Initial row number can be recorded as a column in tables and associated with a physical coordinate via keywords described in Sect. 3.
Value | Symbol | Polarization |
1 | I | Standard Stokes unpolarized |
2 | Q | Standard Stokes linear |
3 | U | Standard Stokes linear |
4 | V | Standard Stokes circular |
-1 | RR | Right-right circular |
-2 | LL | Left-left circular |
-3 | RL | Right-left cross-circular |
-4 | LR | Left-right cross-circular |
-5 | XX | X parallel linear |
-6 | YY | Y parallel linear |
-7 | XY | XY cross linear |
-8 | YX | YX cross linear |
In the first FITS paper, Wells et al. (1981) listed a number of "suggested values'' for CTYPE i. Two of these have the attribute that they can assume only integer coordinate values and that the meaning of these integers is only by convention. These two axis types are in wide-spread use and we wish to repeat their definition here to extend their definitions and to reserve their names and meanings.
The first conventional coordinate is CTYPE
= 'COMPLEX'
to specify complex valued data. FITS data are limited to a single
real number value at each pixel making this axis necessary to
represent data which are weighted complex numbers. Conventional
values of 1 for the real part, 2 for the imaginary part, and 3 for a
weight (if any) have been widely used.
The second conventional coordinate is CTYPE
= 'STOKES'
to specify the polarization of the data. Conventional values, their
symbols, and polarizations are given in Table 7.
Keyword | Type | Sect. | Use | Status | Comments |
WCSAXES a | integer | 2.2 | WCS dimensionality | new | allows WCS specification for degenerate axes, |
to be explicit rather than implicit. | |||||
CRVAL
![]() |
floating | 2.1.1 | value at reference point | extended | meaning of reference point forced by coord. type. |
CRPIX
![]() |
floating | 2.1.1 | pixel of reference point | extended | meaning of reference point forced by coord. type. |
CDELT
![]() |
floating | 2.1.1 | increment at ref. point | retained | meaning of increment clarified. |
CROTA i | floating | 1 | rotation at ref. point | deprecated | replaced by
![]() ![]() |
CTYPE
![]() |
character | 2.1.1 | coord./algorithm type | extended | Non-linear types have "4-3'' form: characters 1-4 |
specify the coordinate type, character 5 is " -'', | |||||
and characters 6-8 specify an algorithm code | |||||
for computing the world coordinate value; | |||||
case dependent. | |||||
CUNIT
![]() |
character | 2.3 | units of coord. values | new | case dependent, allowed values and combinations |
are described in Sect. 4. | |||||
PC i_
![]() |
floating | 2.1.2 | transformation matrix | new | linear conversion of pixel number to pixels along |
coordinate axes; default
![]() |
|||||
CD i_ j a | floating | 2.1.2 | transformation matrix | new | linear conversion of pixel number to relative |
coordinates; default all 0 if any given, | |||||
else
![]() |
|||||
PV i_
![]() |
floating | 2.1.4 | parameter m | new | parameters required in some coordinate types; |
defaults are algorithm-specific; see Papers II and | |||||
III for usage examples and default conventions | |||||
PS i_
![]() |
character | 2.1.4 | parameter m | new | parameters required in some coordinate types; |
defaults are algorithm-specific; see Paper III | |||||
for usage example and default conventions | |||||
WCSNAME a | character | 2.5 | coord. version name | new | optional documentation |
CRDER i a | floating | 2.6 | random error | new | uncertainty in coordinate due to random errors; |
default = 0 | |||||
CSYER i a | floating | 2.6 | systematic error | new | uncertainty in coordinate due to systematic |
errors; default = 0 |
where j is a pixel axis number 1 through 99,
i is an intermediate world coordinate axis number 1 through
99, m is a parameter number 0 through 99, and a is a
coordinate description version character blank and A through
Z. PC i_
and CD i_
may not occur in the
same header data unit.
A simple header construction example based on Einstein's Special Theory of Relativity (1905) will serve to illustrate the formalism introduced in this paper. We will construct dual coordinate representations, the first for the rest frame and the second for an observer in uniform motion.
Suppose we have a data cube that, in the rest frame, has the following simple
header containing two spatial axes and one temporal axis:
The spatial and temporal coordinates measured by an observer moving with
uniform velocity v in the +x direction are related to the rest coordinates
by the Lorentz transformation:
d=![]() |
The changes to FITS-header keywords are summarized in Table 8. As described in Paper II, for one purpose, CROTA i may in some cases be used instead of the new keywords so that the coordinate information may be understood by software systems which have yet to be converted to these new conventions.
Acknowledgements
The authors would particularly like to thank Steve Allen (University of California, Lick Observatory) and Patrick Wallace (U.K. Starlink) who provided valuable encouragement, feedback and suggestions over the long period of this work's development. We are grateful for the assistance provided by Bob Hanisch (Space Telescope Science Institute) in bringing the manuscript to its final form. We thank William Pence, Arnold Rots, and Lorella Angelini (NASA Goddard Space Flight Center) for contributing the original text of Sect. 3 and for numerous other suggestions and comments. We also thank Ian George and Lorella Angelini (NASA Goddard Space Flight Center) for contributing the text that formed the basis of Sect. 4 and Francois Ochsenbein (Observatoire Astronomique, Strasbourg) for valuable comments on that and other sections.The authors also thank the following for comments and suggestions: Lindsey Davis, Brian Glendenning, Doug Mink, Jonathan McDowell, Tim Pearson, Barry Schlesinger, William Thompson, Doug Tody, Francisco Valdes, and Don Wells.
The National Radio Astronomy Observatory is a facility of the (U.S.) National Science Foundation operated under cooperative agreement by Associated Universities, Inc.
The Australia Telescope is funded by the Commonwealth of Australia for operation as a National Facility managed by CSIRO.