The Flexible Image Transport System - FITS - was originally developed
in the late 1970s to enable the exchange of astronomical image data between
computers of different type, with different word lengths and different means
of expressing numerical values. Although the IEEE numerical formats have
been widely adopted by the computer industry during the past twenty years,
and in 1989 the FITS Standard was revised to utilize them, to this day computer
manufacturers have yet to agree upon a single standard for bit order.
In addition, independent of the numerical values themselves, a standard
is essential for expressing the relationship of the data to the
instrument with which they were obtained, to the position on the sky or
association with wavelength, or with other general descriptive information
that collectively constitutes the metadata for the observation.
FITS has evolved over the years, encompassing new and more complex data
structures in accord with the increasing sophistication of new astronomical
instruments, and providing support for much more than the "images''
implied by the name. Images, spectra, data cubes, text tables, and
binary tables are all supported, and with a variety of conventions in
nomenclature and structure these basic elements have been combined to
accommodate data spanning the range from digital (and digitized) images
to output from computational simulations. Moreover, FITS
has been immensely successful as a community-wide data
format standard. No other scientific community has had anything like the
success the astronomy community has had with FITS, and we are envied by
many other communities for this cohesiveness. We have a process for
amending and adding to the standard that assures broad community
participation, and although this sometimes makes the process of change
rather slow it helps to assure community support and compliance.
All major astronomical
software packages read and write FITS format data, and many have adopted
FITS not only for exchange with other programs and facilities, but as a
native run-time data format. The inherent inefficiencies of FITS (such
as sequential header records, which when the allocated space is filled and
a new header record is desired to be written, requires all following data
to be rewritten) have been offset by the tremendous improvements
in CPU and I/O efficiencies of modern desktop computers.
In 1987 NASA developed plans for the Astrophysics Data System, an
integrated approach to the management of data from all astrophysics
missions. Although much of the original plan for the ADS failed to
be realized (the current ADS abstract and bibliographic services
being a notable exception), the policy decision was reached that all
NASA astrophysics mission data sets should be made available to the
community in the FITS format. In 1989 the NASA/Science Office of
Standards and Technology - NOST - established the FITS Support Office
to assist mission data managers in formatting their data in FITS.
(Responsibility for the NASA FITS Support Office transitioned to the
Astrophysics Data Facility group at GSFC in 1995.) NOST
also commissioned the first of the FITS Technical Panels whose task was
to recast the FITS papers (published in Astronomy and Astrophysics
Supplements) into a form acceptable as an official NASA standard. The
first draft standard, NOST 100-0.1, was released in December 1990.
Since then there have been six revisions of the NOST standard, clarifying
ambiguities and adding new features with each version. The accompanying
paper represents NOST 100-2.0 and contains all FITS revisions and
extensions that have been approved by the IAU-FWG through the end of 1998.
The NOST Technical Panel was responsible for developing the standards
documents, making these available for public review and comment, and
then evaluating each comment received and making additional revisions
to the standard as necessary to address the comment. All comments and
the NOST Technical Panel reactions to them were posted on the Internet
and distributed by e-mail to all who submitted comments. This process
of open review and discussion was audited by the NOST Accreditation
Panel to assure that community input was open and unrestricted, and that
the Technical Panel was fully accountable to the community. Once
approved by the Accreditation Panel, the NOST FITS document becomes
the official NASA standard.
FITS is used world-wide in astronomy, and thus a NASA FITS standard is
not the final word. Recognizing the value-added of the NOST FITS
Technical Panel's work, however, the community has taken the NASA
standard as both a practical working document and has officially
endorsed it through regional and international organizations. There
are three regional FITS committees: the North American FITS Committee,
which is convened under the auspices of the Working Group on Astronomical
Software of the American Astronomical Society, the European FITS
Committee, and the Japanese FITS Committee. Changes to the FITS
standard are voted on in these committees and then forwarded for
review to the FITS Working Group of the International Astronomical
Union. The IAU FWG is the final voice of approval for revisions to
the standard.
The NOST Technical Panel worked hard to resolve all discrepancies between
the various FITS papers and to clarify all potentially ambiguous text.
Nevertheless, some areas of the document may still be unclear to some
readers or may be subject to misinterpretation. It is left to future
Technical Panels to continue the effort to refine and clarify the document.
These Technical Panels will also need to incorporate the results
of future FITS negotiations into the document, such as the anticipated
World Coordinate Systems (WCS) agreements (available at
http://www.cv.nrao.edu/fits/documents/wcs/).
The NOST 100-2.0 document was approved by all three of the regional
FITS Committees, without dissent, during 1999 and, in a vote taken on
12 October 2000, the IAU FITS Working Group adopted the following resolution,
without dissent:
The NASA/Science Office of Standards and Technology
(NOST) of the National Space Science Data Center (NSSDC)
of the National Aeronautics and Space Administration (NASA)
has been established to
serve the space science communities in evolving cost effective, interoperable
data systems. The NOST performs
a number of functions designed to facilitate
the recognition, development, adoption, and use of standards by the space
science communities.
Approval of a NOST standard requires verification by the NOST that the
following requirements have been met: consensus of the Technical
Panel, proper adjudication of the comments received
from the targeted space and Earth science community,
and conformance to the accreditation process.
A NOST standard represents the consensus of
the Technical Panel convened by the NOST.
Consensus is established when the NOST Accreditation
Panel determines that substantial agreement has been reached by the
Technical Panel. However, consensus does not necessarily imply
that all members were in
full agreement with every item in the standard. NOST standards are not
binding as published; however, they may serve as a basis for mandatory
standards when adopted by NASA or other organizations.
A NOST standard may be revised at any time, depending on
developments in the areas covered by the standard. Also, within five
years from the date of its issuance, this standard will be reviewed by
the NOST to determine whether it should
1) remain in effect without change,
2) be changed to reflect the impact of new technologies or new
requirements,
or 3) be retired or canceled.
The Technical Panel that developed this version of the standard consisted of the
following members:
[The references for this document have been moved to the end of the
article, in conformance with the editorial policies of the journal.
This section is retained in order to maintain consistency in section
numbering with the NASA Standard.]
A member of a data array or table corresponding to an
actual physical quantity.
4 FITS file organization
A FITS file shall be composed of the following FITS
structures , in the
order
listed:
- Primary HDU;
- Conforming Extensions
(optional);
- Other special records (optional).
Each FITS structure shall
consist of an integral number of FITS logical
records. The primary HDU shall start
with the first record of the
FITS file. The first record of each subsequent
FITS structure shall be
the record immediately
following the last record of the preceding FITS structure.
The size of a FITS logical record shall be 23040 bits,
corresponding to 2880 8-bit bytes.
The primary HDU and every extension
HDU shall consist of an
integral number of header records consisting of ASCII
text, which may be followed by an integral number of data records.
The first record of data shall be the record immediately following
the last record of the header.
The first component of a FITS file shall be the
primary
header. The primary header may, but need not be, followed by
a primary data
array. The presence or absence of a primary data
array shall be indicated by the values of the NAXIS
or NAXISn keywords
in the primary header (Sect. 5.4.1.1).
The header of a primary HDU shall consist of a
series of card images
in ASCII text. All header
records shall consist of 36 card images.
Card images without information
shall be filled with ASCII blanks (hexadecimal 20).
In FITS format, the primary data array shall consist of a
single data array of 0-999 dimensions.
The random groups convention in the primary data array is a
more complicated structure (see Sect. 7).
The data values shall be
a byte stream with no embedded fill or blank space.
The first value shall be in the first position of the first
primary data array record. The first value of each subsequent row of the
array shall be in the position immediately following the last
value of the previous row. Arrays of more than
one
dimension shall consist of a sequence such that the index along
axis 1 varies most rapidly, that along axis 2 next most rapidly, and
those along subsequent axes progressively less rapidly, with that
along axis m, where m is the value
of NAXIS ,
varying least rapidly; i.e., the elements of an array
shall be in the
order shown in
Fig. 1. The index count along each axis shall begin
with 1 and increment by 1 up to the value of
the NAXISn keyword (Sect. 5.4.1.1).
 |
Figure 1:
Arrays of more than one dimension shall consist of a sequence
such that the index along axis 1 varies most rapidly and
those along subsequent axes progressively less rapidly. Except
for the
location of the first element, array structure is independent of
record structure. |
| Open with DEXTER |
If the data array does not fill the final record, the
remainder of the record shall be filled by setting all bits to zero.
4.4.1 Requirements for conforming extensions
All extensions ,
whether or not further described in this standard, shall
fulfill the following requirements to be in conformance with
this FITS standard.
4.4.1.1. Identity.
Each extension
type
shall have a unique type name,
specified in the
header according to the syntax codified in Sect. 5.4.1.2.
To preclude conflict, extension type names must be
registered
with the IAUFWG.
The FITS Support Office shall
maintain and provide a list of the registered extensions.
The total number of bits in the data of each extension
shall be specified in the header for that extension, in the
manner prescribed in Sect. 5.4.1.2.
No extension shall be
constructed that invalidates existing FITS files.
A standard
extension shall be a
conforming
extension whose
organization and content are completely specified in this standard.
Only one FITS format
shall be approved for each type of data organization. Each
standard extension shall have a unique
name given by the value of the
XTENSION keyword (see Appendix .18).
An extension may follow the primary HDU
or another conforming
extension .
Standard
extensions
and other conforming extensions may appear
in any order
in a FITS file.
The first 8 bytes of special records must
not contain the string
"XTENSION''. It is recommended that they not contain the
string
"SIMPLE
''.
The records must have the standard FITS 23040-bit
record length. The contents of special records are not otherwise
specified by this standard.
4.6 Physical blocking
4.6.1 Bitstream devices
For bitstream devices, including but not restricted to
logical file systems,
FITS files shall be written with fixed blocks of a physical
block size equal to the 23040-bit FITS logical record size.
4.6.2.1. Fixed block.
For fixed block length sequential media, including but not restricted
to optical disks (accessed as a sequential set of records), QIC format
1/4-inch cartridge tapes, and local area networks, FITS files
shall be written as a bitstream, using the fixed block size
of the medium. If the end of the last logical record does not
coincide with the end of a physical fixed block, all bits in
the remainder of the physical block containing the last logical
record shall be set to zero. After an end-of-file mark has
been detected in the course of reading a FITS file,
subsequent incomplete FITS logical
records should be disregarded.
4.6.2.2. Variable block.
For variable block length sequential media, including
but not restricted to 1/2-inch 9-track tapes,
DAT 4 mm cartridge tapes, and 8 mm cartridge tapes,
FITS files may be written with an integer blocking factor
equal to 1-10 logical records per physical block.
5 Headers
Header card images
shall consist of a keyword, a value indicator (optional unless a value
is present), a value (optional), and a comment (optional). Except
where specifically stated otherwise
in this standard, keywords may appear in any order.
A formal syntax, giving a complete definition of the syntax of
FITS card images, is given in Appendix .1.
It is intended as an aid in interpreting the text defining the standard.
5.1.2.1. Keyword (bytes 1-8).
The keyword shall be a left justified, 8-character,
blank-filled, ASCII string with no embedded blanks. All
digits (hexadecimal 30 to 39,"0123456789'') and
upper case
Latin alphabetic characters
(hexadecimal 41 to 5A,
"ABCDEFG HIJKLMN OPQRST UVWXYZ'') are
permitted; no lower case characters shall be used. The
underscore
(hexadecimal 5F, "
'') and
hyphen
(hexadecimal 2D, "-'') are also permitted. No other characters
are permitted. For indexed
keywords with a single index
the counter shall not have leading zeroes.
5.1.2.2. Value indicator (bytes 9-10).
If this field contains the ASCII characters "=
'', it indicates the
presence of a value field associated with the keyword, unless it is
a commentary keyword as defined in
Sect. 5.4.2.4.
If the value indicator is not present or if it is a commentary keyword
then Cols. 9-80 may contain any ASCII text.
5.1.2.3. Value/comment (bytes 11-80).
This field, when used, shall contain the value, if any, of
the keyword, followed by optional comments.
The value field may be a null field; i.e., it may
consist entirely of spaces. If the value field is null, the
value associated with the keyword is undefined.
If a comment is present,
it must be preceded by a
slash (hexadecimal 2F, "/''). A
space between the value and the slash
is strongly recommended. The
value shall be the ASCII text representation of a string or
constant, in the format specified in Sect. 5.2.
The comment may contain any ASCII text.
5.2 Value
The structure of the value field shall be determined by the type
of the variable. The value field represents a single value and
not an array of values. The value field must be in one of two formats:
fixed or free .
The fixed format is required for values of
mandatory keywords
and recommended for values of all others. This standard imposes no
requirements on case sensitivity
of character strings
other than those explicitly specified.
5.2.1 Character string
If the value is a fixed format character string, Col. 11 shall
contain
a single quote (hexadecimal code 27, "'''); the string shall follow,
starting in Col. 12, followed by a closing single quote
(also hexadecimal code 27) that should not occur before Col. 20 and
must occur in or before Col. 80. The character string
shall be composed only of ASCII text.
A single quote is represented within a string as two successive
single quotes, e.g., O'HARA = 'O''HARA'. Leading blanks are
significant; trailing blanks are not.
Free format character strings follow the same rules as fixed format
character strings except that the starting and closing single quote
characters may occur anywhere within Cols. 11-80.
Any columns preceding the starting quote character and after
Col. 10 must contain the space character.
Note that there is a subtle distinction between the following 3 keywords:
KEYWORD1= '' / null string keyword
KEYWORD2= ' ' / blank keyword
KEYWORD3= / undefined keyword
The value of KEYWORD1 is a null, or zero length string whereas the
value of the KEYWORD2 is a blank string (nominally a single blank
character because the first blank in the string is significant, but
trailing blanks are not). The value of KEYWORD3 is undefined and has
an indeterminate datatype as well, except in cases where the data type
of the specified keyword is explicitly defined in this standard.
The maximum allowed length of a keyword string is 68 characters (with
the opening and closing quote characters in Cols. 11 and 80,
respectively). In general, no length limit less than 68 is implied
for character-valued keywords.
5.2.2 Logical
If the value is a fixed format logical constant, it shall appear as a
T or F in Col. 30.
A logical value is represented in free format by a single character
consisting of T or F. This character must be the first
non-blank character in Cols. 11-80. The only characters that
may follow this single character are spaces, or a slash followed by an
optional comment (see Sect. 5.1.2.3).
5.2.3 Integer number
If the value is a fixed format integer, the ASCII representation shall
be right justified in columns 11-30. An integer consists of a
"+'' (hexadecimal 2B) or "-'' (hexadecimal 2D) sign, followed by one or more ASCII digits
(hexadecimal 30 to 39), with no embedded spaces. The leading "+'' sign is optional.
Leading zeros are permitted, but are not
significant. The integer representation described here is always interpreted as a signed,
decimal number.
A free format integer value follows the same rules as fixed format integers
except that it may occur anywhere within Cols. 11-80.
5.2.4 Real floating point number
If the value is a fixed format real floating point number,
the ASCII
representation shall appear, right justified, in Cols. 11-30.
A floating point number is represented by
a decimal number followed by an optional exponent, with no embedded spaces.
A decimal number consists of a "+'' (hexadecimal 2B) or "-''
(hexadecimal 2D) sign, followed by a sequence of ASCII digits
containing a single decimal point (".''), representing an integer part
and a fractional part of the floating point number. The leading "+''
sign is optional.
At least one of the integer part or fractional part must be present. If
the fractional part is present, the decimal point must also be present.
If only the integer part is present, the decimal point may be omitted.
The exponent, if present, consists of an exponent letter
followed by an integer.
Letters in the exponential form ("E'' or "D'') shall be upper case.
Note: the full precision of 64-bit values cannot
be expressed over the whole range of values using the fixed format.
A free format floating point value follows the same rules as fixed format
floating point values except that it may occur anywhere within Cols. 11-80.
5.2.5 Complex integer number
There is no fixed format for complex integer numbers.
If the value is a complex integer number, the value must be
represented as a real part and an imaginary part,
separated by a comma and enclosed in parentheses. Spaces may precede
and follow the real and imaginary parts. The real and imaginary
parts are represented as integers (Sect. 5.2.3).
Such a representation is
regarded as a single value for the complex integer number. This
representation may be located anywhere within Cols. 11-80.
5.2.6 Complex floating point number
There is no fixed format for complex floating point numbers.
If the value is a complex floating point number, the value must be
represented as a real part and an
imaginary part,
separated by a comma and enclosed in parentheses. Spaces may precede
and follow the real and imaginary parts. The real and imaginary
parts are represented as floating point values (Sect. 5.2.4).
Such a representation is
regarded as a single value for the complex floating point number. This
representation may be located anywhere within Cols. 11-80.
5.3 Units
The units of all FITS header keyword values,
with the exception of
measurements of angles, should
conform with the recommendations in the
IAU Style Manual
(McNally 1988). For angular measurements given as
floating point values and specified with reserved keywords, degrees are the
recommended units (with the units, if specified,
given as 'deg').
5.4 Keywords
Mandatory keywords are required in every HDU as
described in the remainder of this subsection. They may be used only as
described in this standard. Values of the mandatory keywords must be written in fixed format.
The SIMPLE keyword is
required to be the first keyword in the primary
header of all FITS files. Principal mandatory keywords other
than SIMPLE are
required in all FITS headers.
The card images of any primary header must contain the keywords
shown in Table 1 in the
order
given. No other keywords may intervene between
the SIMPLE keyword and the last NAXISn keyword.
Table 1:
Mandatory keywords for primary header.
| 1 |
SIMPLE |
| 2 |
BITPIX |
| 3 |
NAXIS |
| 4 |
NAXISn, n = 1, ..., NAXIS |
| |
|
| |
(other keywords) |
| |
|
| last |
END |
The total number of bits in the primary data array,
exclusive of fill that is needed after the data to complete the last record
(Sect. 4.3.2), is given by the
following expression:
 |
= |
 |
(1) |
where
is
non-negative and the number of bits excluding fill,
m is the value of NAXIS, and
BITPIX and the NAXISn represent
the values associated with those keywords.
The value field shall contain a logical constant with the
value T if the file conforms to this standard.
This keyword is mandatory for the primary
header and is not permitted in extension headers. A value
of F signifies that the file does not
conform to this standard.
The value field shall contain an integer. The
absolute value is used
in computing the sizes of data structures. It shall specify
the number of bits that represent a data value. The only valid values
of BITPIX are given in Table 2.
Table 2:
Interpretation of valid BITPIX value.
| Value |
Data Represented |
| 8 |
Character or unsigned binary integer |
| 16 |
16-bit twos-complement binary integer |
| 32 |
32-bit twos-complement binary integer |
| -32 |
IEEE single precision floating point |
| -64 |
IEEE double precision floating point |
The value field shall contain a non-negative integer no greater than
999, representing the number of axes in the associated data
array. A value of zero signifies that no data follow the
header in the HDU.
NAXISn keywords.
The value field of this indexed keyword
shall contain a non-negative
integer, representing the number of elements along axis n of
a data array. The NAXISn must be present
for all values n = 1,...,NAXIS, and for no other values of
n. A value of zero for any of
the NAXISn signifies that no data follow the
header in the HDU. If NAXIS is equal to 0,
there should not be any NAXISn keywords.
This keyword has no associated value. Columns 9-80
shall be filled with ASCII blanks.
All conforming extensions must use the
keywords defined in Table 3
in the order
specified. No other keywords may intervene between
the XTENSION keyword and the last NAXISn keyword.
This organization is required for any conforming extension,
whether or not further specified in this standard.
Table 3:
Mandatory keywords in conforming extensions.
| 1 |
XTENSION |
| 2 |
BITPIX |
| 3 |
NAXIS |
| 4 |
NAXISn, n = 1, ..., NAXIS |
| |
|
| |
(other keywords, including ...) |
| |
PCOUNT |
| |
GCOUNT |
| |
|
| last |
END |
The total number of bits in the extension data array
exclusive of fill that is needed after the data to complete the last record
such as that for the primary data array
(Sect. 4.3.2) is given by the
following expression:
where
is
non-negative and the number of bits excluding fill,
m is the value of NAXIS, and
BITPIX, GCOUNT,
PCOUNT, and the NAXISn
represent
the values associated with those keywords.
The value field shall contain a character string
giving
the name of the extension type.
This keyword is
mandatory for an extension header and must not appear
in the primary header .
For an extension that is not a
standard extension, the type name must not
be the same as that of a standard extension.
The IAUFWG may specify additional
type names that must be used only to identify
specific types of extensions; the full list shall be available from
the FITS Support Office.
The value field shall contain an integer that shall be
used in any way appropriate to define the data structure,
consistent with Eq. (2).
The value field shall contain an integer that shall be
used in any way appropriate to define the data structure,
consistent with Eq. (2).
EXTEND keyword.
The use of
extensions necessitates
a single additional keyword in the
primary header of the FITS file.
If the FITS file may contain extensions,
a card image
with the keyword EXTEND and the value field containing the
logical value T must appear in the primary header
immediately after the last NAXISn
card image, or, if
NAXIS=0, the NAXIS card image.
The presence of this keyword with the value T in the
primary header does not require that extensions be present.
5.4.2 Other reserved keywords
These keywords are optional but
may be used only as defined in this standard.
They apply to any FITS
structure
with the meanings and restrictions defined below.
Any FITS structure may further restrict the use of
these keywords.
5.4.2.1. Keywords describing the history or physical
construction of the HDU
Starting January 1, 2000, the following format shall be used.
FITS writers should commence writing the value of
the DATE keyword
in this format starting January 1, 1999 and before January 1, 2000.
The value field shall contain a character
string giving
the date on which the HDU was created,
in the form YYYY-MM-DD, or the date and time when the HDU was
created, in the form YYYY-MM-DDThh:mm:ss[.sss...],
where YYYY shall be the four-digit calendar year number,
MM the two-digit month number
with January given by 01 and December by 12,
and DD the two-digit day of the month. When both date and time
are given, the literal T shall separate the date and time,
hh shall be the two-digit hour in the day,
mm the two-digit number of minutes after the
hour, and ss[.sss...] the number of
seconds (two digits followed by an optional fraction) after the
minute. No fields may be defaulted and no leading zeroes
omitted. The decimal part of the seconds field is optional and may be
arbitrarily long, so long as it is consistent with the rules for
value formats of Sect. 5.2.
The value of the DATE keyword shall always
be expressed in UTC when in this format, for all data sets created on earth.
The following format may appear on files written before
January 1, 2000. The value field contains a character
string giving the date
on which the HDU was created, in the form DD/MM/YY,
where DD is the day of the month,
MM the month number
with January given by 01 and December by 12, and YY
the last two digits of the year, the first two digits being
understood to be 19. Specification of the date
using Universal Time is
recommended but not assumed.
Copying of a FITS file does not require changing
any of the keyword values in the file's HDUs.
The value field shall contain a character
string
identifying the organization or institution responsible for
creating the FITS file.
This keyword may be used only in the primary header.
It shall appear within the
first 36 card images of the FITS file.
(Note: this keyword thus cannot appear if NAXIS is
greater than 31, or if NAXIS is greater than 30 and the
EXTEND keyword is present.)
Its presence with the required logical value of T advises that
the physical block size of the FITS file on which it
appears may be an integral multiple of the logical record length,
and not necessarily equal to it.
Physical block size and logical record length may be
equal even if this keyword is present or unequal if it
is absent. It is reserved primarily to prevent its use
with other meanings. Since the issuance of version 1 of this standard,
the BLOCKED keyword has been
deprecated .
5.4.2.2. Keywords describing observations
The format of the value field for DATE-OBS keywords
shall follow the prescriptions for the DATE
keyword (Sect. 5.4.2.1). Either the 4-digit year format or
the 2-digit year format may be used for observation dates from 1900
through 1999 although the 4-digit format is preferred.
When the format with a four-digit year is used,
the default interpretations for time shall be
UTC for dates beginning 1972-01-01 and UT
before. Other date and time scales are permissible. The value of
the DATE-OBS keyword shall be expressed in the principal time
system or time scale of the HDU
to which it belongs; if there is any
chance of ambiguity, the choice shall be clarified in comments.
The value of DATE-OBS shall be
assumed to refer to the start of an observation, unless another
interpretation is clearly explained in the comment field.
Explicit specification of the time scale is recommended.
By default, times for TAI and times that run simultaneously with TAI,
e.g., UTC and TT, will be assumed to be as measured at the detector
(or, in practical cases, at the observatory). For coordinate times
such as TCG, TCB, and TDB which are tied to an unambiguous coordinate
system, the default shall be time as if the observation had taken place
at the origin of the coordinate time system. Conventions
may be developed that use other time systems. Appendix .11
of this document contains the appendix to the agreement
on a four digit year, which discusses time systems in some detail.
When the value of DATE-OBS is expressed in the two-digit year
form, allowed for files
written before January 1, 2000 with a year in the range 1900-1999,
there is no default assumption as to whether it refers to the start,
middle or end of an observation.
The value fields for all keywords beginning with the string DATE
whose value contains date, and optionally time, information
shall follow the prescriptions for the DATE-OBS
keyword.
The value field shall contain a character
string
identifying the telescope used to acquire the data
associated with the header.
The value field shall contain a character
string
identifying the instrument used to acquire the data
associated with the header.
The value field shall contain a character string
identifying who acquired the data associated with the header.
The value field shall contain a character
string
giving a name for the object observed.
The value field shall contain a floating point number
giving the equinox in years for the celestial
coordinate system
in which positions are expressed.
The value field shall contain a floating point number
giving the equinox in years for the celestial
coordinate system
in which positions are expressed.
Starting with Version 1, this standard has
deprecated the use of the EPOCH
keyword and thus it shall not be used in FITS files
created after the adoption of this standard; rather, the
EQUINOX keyword shall be used.
The value field shall contain a character
string
identifying who compiled the information
in the data associated with the header. This keyword
is appropriate when the data originate in a published
paper or are compiled from many sources.
The value field shall contain a character
string
citing a reference where the data associated with the
header are published.
5.4.2.4. Commentary keywords
This
keyword shall have no associated value ;
Cols. 9-80 may contain any ASCII text.
Any number of COMMENT card images may appear in a header.
This keyword shall have no associated value ;
Cols. 9-80 may contain any ASCII text.
The text should
contain a history of steps and procedures associated
with the processing of the associated data.
Any number of HISTORY card images may appear in a header.
Columns 1-8 contain ASCII blanks. Columns 9-80 may contain any
ASCII text.
Any number of card images with blank keyword fields
may appear in a header.
5.4.2.5. Array keywords.
These keywords are used to describe the contents of an
array, either alone or in a series of
random groups (Sect. 7).
They are optional, but if they appear in the header describing
an array or groups, they must be used as defined in this
section of this standard. They shall not be used in headers
describing other structures unless the meaning is the same
as that for a primary or groups array.
This keyword shall be used, along with the BZERO
keyword, when the array pixel values are not the true
physical values, to transform the
primary data array values to
the true physical values they represent, using Eq. (3).
The value field shall contain a floating point number representing the
coefficient of the linear term in the scaling equation, the
ratio of physical value to array value
at zero offset. The default value for this keyword is 1.0.
This keyword shall be used, along with the BSCALE
keyword, when the array pixel values are not the true
physical values, to transform the primary data array values to
the true values. The value field shall contain a floating
point number representing the physical value
corresponding to an array value of zero. The default value for this
keyword is 0.0.
The transformation equation is as follows:
 |
= |
 |
(3) |
The value field shall contain a character
string ,
describing the physical units in which the quantities
in the array, after application of BSCALE
and BZERO,
are expressed. These units must follow the
prescriptions of Sect. 5.3.
This keyword shall be used only in headers with
positive values of BITPIX
(i.e., in arrays with integer data).
Columns 1-8 contain the string, "BLANK
'' (ASCII blanks in
Cols. 6-8).
The value field shall contain an integer that
specifies the representation of array values
whose physical values are undefined.
The value field shall contain a character
string, giving
the name of the coordinate
represented by axis n.
The value field shall contain a floating point number ,
identifying the location of a reference point
along axis n,
in units of the axis index.
This value is based upon a counter that runs
from 1 to NAXISn with an increment of 1 per pixel.
The reference point value need not be that for the center of a pixel
nor lie within the actual data array. Use comments to indicate
the location of the index point relative to the pixel.
The value field shall contain a floating point number ,
giving the value of the coordinate
specified by the CTYPEn
keyword at the reference
point CRPIXn. Units must follow the
prescriptions of Sect. 5.3.
The value field shall contain a floating point number
giving the partial derivative of the coordinate specified
by the CTYPEn keywords with respect to the pixel
index, evaluated at the reference
point CRPIXn, in units of the
coordinate specified by the CTYPEn keyword.
These units must follow the
prescriptions of Sect. 5.3.
This keyword is used to indicate a rotation from a
standard coordinate system
described by the CTYPEn to
a different coordinate system in which the values in the
array are actually expressed. Rules for such rotations are
not further specified in this standard; the rotation should
be explained in comments. The value field shall contain
a floating point number giving the rotation angle
in degrees between
axis n and the direction implied by the coordinate system
defined by CTYPEn.
The value field shall always contain a floating point
number, regardless of the value of BITPIX. This
number
shall give the maximum valid physical value
represented by the array, exclusive of any
special values.
The value field shall always contain a floating point
number, regardless of the value of BITPIX. This
number shall give the minimum valid physical value represented
by the array, exclusive of any special values.
These keywords are used to describe an extension
and should not appear in the primary header.
The value field shall contain a character
string, to be
used to distinguish
among different extensions of the same
type, i.e., with the same value of XTENSION,
in a FITS file.
The value field shall contain an integer, to be used to
distinguish among different extensions in a FITS file
with the same type and name, i.e., the same values for
XTENSION and EXTNAME. The
values need not start with 1 for the first extension with
a particular value of EXTNAME and need not be in
sequence for subsequent values. If the EXTVER keyword
is absent, the file should be treated as if the value
were 1.
The value field shall contain an integer, specifying the
level in a hierarchy of extension levels of the extension
header containing it. The value shall be 1 for the highest
level; levels with a higher value of this keyword shall be
subordinate to levels with a lower value. If the EXTLEVEL
keyword is absent, the file should be treated as if the
value were 1.
New keywords
may be devised in addition to those
described in this standard, so long as they are consistent
with the generalized rules for keywords and do not conflict
with mandatory or reserved keywords.
No keyword in the primary header shall specify
the
presence of a specific extension in
a FITS file; only the EXTEND keyword
described in Sect. 5.4.1.2 shall be
used
to indicate the possible presence of extensions. No keyword
in either the primary or extension header shall explicitly
refer to the physical block size, other than the
deprecated BLOCKED
keyword of Sect. 5.4.2.1.
6 Data representation
Primary and extension data shall be
represented in one of the formats
described in this section. FITS data shall be interpreted to
be a byte stream. Bytes are in order
of decreasing significance.
The byte that includes the sign bit
shall be first, and the byte
that has the ones bit shall be last.
Each character shall be represented by
one byte. A character
shall be represented by its 7-bit ASCII (ANSI 1977) code in the low order
seven bits in the byte. The high-order bit shall be zero.
Eight-bit integers shall be unsigned binary integers, contained
in one byte.
Sixteen-bit integers shall be twos-complement
signed binary
integers, contained in two bytes.
Thirty-two-bit integers shall be
twos-complement
signed
binary integers, contained in four
bytes.
6.2.4 Unsigned integers
Unsigned sixteen-bit integers can be represented in FITS files by
subtracting 32768 from each value (thus offsetting the values into the range
of a signed sixteen-bit integer) before writing them to the FITS file.
The BZERO keyword (or the TZEROn keyword in the case of binary
table columns with TFORMn = 'I') must also be included in the header
with its value set to 32768 so that FITS reading software will add this
offset to the raw values in the FITS file, thus restoring them to the
original unsigned integer values. Unsigned thirty-two-bit integers can be
represented in FITS files in a similar way by applying an offset of
2147483648 (231) to the data values.
Transmission of 32- and 64-bit floating
point data within the FITS
format shall use the ANSI/IEEE-754 standard (IEEE 1985).
BITPIX = -32 and
BITPIX = -64 signify 32- and 64-bit IEEE floating
point
numbers, respectively; the absolute value of BITPIX
is
used for computing the sizes of data structures. The full
IEEE set of number forms is allowed for FITS
interchange, including all special
values.
The BLANK keyword
should not be used when BITPIX = -32 or
-64; rather, the IEEE NaN should be used to represent an
undefined value. Use of the BSCALE and BZERO
keywords is not recommended.
Appendix .15 has additional details on the IEEE format.
7 Random groups structure
Although it is standard FITS, the random groups
structure
has been used almost exclusively for applications in
radio
interferometry; outside this field, few FITS readers can read
data in random groups format. The binary table
extension (Sect. 8.3)
can accommodate the structure described by random groups. While
existing FITS files use the format, and it is therefore
included in this standard, its use for future applications
has been deprecated since
the issue of Version 1 of this standard.
7.1 Keywords
The SIMPLE keyword is
required to be the first keyword in the primary
header of all FITS files, including those with random
groups records. If the random groups format
records follow the primary header, the card
images of the primary header must use the keywords
defined in Table 4 in the
order
specified. No other keywords may intervene between
the SIMPLE keyword and the last NAXISn keyword.
Table 4:
Mandatory keywords in primary header preceding random groups.
| 1 |
SIMPLE |
| 2 |
BITPIX |
| 3 |
NAXIS |
| 4 |
NAXIS1 |
| 5 |
NAXISn, n=2, ..., value of NAXIS |
| |
|
| |
(other keywords, which must include ...) |
| |
GROUPS |
| |
PCOUNT |
| |
GCOUNT |
| |
|
| last |
END |
The total number of bits in the random groups records
exclusive of the fill described in Sect. 7.2 is
given by the following
expression:
where
is
non-negative and the number of bits excluding fill,
m is the value of NAXIS, and
BITPIX, GCOUNT,
PCOUNT, and the NAXISn
represent
the values associated with those keywords.
The card image containing this keyword is structured in
the same way as if a
primary data array
were present (Sect. 5.4.1).
The card image containing this keyword is structured as
prescribed in
Sect. 5.4.1.
The value field shall contain an integer ranging from 1 to
999, representing one more than the number of axes in each
data array.
The value field shall contain the integer 0, a signature of
random groups format indicating that there is
no primary data array.
The value field shall contain an integer, representing
the number of positions along axis n-1 of the
data array in each group.
The value field shall contain the logical constant T.
The
value T associated with this keyword implies that random groups
records are present.
The value field shall contain an integer equal to the
number
of parameters preceding each array in a group.
The value field shall contain an integer equal to the
number of random groups present.
The card image containing this keyword is structured as described
in Sect. 5.4.1.
7.1.2 Reserved keywords
7.1.2.1. PTYPEn keywords.
The value field shall contain a character string
giving
the name of parameter n. If the PTYPEn
keywords for more than one value of n have the same associated
name in the value field, then the data value for the parameter
of that name is to be obtained by adding the derived data values
of the corresponding parameters. This rule provides a mechanism by
which a random parameter may have more precision than the
accompanying data array elements; for example, by summing two 16-bit
values with the first scaled relative to the other such that the
sum forms a number of up to 32-bit precision.
7.1.2.2. PSCALn keywords.
This keyword shall be used, along
with the PZEROn
keyword, when the
FITS group parameter
value is not the true
physical value , to transform the
group parameter value to the true physical values it represents,
using Eq. (5).
The value field shall contain a floating point number representing
the coefficient of the linear term in Eq. (5), the scaling
factor between true values and group parameter values
at zero offset. The default value for this keyword is 1.0.
7.1.2.3. PZEROn keywords.
This keyword shall be used, along
with the PSCALn keyword, when
the nth FITS group parameter
value is not the true physical
value, to transform the group parameter value to the physical value.
The value field shall contain a floating point number,
representing the true value corresponding to a group
parameter value of zero. The default value for this keyword is 0.0.
The transformation equation is as follows:
7.2 Data sequence
Random groups data shall consist of a set of groups. The number of
groups shall be specified by the GCOUNT keyword in the associated
header record. Each group shall consist of the number
of
parameters specified by the PCOUNT
keyword followed by an array with the number of
elements
given
by the following
expression:
= |
(6) |
where
is the number of elements in the data array in a group,
m is the value of NAXIS,
and the NAXISn represent
the values associated with those keywords.
The first parameter of the first group shall appear in the first
location of the first data record. The first element of each array shall
immediately follow the last parameter associated with that group.
The first parameter of any subsequent group shall immediately follow
the last element of the array of the previous group. The arrays shall
be organized internally in the same way as an
ordinary primary data array.
If the groups data do not fill the final record, the remainder
of the record shall be filled with zero values in the same
way as a primary data array (Sect. 4.3.2).
If random groups records are present, there shall be no primary data
array.
Permissible data representations are those listed in
Sect. 6. Parameters and elements
of associated data
arrays shall have the same representation. Should more precision
be required for an associated parameter than for an element of a data
array, the parameter shall be divided into two or more
addends, represented
by the same value for the PTYPEn keyword.
The value shall be the sum of the physical values ,
which may have been obtained
from the group parameter values
using
the PSCALn and PZEROn keywords.
8 Standard extensions
8.1 The ASCII table extension
Data shall
appear as an ASCII table
extension if the primary
header of the FITS file has the keyword
EXTEND set to T and the first
keyword of that extension
header has XTENSION=
![\includegraphics[width=3mm,clip]{espace.eps}](/articles/aa/full/2001/34/aah2901/img1.gif)
'TABLE
![\includegraphics[width=3mm,clip]{espace.eps}](/articles/aa/full/2001/34/aah2901/img1.gif)
'.
8.1.1 Mandatory keywords
The header of an ASCII table
extension must use the keywords defined in Table 5.
The first keyword must be XTENSION;
the seven keywords following XTENSION (BITPIX ...
TFIELDS) must be in the
order specified
with no intervening keywords.
Table 5:
Mandatory keywords in ASCII table extensions.
| 1 |
XTENSION |
| 2 |
BITPIX |
| 3 |
NAXIS |
| 4 |
NAXIS1 |
| 5 |
NAXIS2 |
| 6 |
PCOUNT |
| 7 |
GCOUNT |
| 8 |
TFIELDS |
| |
|
| |
(other keywords, which must include ...) |
| |
TBCOLn, n=1, 2, ..., k where k is the value |
| |
of TFIELDS |
| |
TFORMn, n=1, 2, ..., k where k is the value |
| |
of TFIELDS |
|
|
| last |
END |
The value field shall contain the
character string value text 'IMAGE
'
The value field shall contain the integer 8, denoting
that the array contains ASCII characters.
The value field shall contain the integer 2, denoting
that the included data array is two-dimensional: rows and
columns.
The value field shall contain a non-negative integer,
giving
the number of ASCII characters in each row of the table.
The value field shall contain a non-negative integer,
giving
the number of rows in the table.
The value field shall contain the integer 0.
The value field shall contain the integer 1; the data
records contain a single table.
The value field shall contain a non-negative integer
representing
the number of fields in each row. The maximum
permissible value is 999.
The value field of this indexed keyword shall contain an
integer
specifying the column in which field n starts.
The first column of a row is numbered 1.
The value field of this indexed keyword
shall contain a character string describing the format in
which field n is encoded. Only the formats
in Table 6, interpreted as ANSI FORTRAN-77 (ANSI 1978)
input formats and discussed in more detail in
Sect. 8.1.5, are permitted for encoding. Format
codes must be specified in upper case. Other format
editing codes common to ANSI FORTRAN-77 such as repetition, positional
editing, scaling, and field termination are not permitted. All values
in numeric fields have a number base of ten (i.e., they are decimal);
binary, octal, hexadecimal, and other representations are not
permitted.
Table 6:
Valid TFORMn format values in TABLE extensions.
| Field Value |
Data Type |
| Aw |
Character |
| Iw |
Decimal integer |
| Fw.d |
Single precision real |
| Ew.d |
Single precision real, exponential notation |
| Dw.d |
Double precision real, exponential notation |
This keyword has no associated value. Columns 9-80
shall contain ASCII blanks.
8.1.2 Other reserved keywords
In addition to the mandatory keywords
defined in Sect. 8.1.1,
the following keywords may be used to describe the structure of an
ASCII table data array. They are optional, but if they
appear within an ASCII table extension header, they must
be used as defined in this section of this standard.
This indexed keyword shall be used, along with the TZEROn
keyword, when the quantity in field n does not
represent a true physical quantity. The value
field shall contain a floating point number
representing the coefficient of the linear term in
Eq. (7), which must be used
to compute the true physical value of
the field. The default value for this keyword is 1.0.
This keyword may not be used for A-format fields.
This indexed keyword shall be used, along with the TSCALn keyword,
when the quantity in field n does not represent a
true
physical quantity. The value field shall contain a
floating point number representing the zero point
for the true physical value of field n. The default
value for this keyword is 0.0. This keyword may
not be used for A-format fields.
The transformation equation used to compute a true
physical value from the quantity in field n is
= |
(7) |
The value field for this indexed keyword shall contain
the character
string that represents
an undefined value for field n.
The string is implicitly blank filled to the width of the field.
The value field for this indexed keyword shall contain a
character string, giving the name of field n. It is recommended
that only letters, digits, and
underscore (hexadecimal code 5F, "_'')
be used in the name. String comparisons with the values
of TTYPEn keywords should not be case sensitive.
The use of identical names for
different fields should be avoided.
The value field shall contain a character
string describing the physical units
in which the quantity in field
n, after any application of TSCALn
and TZEROn, is expressed. Units must follow the
prescriptions in Sect. 5.3.
The table is constructed from a two-dimensional array of
ASCII characters.
The row length and the number of rows shall be those specified,
respectively, by the NAXIS1
and NAXIS2 keywords
of the associated header records. The
number of characters in a row and the number of rows in the
table shall determine the size of the character array. Every row
in the array shall have the same number of characters. The
first character of the first row shall be at the start of the record
immediately following the last header record. The first
character of subsequent rows shall follow immediately the
character at the end of the previous row,
independent of the record structure. The positions in the last
data record after the last character of the last row of the data
array shall be filled with ASCII blanks.
Each row in the array shall consist of a sequence of fields,
with one entry in each field. For every field, the ANSI FORTRAN-77
format of the
information contained, location in the row of the beginning of the
field and (optionally) the field name, shall
be specified in keywords of the associated header records. A
separate format keyword must be provided for each field. The
location and format of fields shall be the same for every row.
Fields may overlap. There may be characters in a table
row that are not included in any field.
8.1.5 Entries
All data in an ASCII table extension field shall
be ASCII text in a format that conforms to the
rules for fixed field input in ANSI
FORTRAN-77 (ANSI 1978) format, as described below,
including implicit decimal points.
The only possible formats shall be those specified
in Table 6. If values of -0 and +0 must be
distinguished, then the sign character should
appear in a separate field in character format.
TNULLn keywords may be used
to specify a character
string that represents
an undefined value in each field. The
characters representing an undefined value may differ from field
to field but must be the same within a field.
Writers of ASCII tables should select a format appropriate to the
form, range of values, and accuracy of the data in the table.
The value of a character-formatted (Aw) field is a
character string of width w containing the characters in columns
TBCOLn through TBCOLn
.
The value of an integer-formatted (Iw) field is an
integer number determined by removing all blanks from columns
TBCOLn through TBCOLn
and
interpreting the remaining, right-justified characters as a signed
decimal integer. A blank field has value 0. All characters other
than blanks, the decimal integers ("0'' through "9'')
and a single leading sign character ("+'' and "-'') are
forbidden.
The value of a real-formatted field (Fw.d,
Ew.d, Dw.d) is a real number determined
from the w characters from columns TBCOLn through
TBCOLn
.
The value is formed by
- 1.
- Discarding all blank characters and right-justifying the
non-blank characters;
- 2.
- Interpreting the first non-blank characters as a numeric
string consisting of a single optional sign ("+'' or
"-'') followed by one or more decimal digits
("0'' through "9'') optionally containing
a single decimal point (".''). The numeric string
is terminated by the end of the right-justified field or
by the occurrence of any character other than a decimal
point (".'') and the decimal integers ("0''
through "9''). If
the string contains no explicit decimal point, then the
implicit decimal point is taken as immediately preceding
the rightmost d digits of the string, with
leading zeros assumed if necessary;
- 3.
- If the numeric string is terminated by a
- (a)
- "+'' or "-'', interpreting the following
string as an exponent in the form of a signed decimal
integer, or
- (b)
- "E'', or "D'', interpreting the following
string as an exponent of the form E or D
followed by an optionally signed decimal integer
constant;
- 4.
- The exponent string, if present, is terminated by
the end of the right-justified string;
- 5.
- Characters other than those specified above are forbidden.
The numeric value of the table field is then the value of the numeric
string multiplied by ten (10) to the power of the exponent string,
i.e.,
value = numeric_string
.
The
default exponent is zero and a blankfield has value zero. There is
no difference between the F, D, and E formats; the
content of the string determines its interpretation. Numbers
requiring more precision and/or range than the local computer can
support may be represented. It is good form to specify a D
format in TFORMn for a column of an ASCII table when that
column will contain numbers that cannot be accurately represented in
32-bit IEEE binary format (see Appendix .15).
Note that the above definitions allow for embedded blanks anywhere in
integer-formatted and real-formatted fields and implicit decimal
points in real-formatted fields. FITS reading tasks will
have to honor these flexibilities. However, since these
flexibilities are likely to cause confusion and possible
misinterpretation, it is recommended that FITS writing tasks
write tables with explicit decimal points and no embedded or trailing
blanks whenever possible.
8.2 Image extension
Data
shall appear as an
image extension if the primary header
of the FITS file has the keyword EXTEND
set to T and the first
keyword of that extension header
has
XTENSION=
'
IMAGE+
'.
8.2.1 Mandatory keywords
The XTENSION keyword is required to be the first keyword of
all image extensions.
The card images in the header of an image
extension must use the keywords defined in Table 7
in the order specified. No other keywords may intervene between the
XTENSION and GCOUNT keywords.
Table 7:
Mandatory keywords in image extensions.
| 1 |
XTENSION |
| 2 |
BITPIX |
| 3 |
NAXIS |
| 4 |
NAXISn, n = 1, ..., NAXIS |
| 5 |
PCOUNT |
| 6 |
GCOUNT |
| |
|
| |
(other keywords ...) |
| |
|
| last |
END |
The value field shall contain the
character string value text
'IMAGE
'.
The value field shall contain an integer. The
absolute value is used
in computing the sizes of data structures. It shall specify
the number of bits that represent a data value. The only valid values
of BITPIX are given in Table 2.
The value field shall contain a non-negative integer no greater than
999, representing the number of axes in the associated data
array. A value of zero signifies that no data follow the
header in the image extension.
NAXISn keywords.
The value field of this indexed keyword shall contain a non-negative
integer, representing the number of elements along axis n of
a data array. The NAXISn must be present
for all values n = 1, ..., NAXIS, and for no other values of
n. A value of zero for any of
the NAXISn signifies that no data follow the
header in the image extension.
If NAXIS is equal to 0,
there should not be any NAXISn keywords.
The value field shall contain the integer 0.
The value field shall contain the integer 1; each
image extension contains a single array.
This keyword has no associated value. Columns 9-80
shall be filled with ASCII blanks.
The units of all header keyword values in an
image extension shall follow the
prescriptions in Sect. 5.3.
The data format shall be identical to that of a primary data array
as described in Sect. 4.3.2.
8.3 Binary table extension
Data shall
appear as a binary table extension if the primary
header of the FITS file has the keyword
EXTEND set to T and the first keyword of
that extension
header has XTENSION=
'
BINTABLE'.
8.3.1 Mandatory keywords
The XTENSION keyword is the first keyword of all binary
table extensions. The seven keywords
following (BITPIX ...TFIELDS)
must be in the order specified in Table 8, with no
intervening keywords.
Table 8:
Mandatory keywords in binary table extensions.
| 1 |
XTENSION |
| 2 |
BITPIX |
| 3 |
NAXIS |
| 4 |
NAXIS1 |
| 5 |
NAXIS2 |
6 |
PCOUNT |
| 7 |
GCOUNT |
| 8 |
TFIELDS |
| |
|
| |
(other keywords, which must include ...) |
| |
TFORMn, n=1, 2, ..., k where k is the value |
| |
of TFIELDS |
| |
|
| last |
END |
The value field shall contain the
character string 'BINTABLE'.
The value field shall contain the integer 8, denoting
that the array is an array of 8-bit bytes.
The value field shall contain the integer 2, denoting
that the included data array is two-dimensional: rows and
columns.
The value field shall contain a non-negative integer,
giving
the number of 8-bit bytes in each row of the table.
The value field shall contain a non-negative integer,
giving
the number of rows in the table.
The value field shall contain the number of bytes
that follow the table in the associated extension data.
The value field shall contain the integer 1; the data
records contain a single table.
The value field shall contain a non-negative integer
representing
the number of fields in each row. The maximum
permissible value is 999.
The value field of this indexed keyword shall contain a
character string of the form rTa.
The repeat count r is
the ASCII representation of a non-negative integer
specifying the number of elements in field n.
The default value of r is 1; the repeat count need not be present
if it has the default value. A zero element count, indicating an
empty field, is permitted.
The data type T specifies the data type of the contents of field n. Only the data types in Table 9 are permitted.
The format codes must be specified in upper case. For
fields of type P, the only permitted repeat counts are 0 and 1. The
additional characters a are optional and are not further defined
in this standard. Table 9 lists the number of bytes each
data type occupies in a table row. The first field of a row is
numbered 1. The total number of bytes
in a table row, given by
 |
|
|
(8) |
where ri is the repeat count for field i, bi is the
number of bytes for the data type in field i, and TFIELDS
is the value of that keyword,
must equal the value of NAXIS1.
Table 9:
Valid TFORMn data types in BINTABLE extensions.
| TFORMn |
|
8-bit |
| value |
Description |
Bytes |
| L |
Logical |
1 |
| X |
Bit |
* |
| B |
Unsigned byte |
1 |
| I |
16-bit integer |
2 |
| J |
32-bit integer |
4 |
| A |
Character |
1 |
| E |
Single precision floating point |
4 |
| D |
Double precision floating point |
8 |
| C |
Single precision complex |
8 |
| M |
Double precision complex |
16 |
| P |
Array Descriptor |
8 |
* Number of 8-bit bytes needed to contain all bits.
This keyword has no associated value. Columns 9-80
shall contain ASCII blanks.
8.3.2 Other reserved keywords
In addition to the mandatory keywords
defined in Sect. 8.3.1,
these keywords may be used to describe the structure of a
binary table data array. They are optional, but if they
appear within a binary table extension header, they must
be used as defined in this section of this standard.
The value field for this indexed keyword shall contain a
character string, giving the name of field n. It is recommended
that only letters, digits, and
underscore (hexadecimal code 5F, "_'')
be used in the name. String comparisons with the values
of TTYPEn keywords should not be case sensitive.
The use of identical names for
different fields should be avoided.
The value field shall contain a character
string describing the physical units
in which the quantity in field
n, after any application of TSCALn
and TZEROn, is expressed. Units must follow the
prescriptions in Sect. 5.3.
The value field for this indexed keyword shall contain
the integer that represents
an undefined value for field n of data type B, I, or J. The keyword may not be used if field n is
of any other data type.
This indexed keyword shall be used, along with the TZEROn
keyword, when the quantity in field n does not
represent a true physical quantity. It may not be used
if the format of field
n is A, L, or X. The interpretation for fields
of type P is not
defined. A proposed interpretation is described in
Appendix .3. For fields with all other data types, the
value field shall contain a floating point number representing the
coefficient of the linear term in Eq. (7), which is used
to compute the true physical value of the field, or,
in the case of the complex data types C and M, of the real part of the
field, with the imaginary part of the scaling factor set to zero. The
default value for this keyword is 1.0.
This indexed keyword shall be used, along with the TSCALn
keyword, when the quantity in field n does not
represent a true physical quantity. It may not be used
if the format of field
n is A, L, or X. The interpretation for fields of
type P is not
defined. A proposed interpretation is described in
Appendix .3. For fields with all other data types,
the value field shall contain a floating point number
representing the true physical value corresponding to a value of
zero in field n of the FITS file, or, in the case of the complex
data types C and M, in the real part of the field,
with the imaginary part set
to zero. The default value for this keyword is 0.0.
Equation (7) is used to compute a true
physical value from the quantity in field n.
The value field of this
indexed keyword shall contain a character string
describing the format recommended for the display of the contents
of field n. If the table value has been scaled, the
physical value, derived using Eq. (7), shall be
displayed. All elements in a field
shall be displayed with a single, repeated format. For purposes of
display, each byte of bit (type X) and byte (type B)
arrays is treated a an unsigned integer. Arrays of type A may be
terminated with a zero byte. Only the format codes in
Table 10, discussed in Sect. 8.3.4,
are permitted for encoding. The format codes must be specified in upper case.
If the Bw.m, Ow.m, and Zw.m formats are
not readily available to the reader, the Iw.m display format may be used
instead, and if the ENw.d and ESw.d formats are not available,
Ew.d may
be used. The meaning of this keyword is not defined
for fields of type P in this standard but may be defined in conventions
using such fields.
Table 10:
Valid TDISPn format values in
BINTABLE extensions.
w is the width in characters of displayed values,
m is the minimum number of digits displayed, d is
the number of digits to right of decimal, and e is number
of digits in exponent. The .m and Ee fields are optional.
| Field Value |
Data Type |
| Aw |
Character |
| Lw |
Logical |
| Iw.m |
Integer |
| Bw.m |
Binary, integers only |
| Ow.m |
Octal, integers only |
| Zw.m |
Hexadecimal, integers only |
| Fw.d |
Single precision real |
| Ew.dEe |
Single precision real, exponential notation |
| ENw.d |
Engineering; E format with exponent multiple of 3 |
| ESw.d |
Scientific; same as EN but nonzero leading digit
if not zero |
| Gw.dEe |
General; appears as F if significance not lost, else E. |
| Dw.dEe |
Double precision real, exponential notation |
The value field of this keyword shall contain
an integer providing the separation, in bytes, between the start
of the main data table and the start of a
supplemental data area called the
heap. The default value shall be the product
of the values of NAXIS1 and NAXIS2.
This keyword shall not
be used if the value of PCOUNT is zero. A proposed application
of this keyword is presented in Appendix .3.
The value field of this indexed keyword
shall contain a character string describing how to interpret
the contents of field n as a multidimensional array,
providing the number of dimensions and the length along each axis.
The form of the value is not further specified by this standard.
A proposed convention is described in Appendix .4.
8.3.3 Data sequence
The data in a binary table extension shall consist of a
Main Data Table which may, but need not, be followed by
additional bytes. The positions in the last
data record after the last additional byte, or, if there are no
additional bytes, the last character of the last row of the data
array, shall be filled by setting all bits to zero.
8.3.3.1. Main data table.
The table is constructed from a two-dimensional byte array.
The number of bytes in a row shall be specified by the value of
the NAXIS1 keyword and the number of rows shall be
specified by the NAXIS2 keyword
of the associated header records. Within a row, fields shall
be stored in order of increasing column number, as determined from
the n of the TFORMn keywords.
The number of bytes in a row and the number of rows in the
table shall determine the size of the byte array. Every row
in the array shall have the same number of bytes. The
first row shall begin at the start of the record
immediately following the last header record. Subsequent rows
shall begin immediately following the
end of the previous row, with no intervening bytes,
independent of the record structure. Words need not
be aligned along word boundaries.
Each row in the array shall consist of a sequence of fields.
The number of elements in each field and their data type shall
be specified in keywords of the associated header records. A
separate format keyword must be provided for each field. The
location and format of fields shall be the same for every row.
Fields may be empty, if the repeat
count specified in the value of the
TFORMn keyword of the header is 0. The following
data types, and no others, are permitted.
If the value of
the TFORMn keyword specifies data type L, the contents
of field n shall consist of ASCII T indicating true or
ASCII F, indicating false. A 0 byte (hexadecimal 0) indicates
an invalid value.
If the value of
the TFORMn keyword specifies data type X, the
contents of field n shall consist of a sequence of bits
starting with the most significant bit; the bits following shall be
in order of decreasing significance, ending with the least
significant bit. A bit array shall be composed of
an integral number of bytes, with those bits following the end of the
data set to zero. No null value is defined for bit arrays.
If the value of the TFORMn keyword specifies
data type A, field n
shall contain a character string of
zero or more members,
composed of ASCII text. This character string may
be terminated before the length specified by
the repeat count by
an ASCII NULL (hexadecimal code 00).
Characters after the first ASCII NULL are not defined.
A string with the number of characters
specified by the repeat count is not
NULL terminated.
Null strings are defined by the presence of
an ASCII NULL as the first character.
If the value of
the TFORMn keyword specifies data type B, the
data in field n shall consist of unsigned 8-bit integers,
with the most significant bit first, and
subsequent bits in order of decreasing significance.
Null values are given by the value of the
associated TNULLn keyword.
If the value of
the TFORMn keyword specifies data type I, the
data in field n shall consist
of twos-complement signed 16-bit integers,
contained in two bytes.
The most significant byte shall be first.
Within each byte the
most significant bit shall be first, and
subsequent bits shall be in order of decreasing significance.
Null values are given by the value of the
associated TNULLn keyword.
Unsigned integers can be represented using the convention described
in Sect. 6.2.4.
If the value of
the TFORMn keyword specifies data type J, the
data in field n shall consist
of twos-complement signed 32-bit integers,
contained in four bytes.
The most significant byte shall be first, and
subsequent bytes shall be in order of decreasing significance.
Within each byte, the most significant bit shall be first, and
subsequent bits shall be in order of decreasing significance.
Null values are given by the value of the
associated TNULLn keyword.
Unsigned integers can be represented using the convention described
in Sect. 6.2.4.
If the value of the TFORMn keyword
specifies data type E, the data in
field n shall consist of
ANSI/IEEE-754 (IEEE 1985) 32-bit floating point
numbers, as described in Appendix .15.
All IEEE special values are recognized.
The IEEE NaN is used to represent invalid values.
If the value of the TFORMn keyword
specifies data type D, the data in
field n shall consist of ANSI/IEEE-754 (IEEE 1985)
64-bit double precision floating point
numbers, as described in Appendix .15.
All IEEE special values are recognized.
The IEEE NaN is used to represent invalid values.
If the value of the TFORMn keyword
specifies data type C, the data in
field n shall consist of a sequence of pairs of
32-bit single precision
floating point numbers.
The first member of each pair shall represent the real part
of a complex number, and the second member
shall represent the imaginary part of that complex number.
If either member contains a NaN, the entire complex value
is invalid.
If the value of the TFORMn keyword
specifies data type M, the data in
field n shall consist of a sequence of pairs of
64-bit double precision floating point numbers.
The first member of each pair shall represent the real part
of a complex number, and the second member of the pair
shall represent the imaginary part of that complex number.
If either member contains a NaN, the entire complex value
is invalid.
If the value of the TFORMn keyword
specifies data type P, the data in
field n shall consist of not more than
one pair of 32-bit integers.
The meaning of these integers is not defined
by this standard. The proposed application of this data type is
described in Appendix .3.
The main data table shall be followed by zero or more bytes,
as specified by the value of the PCOUNT keyword.
The meaning of these bytes is not further defined by this standard.
One proposed application is described in Appendix .3.
8.3.4 Data display
Character data are encoded under format code Aw. If the
character datum has length less than or equal to w, it is represented
on output right-justified in a string of w characters. If the
character datum has length greater than w, the first w characters
of the datum are represented on output in a string of w characters.
Character data are not surrounded by single or double quotation marks
unless those marks are themselves part of the data value.
Logical data are encoded under format code Lw. Logical
data are represented on output with the character T for true
or F for false right justified in a blank-filled string of
w characters. A null value may be represented by a completely blank
string of w characters.
Integer data (including bit X and byte B type fields)
are encoded under format codes Iw.m,
Bw.m, Ow.m, and Zw.m. The
default value of m is one and the ".m'' is optional. The
first letter of the code specifies the number base for the encoding
with I for decimal (10), B for binary (2), O for
octal (8), and Z for hexadecimal (16). Hexadecimal format uses
the upper-case letters A through F to represent decimal values 10
through 15. The output field consists of w characters containing
zero or more leading blanks followed by a minus if the internal datum
is negative followed by the magnitude of the internal datum in the form
of an unsigned integer constant in the specified number base with only
as many leading zeros as are needed to have at least m numeric
digits. Note that m
w is allowed if all values are
positive,
but m < w is required if any values are negative.
If the number of
digits required to represent the integer datum exceeds w, then the
output field consists of a string of w asterisk (*)
characters.
Real data are encoded under format codes Fw.d,
Ew.dEe, Dw.dEe,
ENw.d, and ESw.d. In all cases, the output
is a string of w characters including the decimal point, any sign
characters, and any exponent including the exponent's indicators,
signs, and values. If the number of digits required to represent the
real datum exceeds w, then the output field consists of a string of
w asterisk (*) characters. In all cases, d specifies the
number of digits to appear to the right of the decimal point. The
F format code output field consists of
characters
containing zero or more leading blanks followed by a minus if the
internal datum is negative followed by the absolute magnitude of the
internal datum in the form of an unsigned integer constant. These
characters are followed by a decimal point (".'') and d
characters giving the fractional part of the internal datum, rounded
by the normal rules of arithmetic to d fractional digits. For the
E and D format codes, an exponent is taken such that the
fraction
.
The fraction (with
appropriate sign) is output with an F format of width
characters with d characters after the decimal followed by an E
or D followed by the exponent as a signed
character
integer
with leading zeros as needed. The default value of e is 2
when the Ee portion of the format code is omitted. If
the exponent value will not fit in
characters but will fit in
then the E (or D) is omitted and the wider field
used. If the exponent value will not fit (with a sign character) in
characters, then the entire w-character output field is
filled
with asterisks (*). The ES format code is processed in
the same manner as the E format code except that the exponent is
taken so that
.
The EN format code is
processed in the same manner as the E format code except that
the exponent is taken to be an integer multiple of 3 and so that
.
All real format codes have number base
10. There is no difference between E and D format codes
on input other than an implication with the latter of
greater precision in the internal datum.
The Gw.dEe format code may be used with
data of any type. For data of type integer, logical, or character, it
is equivalent to Iw, Lw, or
Aw, respectively. For data of type real, it is
equivalent to an F format (with different numbers of characters
after the decimal) when that format will accurately represent the value
and is equivalent to an E format when the number (in absolute
value) is either very small or very large. Specifically, for real
values outside the range
,
it is
equivalent to Ew.dEe. For real values
within the above range, it is equivalent to
F
followed by
blanks, where
and
for
if the real datum value lies in the range
.
Complex data are encoded with any of the real data formats as described
above. The same format is used for the real and imaginary parts.
It is recommended that the 2 values be separated by a comma and enclosed
in parentheses with a total field width of
.
9 Restrictions on changes
Any structure that is a valid FITS
structure shall remain
a valid FITS structure at all future times. Use of certain
valid FITS structures may be
deprecated by this or
future FITS standard documents.
-
ANSI 1977, American National Standard for Information Processing:
Code for Information Interchange, ANSI X3.4-1977 (ISO 646)
(New York: American National Standards Institute, Inc.)
In the text
-
ANSI 1978, American National Standard for Information Processing:
Programming Language FORTRAN, ANSI X3.9-1978 (ISO 1539) (New York: American
National Standards Institute, Inc.)
In the text
-
Bunclark, P., & Rots, A. 1997
(ftp://nssdc.gsfc.nasa.gov/ pub/fits/year2000_agreement.txt) In the text
-
Cotton, W. D., Tody, D. B., & Pence, W. D. 1995, A&AS, 113, 159
In the text
-
Greisen, E. W., & Harten, R. H. 1981, A&AS, 44, 371
In the text
-
Grosbøl, P., Harten, R. H., Greisen, E. W., & Wells, D. C. 1988, A&AS, 73, 359
In the text
-
Grosbøl, P., & Wells, D. C. 1994
(ftp://nssdc.gsfc.nasa. gov/pub/fits/blocking94.txt) In the text
-
Harten, R. H., Grosbøl, P., Greisen, E. W., & Wells, D. C. 1988, A&AS, 73, 365
In the text
-
IAU Info. Bull. 1983, 49
-
IAU Info. Bull. 1988, 61
-
IEEE 1985, American National Standard - IEEE Standard for Binary
Floating Point Arithmetic, ANSI/IEEE 754-1985 (New York:
American National Standards Institute, Inc.)
In the text
-
Jennings, D. G., Pence, W. D., Folk, M., & Schlesinger, B. M. 1997
(http://fits.gsfc.nasa.gov/group.html) In the text
-
McNally, D., ed. 1988, Transactions of the IAU, Proc. of the
Twentieth General Assembly (Dordrecht: Kluwer)
In the text
-
Muñoz, J. R. 1989, ESA IUE Newslett., 32, 12
-
NRAO 1990, Going AIPS, National Radio Astronomy Observatory,
Charlottesville, VA
-
Ponz, J. D., Thompson, R. W., & Muñoz, J. R. 1994,
A&AS, 105, 53
In the text
-
Wells, D. C., Greisen, E. W., & Harten, R. H. 1981, A&AS, 44, 363
In the text
-
Wells, D. C., & Grosbøl, P. 1990
(ftp://nssdc.gsfc.nasa. gov/pub/fits/fp_agree.ps) In the text
Appendix A: Formal syntax of card images
(This Appendix is not part of the NOST FITS standard but is
included for convenient reference.)
The following notation is used in defining the formal syntax.
| := |
means "is defined to be'' |
| X | Y |
means one of X or Y (no ordering relation is implied) |
[X] |
means that X is optional |
X |
means X is repeated 1 or more times |
| "B'' |
means the ASCII character B |
| "A''-"Z'' |
means one of the ASCII characters A through Z |
\0xnn |
means the ASCII character associated with the hexadecimal code nn |
{ } |
expresses a constraint or a comment (it immediately follows the syntax rule). |
The following statements define the formal syntax used in
FITS free format card images.
FITS_card_image :=
FITS_commentary_card_image | FITS_value_card_image
FITS_commentary_card_image :=
COMMENT_keyword [ascii_text_char...] |
HISTORY_keyword [ascii_text_char...] |
BLANKFIELD_keyword [ascii_text_char...] |
keyword_field anychar_but_equal [ascii_text_char...] |
keyword_field `=' anychar_but_space [ascii_text_char...]
{Constraint: The total number of characters in a
FITS_commentary_card_image must be exactly equal to 80.}
FITS_value_card_image :=
keyword_field value_indicator [space...] [value] [space...]
[comment]
{Constraint: The total number of characters in a FITS_value_card_image
must be exactly equal to 80.}
{Comment: if the value field is not present, the value of the
FITS keyword is not defined.}
keyword_field :=
[keyword_char...] [space...]
{Constraint: The total number of characters in the keyword_field must
be exactly equal to 8.}
keyword_char :=
`A'-`Z' | `0'-`9' | `_' | `-'
COMMENT_keyword :=
`C' `O' `M' `M' `E' `N' `T' space
HISTORY_keyword :=
`H' `I' `S' `T' `O' `R' `Y' space
BLANKFIELD_keyword :=
space space space space space space space space
value_indicator :=
`=' space
space :=
` '
comment :=
`/' [ascii_text_char...]
ascii_text_char :=
space-`~'
anychar_but_equal :=
space-`<' | `>'-`~'
anychar_but_space :=
`!'-`~'
value :=
character_string_value | logical_value | integer_value |
floating_value | complex_integer_value |
7 complex_floating_value
character_string_value :=
begin_quote [string_text_char...] end_quote
{Constraint: The begin_quote and end_quote are not part of the
character string value but only serve as delimiters. Leading spaces are
significant; trailing spaces are not.}
begin_quote :=
quote
end_quote :=
quote
{Constraint: The ending quote must not be immediately followed by a
second quote.}
quote :=
\0x27
string_text_char :=
ascii_text_char
{Constraint: A string_text_char is identical to an ascii_text_char
except for the quote char; a quote char is represented by two successive
quote chars.}
logical_value :=
`T' | `F'
integer_value :=
[sign] digit [digit...]
{Comment: Such an integer value is interpreted as a signed decimal
number. It may contain leading zeros.}
sign :=
`-' | `+'
digit :=
`0'-`9'
floating_value :=
decimal_number [exponent]
decimal_number :=
[sign] [integer_part] [`.' [fraction_part]]
{Constraint: At least one of the integer_part and fraction_part must be
present.}
integer_part :=
digit | [digit...]
fraction_part :=
digit | [digit...]
exponent :=
exponent_letter [sign] digit [digit...]
exponent_letter :=
`E' | `D'
complex_integer_value :=
`(' [space...] real_integer_part [space...] `,'
[space...]
imaginary_integer_part [space...] `)'
real_integer_part :=
integer_value
imaginary_integer_part :=
integer_value
complex_floating_value :=
`(' [space...] real_floating_part [space...] `,'
[space...]
imaginary_floating_part [space...] `)'
real_floating_part :=
floating_value
imaginary_floating_part :=
floating_value
Appendix B: Proposed binary table conventions
(This Appendix is not part of the NOST FITS Standard but
is included for informational purposes only.)
In the paper describing the binary table
extension , type name 'BINTABLE'
(Cotton et al. 1995), the authors present three conventions:
one for variable length arrays, one for multidimensional arrays and one for
substring arrays. These
conventions, discussed in appendixes to the proposal, are not part of the
formal BINTABLE rules adopted by the IAUFWG
but are expected to enjoy wide
acceptance. The draft text for those appendixes, available on-line in
the directory
http://www.cv.nrao.edu/fits/documents/standards/,
is reproduced here
nearly verbatim; the only changes are those required for
stylistic consistency with the rest of this document.
B.1 ``Variable length array'' facility
One of the most attractive features of binary tables is that any
field of the table can be an array. In the standard case this is a
fixed size array, i.e., a fixed amount of storage is allocated in each
record for the array data - whether it is used or not. This is fine
so long as the arrays are small or a fixed amount of array data will
be stored in each record, but if the stored array length varies for
different records, it is necessary to impose a fixed upper limit on
the size of the array that can be stored. If this upper limit is made
too large excessive wasted space can result and the binary table
mechanism becomes seriously inefficient. If the limit is set too low
then it may become impossible to store certain types of data in the
table.
The "variable length array'' construct
presented here was devised to
deal with this problem. Variable length arrays are implemented in
such a way that, even if a table contains such arrays, a simple reader
program which does not understand variable length arrays will still be
able to read the main table (in other words a table containing
variable length arrays conforms to the basic binary table standard).
The implementation chosen is such that the records in the main table
remain fixed in size even if the table contains a variable length
array field, allowing efficient random access to the main table.
Variable length arrays are logically equivalent to regular static
arrays, the only differences being 1) the length of the stored array
can differ for different records, and 2) the array data is not stored
directly in the table records. Since a field of any datatype can be a
static array, a field of any datatype can also be a variable length
array (excluding type P, the variable length array descriptor
itself, which is not a datatype so much as a storage class specifier).
Conventions such as TDIMn
(see Appendix .4)
apply equally to both variable length and static arrays.
A variable length array is declared in the table header with a special
field datatype specifier of the form
where the "P'' indicates the amount of space occupied by the
array descriptor in the data record (64 bits), the
element count r should be 0, 1, or absent, t is a character denoting
the datatype of the array data (L, X, B,
I, J, etc., but not P), and
is a
quantity guaranteed to be equal to or greater than the maximum number
of elements of type t actually stored in a table record. There
is no built-in upper limit on the size of a stored array;
merely reflects the size of the largest array actually
stored in the table, and is provided to avoid the need to preview the
table when, for example, reading a table containing variable length
elements into a database that supports only fixed size arrays. There
may be additional characters in the TFORMn keyword
following the
.
For example,
indicates that field 8 of the table is a variable length array of type
byte, with a maximum stored array length not to exceed 1800 array
elements (bytes in this case).
The data for the variable length arrays in a table is not stored in
the actual data records; it is stored in a special data area, the
heap , following the last fixed size data record.
What is stored in
the data record is an array descriptor. This consists of two
32-bit integer values: the number of elements (array length) of the
stored array, followed by the zero-indexed byte offset of the first
element of the array, measured from the start of the heap area.
Storage for the array is contiguous. The array descriptor for field
N as it would appear embedded in a data record is illustrated
symbolically below:
[field N-1] [(nelem,offset)] [field N+1]
If the stored array length is zero there is no array data, and the
offset value is undefined
(it should be set to zero). The storage
referenced by an array descriptor must lie entirely within the heap
area; negative offsets are not permitted.
A binary table containing variable length arrays consists of three
principal segments, as follows:
[table_header] [record_storage_area] [heap_area]
The table header consists of one or more 2880-byte FITS logical
records with the last record indicated by the
keyword END
somewhere in the record. The record storage area begins with the next
2880-byte logical record following the last header record and is
bytes in length.
The zero indexed
byte offset of the heap measured from the start of the record storage
area is given by the THEAP keyword in the header.
If this
keyword is missing the heap is assumed to begin with the byte
immediately following the last data record, otherwise there may be a
gap between the last stored record and the start of the heap. If
there is no gap the value of the heap offset
is
.
The total length in bytes of the
heap area following the last stored record (gap plus heap) is given by
the PCOUNT keyword in the table header.
For example, suppose we have a table containing 5 rows each 168 byte
records, with a heap area 2880 bytes long, beginning at an offset of
2880, thereby aligning the record storage and heap areas on FITS
record boundaries (this alignment is not necessarily recommended but
is useful for our example). The data portion of the table consists of
2 2880-byte FITS records, 840 bytes of which are used by the 5
table records, hence PCOUNT is
,
or 4920 bytes;
this is expressed in the table header as:
NAXIS1 = 168 / Width of table row in bytes
NAXIS2 = 5 / Number of rows in table
PCOUNT = 4920 / Random parameter count
...
THEAP = 2880 / Byte offset of heap area
The values of TSCALn and TZEROn
for variable
length array column entries are to be applied to the values in the
data array in the heap area, not the values of the array descriptor.
These keywords can be used to scale data values in either
static or variable length arrays.
While the above description is sufficient to define the required
features of the variable length array implementation, some hints
regarding usage of the variable length array facility may also be
useful.
Programs which read binary tables should take care to not assume more
about the physical layout of the table than is required by the
specification. For example, there are no requirements on the
alignment of data within the heap. If efficient runtime access is a
concern one may want to design the table so that data arrays are
aligned to the size of an array element. In another case one might
want to minimize storage and forgo any efforts at alignment (by
careful design it is often possible to achieve both goals). Variable
array data may be stored in the heap in any order, i.e., the data for
record N+1 is not necessarily stored at a larger offset than that for
record N. There may be gaps in the heap where no data is stored.
Pointer aliasing is permitted, i.e., the array descriptors for two or
more arrays may point to the same storage location (this could be used
to save storage if two or more arrays are identical).
Byte arrays are a special case because they can be used to store a
"typeless'' data sequence. Since FITS is a machine-independent
storage format, some form of machine-specific data conversion (byte
swapping, floating point format conversion) is implied when accessing
stored data with types such as integer and floating, but byte arrays
are copied to and from external storage without any form of
conversion.
An important feature of variable length arrays is that it is possible
that the stored array length may be zero. This makes it possible to
have a column of the table for which, typically, no data is present in
each stored record. When data is present the stored array can be as
large as necessary. This can be useful when storing complex objects
as records in a table.
Accessing a binary table stored on a random access storage medium is
straightforward. Since the data records in the main table are fixed
in size they may be randomly accessed given the record number, by
computing the offset. Once the record has been read in, any variable
length array data may be directly accessed using the element count and
offset given by the array descriptor stored in the data record.
Reading a binary table stored on a sequential access storage medium
requires that a table of array descriptors be built
up as the main
table records are read in. Once all the table records have been read,
the array descriptors are sorted by the offset of the array data in
the heap . As the heap data is read,
arrays are extracted sequentially
from the heap and stored in the affected records using the back
pointers to the record and field from the table of array descriptors.
Since array aliasing is permitted, it may be necessary to store a
given array in more than one field or record.
Variable length arrays are more complicated
than regular static arrays
and imply an extra data access per array to fetch all the data for a
record. For this reason, it is recommended that regular static arrays
be used instead of variable length arrays unless efficiency or other
considerations require the use of a variable array.
This facility is still undergoing trials and is not part of the
basic binary table definition.
B.2 ``Multidimensional array'' convention
It is anticipated that binary tables will need to contain data
structures more complex that those describable by the basic notation.
Examples of these are
multidimensional arrays and nonrectangular data
structures. Suitable conventions may be defined to pass these
structures using some combination of keyword/value pairs and table
entries to pass the parameters of these structures.
One case, multidimensional arrays, is so common that it is prudent
to describe a simple convention. The "Multidimensional array''
convention consists of the following: any column with a dimensionality
of 2 or larger will have an associated character keyword
TDIMn ='(l,m,n...)' where l, m, n, ...are the
dimensions of the array.
The data is ordered such that the array index of the first dimension
given (l) is the most rapidly varying and that of the last
dimension given is the least rapidly varying. The size implied by the
TDIMn keyword will equal the element count specified in the
TFORMn keyword. The adherence to this convention will be
indicated by the presence of a TDIMn keyword in the form
described above.
A character string is represented in a binary
table by a one-dimensional character array, as described under "Character''
in the list of datatypes in
Sect. 8.3.3 ("Main Data Table''). For example, a
Fortran 77 CHARACTER*20 variable could be represented in a
binary table as a character array declared as
TFORMn = '20A
![\includegraphics[width=3mm,clip]{espace.eps}](/articles/aa/full/2001/34/aah2901/img1.gif)
'. Arrays of character strings, i.e.,
multidimensional character arrays, may be represented using the
TDIMn notation. For example, if TFORMn = '60A
![\includegraphics[width=3mm,clip]{espace.eps}](/articles/aa/full/2001/34/aah2901/img1.gif)
'
and TDIMn = '(5,4,3)', then the entry consists of a
array of strings of 5 characters each. (Variable length
character strings are allowed by the convention described in
Appendix .5. One dimensional arrays of strings should use
the convention in Appendix .5 rather than the
"Multidimensional Array'' convention.)
This convention is optional and will not preclude other conventions.
This convention is not part of the binary table definition.
B.3 ``Substring array'' convention
This appendix
describes a layered convention for specifying that a
character array field (TFORMn = 'rA') consists
of an array of either
fixed-length or variable-length substrings
within the field. This convention utilizes the option described in
the basic binary table definition to have additional characters
following the datatype code character in the TFORMn value
field. The full form for the value of TFORMn within this
convention is
'rA:SSTRw/nnn'
and a simpler form that may be used for fixed-length substrings only is
'rAw'
where
r is an integer giving the total length including any delimiters
(in characters) of the field,
A signifies that this is a character array field,
: indicates that a convention indicator follows,
SSTR indicates the use of the "Substring Array'' convention,
w is an integer
r giving the (maximum) number of
characters in an
individual substring (not including the delimiter), and
/nnn if present, indicates that the substrings
have variable-length and are delimited by an ASCII text character with
decimal value nnn in the range 032 to 126 decimal, inclusive.
This character is referred to as the delimiter character. The
delimiter character for the last substring will be an ASCII NUL.
To illustrate this usage:
'40A:SSTR8' signifies that the field is 40 characters wide and
consists of an array of 5 8-character fixed-length substrings. This
could also be expressed using the simpler form as '40A8',
'100A:SSTR8/032' signifies that the field is 100 characters wide
and consists of an array of variable-length substrings where each
substring has a maximum length of 8 characters and, except for the last
substring, is terminated by an ASCII SPACE (decimal 32) character.
Note that simple FITS readers that do not understand this
substring convention can ignore the TFORM characters
following the rA and can interpret the field
simply as a single long string
as described in the basic binary table definition.
The following rules complete the full definition of this convention:
- 1.
- In the case of fixed-length substrings, if r is not an
integer multiple of w then the remaining odd characters are
undefined and should be ignored. For example if
TFORMn ='14A:SSTR3', then the field contains 4
3-character substrings followed by 2 undefined characters;
- 2.
- Fixed-length substrings must always be padded with blanks if
they do not otherwise fill the fixed-length subfield. The ASCII NUL
character must not be used to terminate a fixed-length substring
field;
- 3.
- The character following the delimiter character in
variable-length substrings is the first character of the following
substring;
- 4.
- The method of signifying an undefined or null substring within a
fixed-length substring array is not explicitly defined by this
convention (note that there is no ambiguity if the variable-length
format is used). In most cases it is recommended that a completely
blank substring or other adopted convention (e.g.
'INDEF') be
used for this purpose although general readers are not expected to
recognize these as undefined strings. In cases where it is necessary
to make a distinction between a blank, or other, substring and an
undefined substring use of variable-length substrings is recommended;
- 5.
- Undefined or null variable-length substrings are designated by a
zero-length substring, i.e., by a delimiter character (or an ASCII NUL
if it is the last substring in the table field) in the first position
of the substring. An ASCII NUL in the first character of the table
field indicates that the field contains no defined variable-length
substrings;
- 6.
- The "Multidimensional Array'' convention described in
Appendix .4 of this paper provides a syntax using the
TDIMn keyword
for describing multidimensional arrays of any
datatype which can also be used to represent arrays of fixed-length
substrings. For a one dimensional array of substrings (a two
dimensional array of characters) the "Substring Array'' convention is
preferred over the "Multidimensional Array'' convention.
Multidimensional arrays of (fixed length) strings require the use of
the "Multidimensional Array'' convention;
- 7.
- This substring convention may be used in conjunction with
the "Variable Length Array'' facility described in
Appendix .3 of this paper. In this case, the two
possible full forms for the value of the TFORM keyword are
TFORMn = 'rPA(
):SSTRw/nnn'
and
TFORMn = 'rPA(
):SSTRw'
for the variable and fixed cases, respectively.
This convention is optional and will not preclude other conventions.
This convention is not part of the binary table definition.
Appendix C: Implementation on physical media
(This Appendix is not part of the NOST FITS Standard, but
is included as a guide to recommended practices.)
The arrangement of digital bits and other physical properties of
any medium should be in conformance with the relevant national
and/or international standard for that medium.
Tapes may be either ANSI standard labeled or unlabeled.
Unlabeled tapes are preferred.
Conventions regarding labels for physical media containing
FITS files have not been established for other media.
Individual FITS files are terminated by a tape-mark.
For fixed block length sequential media where
the physical block size cannot be equal to or
an integral multiple of the standard FITS logical record length,
a logical record of fewer than 23040 bits (2880 8-bit bytes) immediately
following the end of the primary header,
data, or an extension
should be treated as an end-of-file. Otherwise, individual
FITS files should be terminated by a delimiter appropriate
to the medium, analogous to the tape end-of-file mark.
If more than one FITS file appears on a
physical structure, the appropriate end-of-file indicator
should immediately precede the start of the primary
headers of all files after the first.
Storage of a single FITS file on more than one unlabeled tape
or on multiple units of any other medium is not universally supported
in FITS. One possible way to handle multivolume
unlabeled tape was suggested in Wells et al. (1981).
A convention for logically
grouping on-line FITS HDUs that may physically be located
in different sites has been proposed in (Jennings et al. 1997).
Appendix D: Suggested time scale specification
[Not part of formal DATExxxx agreement]
- 1.
- Use of the keyword TIMESYS is suggested
as an implementation of the time
scale specification. It sets the principal time system for time-related
keywords and data in the HDU (i.e., it does not preclude the addition of
keywords or data columns that provide information for transformations to
other time scales, such as sidereal times or barycenter corrections).
Each HDU shall contain not more than one TIMESYS keyword.
Initially, officially allowed values are:
- UTC
- Coordinated Universal Time; defined since 1972.
- UT
- Universal Time, equal to Greenwich Mean Time (GMT)
since 1925; the UTC equivalent before 1972;
see: Explanatory Supplement, p. 76.
- TAI
- International Atomic Time; "UTC without the
leap seconds''; 31 s ahead of UTC on 1997-07-01.
- AT
- International Atomic Time; deprecated synonym of TAI.
- ET
- Ephemeris Time, the predecessor of TT; valid until
1984.
- TT
- Terrestrial Time, the IAU standard time scale since 1984;
continuous with ET and synchronous with (but 32.184 s
ahead of) TAI.
- TDT
- Terrestrial Dynamical Time; = TT.
- TDB
- Barycentric Dynamical Time.
- TCG
- Geocentric Coordinate Time; runs ahead of TT since
1977-01-01 at a rate of approximately 22 ms/year.
- TCB
- Barycentric Coordinate Time; runs ahead of TDB since
1977-01-01 at a rate of approximately 0.5 s/year.
For reference, see:
Explanatory Supplement to the Astronomical Almanac, P. K. Seidelmann,
ed., University Science Books, 1992, ISBN 0-935702-68-7, or
http://tycho.usno.navy.mil/systime.html
Use of Global Positioning Satellite (GPS) time (19 s behind TAI) is
deprecated.
- 2.
- By default, times will be deemed to be as measured at the detector (or
in practical cases, at the observatory) for times that run synchronously
with TAI (i.e., TAI, UTC, and TT). In the case of coordinate times (such
as TCG and TCB) and TDB which are tied to an unambiguous coordinate origin,
the default meaning of time values will be: time as if the observation
had taken place at the origin of the coordinate time system. These
defaults follow common practice; a future convention on time scale issues
in FITS files may allow other combinations
but shall preserve this default
behavior. The rationale is that raw observational data are most likely
to be tagged by a clock that is synchronized with TAI, while a
transformation to coordinate times or TDB is usually accompanied by a
spatial transformation, as well. This implies that path length differences
have been corrected for. Note that the difference TDB - UTC, in that case,
is approximately sinusoidal, with period one year and amplitude up to
500 s, depending on source position. Also, note that when the location
is not unambiguous (such as in the case of an interferometer) precise
specification of the location is strongly encouraged in, for instance,
geocentric Cartesian coordinates.
- 3.
- Note that TT is the IAU preferred standard. It may be considered
equivalent to TDT and ET, though ET should not be used
for data
taken after 1984. For reference, see: Explanatory Supplement, pp. 40-48.
- 4.
- If the TIMESYS keyword is absent or has an unrecognized value,
the value UTC will be assumed for dates since 1972,
and UT for pre-1972 data.
- 5.
- Examples.
The three legal representations of the date of October 14, 1996,
might be written as
shown in Table .1.
Table D.1:
Three legal representations of the date October 14, 1996.
 |
- 6.
- The convention suggested in this Appendix is part of the mission-specific
FITS conventions adopted for, and used in,
the RXTE archive, building on
existing High Energy Astrophysics FITS conventions. See:
http://heasarc.gsfc.nasa.gov/docs/xte/abc/ time_tutorial.html
http://heasarc.gsfc.nasa.gov/docs/xte/abc/ time.html
The VLBA project has adopted a convention where the
keyword TIMSYS, rather than TIMESYS, is used,
currently allowing the values UTC and IAT.
See p. 9 and p. 16 of:
http://www.cv.nrao.edu/fits/documents/ drafts/vlba_format.ps
(This Appendix is not part of the NOST FITS Standard but
is included for informational purposes only.)
Note: in this discussion, the term the FITS papers
refers to Wells et al. (1981),
Greisen & Harten (1981),
Grosbøl et al. (1988),
Harten et al. (1988),
Ponz et al. (1994),
and Cotton et al. (1995) collectively;
the term Floating Point Agreement (FPA)
refers to Wells & Grosbøl (1990);
the term Blocking Agreement
refers to Grosbøl & Wells (1994); and the term DATExxxx Agreement
refers to the redefinition of the value format
for date keywords approved by the IAUFWG in 1997.
- 1.
- Section 3 - Definitions, Acronyms, and Symbols.
- Array value
- - This precise definition
is not used in the original FITS papers.
- ASCII text
- - This permissible subset
of the ASCII character set, used in many contexts, is not
precisely defined in the FITS papers.
- Basic FITS
- - This definition
includes the possibility of floating point data arrays,
while the terminology in the FITS papers refers
to FITS as described in Wells et al. (1981), where
only integer arrays were possible.
- Conforming Extension
- - This terminology is not used in
the
FITS papers.
- Deprecate
- - The concept of deprecation does
not appear in the FITS papers.
- FITS structure
- - This terminology
is not used in the FITS
papers in the precise way that it is in this standard.
- Fraction
- - This terminology and the distinction
between fraction and mantissa do
not appear in the Floating Point Agreement.
- Header and Data Unit
- - This terminology is not used in the
FITS papers.
- Indexed keyword
- - This terminology is
not
used in the original FITS papers.
- Physical value
- - This precise definition
is not used in the original FITS papers.
- Reference point
- - This term replaces the reference pixel of
the
FITS papers. The new terminology is consistent
with the fact that
the array need not represent a digital image and that the reference
point (or pixel) need not lie within the array.
- Repeat count
- - This terminology is not used in the FITS
papers.
- Reserved keyword
- - The FITS
papers
describe optional keywords but do not say
explicitly that they are reserved.
- Standard Extension
- - This
precise definition is new. The term
standard extension is used in some contexts in the
FITS papers to refer to what this standard defines as a
standard extension and in others to refer to what this
standard defines
as conforming extension.
- 2.
- Section 4.3.2. Primary data array
Fill format - This
specification is new. The FITS papers
and the FPA do not precisely specify
the format of data fill for the primary data array.
- 3.
- Section 4.4.1.1. Identity (of conforming extensions)
The FITS papers specify that creators of
new
extension types
should check with the FITS standards committee.
This standard identifies the committee specifically,
introduces the role of the FITS Support
Office as
its agent, and mandates registration.
- 4.
- Section 4.6. Physical blocking
This material is based entirely on the
Blocking Agreement. Material in the
early FITS papers [1,4] specifying the
expression of FITS
on specific physical media is not part of this standard.
- 5.
- Section 4.6.1. Bitstream devices
The Blocking Agreement specifies that this rule applies to
FITS files written to logical file systems. This
standard applies the rule to all bitstream devices, not only
logical file systems.
- 6.
- Section 4.6.2.1. Fixed block
The Blocking Agreement specifies that this rule applies to
FITS files written to optical disks, (accessed as a
sequential set of records), QIC format 1/4-inch cartridge tapes
and Local Area networks. This standard extends the rule to
other fixed block length sequential media.
- 7.
- Section 4.6.2.2. Variable block
The Blocking Agreement specifies that this rule applies to
FITS files written to 1/2-inch 9 track tapes,
DDS/DAT 4 mm cartridge tapes and
8 mm cartridge tape (Exabyte). This
standard extends the rule to all variable block length
sequential media and eliminates references to specific
products.
- 8.
- Section 5.1.2.1. Keyword (as header component)
The specification of permissible keyword characters is new.
The FITS papers do not precisely define the permissible
characters for keywords.
- 9.
- Section 5.1.2.2. Value indicator (bytes 9-10)
The FITS papers do not specifically
address the permissibility of null values.
This standard states explicitly that they are permitted.
- 10.
- Section 5.1.2.3. Value/comment (bytes 11-80)
In the FITS papers, the slash between the value and
comment is optional. This standard requires the slash,
consistent with the prescription of FORTRAN-77 list-directed
input.
- 11.
- Section 5.2. Value, including its subsections
The FITS papers specify that the value field is to be
written following the rules of
ANSI FORTRAN-77
list-directed
input, with some restrictions. This standard explicitly
describes the format of the value field. The FITS papers
permit the value field to contain an array of values. This
standard specifies that there shall be only one value in the
value field. The FITS papers require the fixed format for the most
essential parameters. This standard identifies those parameters
with the values of the mandatory
keywords.
- 12.
- Section 5.2.1. Character string
The standard explicitly describes how single quotes are to be
coded into keyword values, a rule only implied by the
FORTRAN-77 list-directed
read
requirements of the FITS papers.
The standard states that in general, character-valued keywords
can have lengths up to the maximum 68 character length.
- 13.
- Section 5.2.4. Real floating point number
The standard explicitly notes that the full precision of 64-bit
values cannot be expressed as a single value using the
fixed format.
- 14.
- Section 5.2.5. Complex integer number
The standard does not support the fixed format for complex integers
defined in the FITS papers
but is consistent with FORTRAN-77 list-directed
read
as required in the FITS papers for free format. Because the
fixed format of the FITS
papers did not conform to the rules for FORTRAN-77
list-directed I/O, consistency with both was impossible.
There are no known FITS files that use the fixed format
for complex integers that was defined in the FITS papers.
- 15.
- Section 5.2.6. Complex floating point number
The standard does not support the fixed format for complex
floating point numbers defined in
the FITS papers
but is consistent with FORTRAN-77 list-directed
read
as required in the FITS papers for free format. Because the
fixed format of the FITS papers
did not conform to the rules for FORTRAN-77
list-directed I/O, consistency with both was impossible.
There are no known FITS files that use the fixed format
for complex floating point numbers
that was defined in the FITS papers.
- 16.
- Section 5.3. Units
The FITS papers recommend the use of SI units
and identify certain
other units standard in astronomy. This standard codifies the
recommendation and makes it more specific by referring to the IAU
Style Manual (McNally 1988),
while explicitly recommending degrees for angular measure and
requiring degrees for celestial coordinates.
- 17.
- Section 5.4.1.1. Principal (mandatory keywords)
- (a)
- SIMPLE keyword - The explicit prohibition against
the appearance of the SIMPLE keyword in extensions
does not appear in the FITS papers.
- (b)
- NAXIS keyword - The
requirement that the NAXIS keyword
may not be negative is not explicitly specified in
the FITS papers.
- (c)
- NAXISn keyword - The requirement that
the NAXISn keyword may not be negative
is not explicitly specified in the FITS papers.
- 18.
- Section 5.4.1.2. Conforming extensions
- (a)
-
- The requirement
that
may not be negative
is not explicitly specified in the FITS papers.
- (b)
- XTENSION keyword - That this keyword
may not appear in the primary header is only implied by
the FITS papers; the prohibition is explicit in this standard.
The FITS papers name a FITS standards committee
as the keeper of the list of accepted extension
type names. This standard specifically identifies the committee
and introduces the role of the FITS Support
Office
as its agent.
- 19.
- Section 5.4.2. Other reserved keywords
That the optional keywords defined
in the FITS papers are
to be reserved for both the primary HDUs and all extensions
with the meanings and usage defined in those papers,
as in the standard, is not explicitly stated in all of them,
although some keywords are
explicitly reserved in the papers describing the image and binary
table extensions.
- 20.
- Section 5.4.2.1. Keywords describing the history or physical
construction of the HDU
- (a)
- DATE keyword - The notation for four-digit year number
is YYYY rather
than the CCYY of the "DATExxxx Agreement''.
The recommendation for use of Universal Time in the superseded
format with a two-digit year is not in the FITS
papers.
- (b)
- BLOCKED keyword - The FITS papers
require the BLOCKED keyword to appear
in the first record of the primary header
even though it cannot when the value of NAXIS
exceeds the values described in the text. They do
not address this contradiction. This standard deprecates the
BLOCKED keyword.
- 21.
- Section 5.4.2.2. Keywords describing observations
- (a)
- DATE-OBS keyword - The
recommendation for use of
Universal Time in the superseded format with
a two-digit year is not in the FITS papers.
- (b)
- EQUINOX and EPOCH keywords - This
standard replaces the
EPOCH keyword with the more appropriately
named EQUINOX keyword and
deprecates the EPOCH name.
- 22.
- Section 5.4.2.4. Commentary keywords
Keyword field is blank - Wells et al. (1981) contains
the text "BLANK'' to represent a blank keyword field. The standard
clarifies the intention.
- 23.
- Section 5.4.2.5. Array keywords
- (a)
- BUNIT keyword - The FITS papers
recommend the use of SI units, degrees
as the appropriate unit for angles, and
identify other units standard in astronomy. This
standard specifically applies the recommendations of
Sect. 5.3 to the BUNIT keyword.
- (b)
- CTYPEn, CRVALn, CDELTn, and CROTAn
keywords - This
standard extends the recommendations on
units to coordinate axes, explicitly requiring decimal
degrees for coordinates.
- (c)
- CRPIXn keywords - This standard explicitly notes the
ambiguity
in the location of the index number relative to an image pixel.
- (d)
- CDELTn keywords - The definition in the standard
differs from that in the FITS papers in that
it provides for the case where
the spacing between index points varies over the grid.
For the case of constant spacing, it is identical to
the specification in the FITS papers.
- (e)
- DATAMAX and DATAMIN keywords - The standard
clarifies that the value refers to the
physical value
represented by the
array , after any scaling,
not the array value before scaling.
The standard also notes that special
values are not to be considered
when determining the values of DATAMAX and DATAMIN,
an issue not specifically addressed
by the FITS papers or the FPA.
- 24.
- Section 7. Random groups
structure
The standard deprecates
the Random Groups structure.
- 25.
- Section 7.1.2. Reserved keywords (random groups)
That the optional keywords defined
in the FITS papers are
to be reserved with the meanings and usage defined in those papers,
as in the standard, is not explicitly stated in them.
- 26.
- Section 7.1.2.2. PSCALn keywords -
The default value is explicitly specified in the standard, whereas
in the FITS papers it is assumed by analogy
with the BSCALE keyword.
- 27.
- Section 7.1.2.3. PZEROn keywords -
The default value is explicitly specified in the standard, whereas
in the FITS papers it is assumed by analogy
with the
BZERO keyword.
- 28.
- Section 8.1. ASCII table extension
The name ASCII table is given to the
"tables'' extension discussed
in the FITS papers to distinguish it from the binary table
extension.
- 29.
- Section 8.1.1. Mandatory keywords (ASCII table)
- (a)
- NAXIS1 keyword - The
requirement that
the NAXIS1 keyword may not be negative in an ASCII table header
is not explicitly specified in
the FITS papers.
- (b)
- NAXIS2 keyword - The requirement that
the NAXIS2 keyword
may not be negative in an ASCII table header
is not explicitly specified in
the FITS papers.
- (c)
- TFIELDS keyword - The requirement that
the TFIELDS keyword
may not be negative is not explicitly specified
in the FITS papers.
- (d)
- TFORMn keyword - The requirement that
format codes must be specified in upper case is
implied but not explicitly specified
in the FITS papers.
- 30.
- Section 8.1.2. Other reserved keywords (ASCII table)
That the optional keywords
defined in the FITS papers are
to be reserved with the meanings and usage defined in those papers,
as in the standard, is not explicitly stated in them.
- (a)
- TUNITn keywords - The FITS papers
do not explicitly recommend the use of any particular
units
for this keyword, although the reference to the BUNIT
keyword may be considered an implicit extension of
the recommendation for that keyword. This standard makes
the recommendation more specific for the
TUNITn keyword by requiring conformance to the prescriptions
in Sect. 5.3.
- (b)
- TSCALn keywords - The prohibition against use in
A-format fields is stronger than
the statement in the FITS papers that the
keyword
"is not relevant''.
- (c)
- TZEROn keywords - The prohibition against use in
A-format fields is stronger than the statement
in the FITS papers that the
keyword "is not relevant''.
- 31.
- Section 8.3.2. Other reserved keywords (Binary Table)
The EXTNAME, EXTVER, EXTLEVEL, AUTHOR,
and REFERENC keywords explicitly reserved for binary tables
in the defining paper are reserved in the standard under the
general prescription of Sect. 5.4.2.
- (a)
- TUNITn keywords - The FITS papers
do not explicitly recommend the use of any particular
units
for this keyword. This standard makes
the recommendation more specific for the
TUNITn keyword by requiring conformance to the prescriptions
of Sect. 5.3.
- (b)
- TDISPn keywords - The version of the
BINTABLE paper upon which the FITS committees
voted stated incorrectly that the values used to display bit
and byte arrays should be considered signed. This standard
follows the text in the published BINTABLE paper, which
specifies that these values should be unsigned.
The BINTABLE paper does not specify how a TDISPn
value for a field of type P is interpreted; this standard
explicitly mandates no interpretation but allows
conventions to provide interpretations.
The requirement that format codes must be
specified in upper case is implied but not explicitly specified
in the BINTABLE paper.
- (c)
- THEAP keywords - The FITS papers
state only that the keyword is reserved for use in the convention
described in Appendix .3.
This standard makes the more specific statement that this keyword
is used to provide the separation, in bytes, between the start
of the main data table and the start of a
supplemental data area called the heap
and identifies the default value.
- (d)
- TDIMn keywords - The FITS papers
state only that the keyword is reserved for use
in the convention described in Appendix .4.
This standard makes the more specific statement that the contents
of the value field contain a character string describing how to interpret
the contents of a field as a multidimensional array.
- 32.
- Section 8.3.4. Data display
The BINTABLE paper suggests that the format for display
suggested by the TDISPn should be understood as a
Fortran-90 format or, where Fortran-90 is unavailable, a
FORTRAN-77 format. This standard explicitly describes the formats.
The statement in the standard concerning differences
between E and D format codes, which notes that the latter
implies greater precision in the internal datum, does not appear in
the BINTABLE paper.
- 33.
- Section 9. Restrictions on changes
The FITS papers do not provide for
the concept of deprecation.
- 34.
- Appendix .6 implementation on physical media
Material in the FITS papers specifying the
expression of FITS
on specific physical media is not part of this standard; what is
provided in the Appendix is purely as a guide to recommended
practices.
Appendix F: Summary of keywords
(This Appendix is not part of the NOST FITS Standard,
but is included
for convenient reference).
Tables F.1, F.2, and F.3 list the mandatory and reserved FITS keywords.
Table F.1:
Mandatory FITS keywords for the
structures described in this document.
| Principal |
Conforming |
ASCII Table |
Image |
Binary Table |
Random Groups |
| HDU |
Extension |
Extension |
Extension |
Extension |
Records |
| SIMPLE |
XTENSION |
XTENSION1 |
XTENSION2 |
XTENSION3 |
SIMPLE |
| BITPIX |
BITPIX |
BITPIX = 8 |
BITPIX |
BITPIX = 8 |
BITPIX |
| NAXIS |
NAXIS |
NAXIS = 2 |
NAXIS |
NAXIS = 2 |
NAXIS |
| NAXISn4 |
NAXISn4 |
NAXIS1 |
NAXISn4 |
NAXIS1 |
NAXIS1 = 0 |
| EXTEND5 |
PCOUNT |
NAXIS2 |
PCOUNT = 0 |
NAXIS2 |
NAXISn4 |
| END |
GCOUNT |
PCOUNT = 0 |
GCOUNT = 1 |
PCOUNT |
GROUPS = T |
| |
END |
GCOUNT = 1 |
END |
GCOUNT = 1 |
PCOUNT |
| |
|
TFIELDS |
|
TFIELDS |
GCOUNT |
| |
|
TBCOLn6 |
|
TFORMn6 |
END |
| |
|
TFORMn6 |
|
END |
|
| |
|
END |
|
|
|
1 XTENSION= 'TABLE' for the
ASCII table extension.
2 XTENSION= 'IMAGE' for the
image extension .
3 XTENSION= 'BINTABLE' for the binary table
extension .
4 Runs from 1 through the value of NAXIS.
5 Required only if extensions are present.
6 Runs from 1 through the value of TFIELDS.
Appendix G: ASCII text
(This Appendix is not part of the NOST FITS standard; the
material in it is based on the ANSI standard for ASCII (ANSI 1977)
and is
included here for informational purposes.)
In Table G.1, the first column is
the decimal
and the second column the hexadecimal value for the character
in the third column. The characters hexadecimal 20 to 7E (decimal 32
to 126) constitute the subset referred to in this document as
ASCII text.
Table G.1:
ASCII character set.
| ASCII Control |
ASCII Text |
| dec |
hex |
char |
dec |
hex |
char |
dec |
hex |
char |
dec |
hex |
char |
| 0 |
00 |
NUL |
32 |
20 |
SP |
64 |
40 |
@ |
96 |
60 |
` |
| 1 |
01 |
SOH |
33 |
21 |
! |
65 |
41 |
A |
97 |
61 |
a |
| 2 |
02 |
STX |
34 |
22 |
" |
66 |
42 |
B |
98 |
62 |
b |
| 3 |
03 |
ETX |
35 |
23 |
# |
67 |
43 |
C |
99 |
63 |
c |
| 4 |
04 |
EOT |
36 |
24 |
$ |
68 |
44 |
D |
100 |
64 |
d |
| 5 |
05 |
ENQ |
37 |
25 |
% |
69 |
45 |
E |
101 |
65 |
e |
| 6 |
06 |
ACK |
38 |
26 |
& |
70 |
46 |
F |
102 |
66 |
f |
| 7 |
07 |
BEL |
39 |
27 |
' |
71 |
47 |
G |
103 |
67 |
g |
| 8 |
08 |
BS |
40 |
28 |
( |
72 |
48 |
H |
104 |
68 |
h |
| 9 |
09 |
HT |
41 |
29 |
) |
73 |
49 |
I |
105 |
69 |
i |
| 10 |
0A |
LF |
42 |
2A |
* |
74 |
4A |
J |
106 |
6A |
j |
| 11 |
0B |
VT |
43 |
2B |
+ |
75 |
4B |
K |
107 |
6B |
k |
| 12 |
0C |
FF |
44 |
2C |
, |
76 |
4C |
L |
108 |
6C |
l |
| 13 |
0D |
CR |
45 |
2D |
- |
77 |
4D |
M |
109 |
6D |
m |
| 14 |
0E |
SO |
46 |
2E |
. |
78 |
4E |
N |
110 |
6E |
n |
| 15 |
0F |
SI |
47 |
2F |
/ |
79 |
4F |
O |
111 |
6F |
o |
| 16 |
10 |
DLE |
48 |
30 |
0 |
80 |
50 |
P |
112 |
70 |
p |
| 17 |
11 |
DC1 |
49 |
31 |
1 |
81 |
51 |
Q |
113 |
71 |
q |
| 18 |
12 |
DC2 |
50 |
32 |
2 |
82 |
52 |
R |
114 |
72 |
r |
| 19 |
13 |
DC3 |
51 |
33 |
3 |
83 |
53 |
S |
115 |
73 |
s |
| 20 |
14 |
DC4 |
52 |
34 |
4 |
84 |
54 |
T |
116 |
74 |
t |
| 21 |
15 |
NAK |
53 |
35 |
5 |
85 |
55 |
U |
117 |
75 |
u |
| 22 |
16 |
SYN |
54 |
36 |
6 |
86 |
56 |
V |
118 |
76 |
v |
| 23 |
17 |
ETB |
55 |
37 |
7 |
87 |
57 |
W |
119 |
77 |
w |
| 24 |
18 |
CAN |
56 |
38 |
8 |
88 |
58 |
X |
120 |
78 |
x |
| 25 |
19 |
EM |
57 |
39 |
9 |
89 |
59 |
Y |
121 |
79 |
y |
| 26 |
1A |
SUB |
58 |
3A |
: |
90 |
5A |
Z |
122 |
7A |
z |
| 27 |
1B |
ESC |
59 |
3B |
; |
91 |
5B |
[ |
123 |
7B |
{ |
| 28 |
1C |
FS |
60 |
3C |
< |
92 |
5C |
\ |
124 |
7C |
| |
| 29 |
1D |
GS |
61 |
3D |
= |
93 |
5D |
] |
125 |
7D |
} |
| 30 |
1E |
RS |
62 |
3E |
> |
94 |
5E |
^ |
126 |
7E |
~ |
| 31 |
1F |
US |
63 |
3F |
? |
95 |
5F |
_ |
127 |
7F |
DEL1 |
1 Not ASCII Text
Appendix H: IEEE floating point formats
(The material in this Appendix is not part
of this standard; it is adapted from the IEEE-754 floating
point standard (IEEE 1985) and provided for
informational purposes. It is not intended to be a comprehensive
description of the IEEE formats; readers should refer to the IEEE
standard.)
FITS recognizes all IEEE basic formats,
including the special values.
Numbers in the single and double formats are composed of the following
three fields:
- 1.
- 1-bit sign s
- 2.
- Biased exponent
- 3.
- Fraction

The range of the unbiased exponent E shall include every integer
between two values
and
, inclusive, and
also two other reserved values
to encode
and
denormalized numbers, and
+1 to encode
and
NaNs. The foregoing parameters are given in Table .6.
Each nonzero numerical value has just one encoding. The fields are
interpreted as follows:
A 32-bit single format number X is divided as shown in Fig.
.1. The value v of X is inferred from its constituent
fields thus
- 1.
- If e = 255 and
,
then v is NaN regardless of s
- 2.
- If e = 255 and f = 0, then
- 3.
- If
0 < e < 255, then
- 4.
- If e = 0 and
,
then
(denormalized numbers)
- 5.
- If e = 0 and f = 0, then
v = (-1)s0 (zero).
 |
Figure H.1:
Single Format. msb
means most significant bit,
lsb means least significant bit. |
A 64-bit double format number X is divided as shown in Fig.
.2. The value v of X is inferred from its constituent
fields thus
- 1.
- If e = 2047 and
,
then v is NaN regardless of s
- 2.
- If e = 2047 and f = 0, then
- 3.
- If
0 < e < 2047, then
- 4.
- If e = 0 and
,
then
(denormalized numbers)
- 5.
- If e = 0 and f = 0, then
v = (-1)s0 (zero).
 |
Figure H.2:
Double Format. msb means most significant bit,
lsb means least significant bit. |
Table .7 shows the types of IEEE floating point value,
whether regular or special, corresponding to all double and single
precision hexadecimal byte patterns.
Table H.2:
IEEE floating point formats.
| IEEE value |
Double Precision |
Single Precision |
| +0 |
0000000000000000 |
00000000 |
| denormalized |
0000000000000001 |
00000001 |
| |
to |
to |
| |
000FFFFFFFFFFFFF |
007FFFFF |
| positive underflow |
0010000000000000 |
00800000 |
| positive numbers |
0010000000000001 |
00800001 |
| |
to |
to |
| |
7FEFFFFFFFFFFFFE |
7F7FFFFE |
| positive overflow |
7FEFFFFFFFFFFFFF |
7F7FFFFF |
 |
7FF0000000000000 |
7F800000 |
| NaN1 |
7FF0000000000001 |
7F800001 |
| |
to |
to |
| |
7FFFFFFFFFFFFFFF |
7FFFFFFF |
| -0 |
8000000000000000 |
80000000 |
| negative |
8000000000000001 |
80000001 |
| denormalized |
to |
to |
| |
800FFFFFFFFFFFFF |
807FFFFF |
| negative underflow |
8010000000000000 |
80800000 |
| negative numbers |
8010000000000001 |
80800001 |
| |
to |
to |
| |
FFEFFFFFFFFFFFFE |
FF7FFFFE |
| negative overflow |
FFEFFFFFFFFFFFFF |
FF7FFFFF |
 |
FFF0000000000000 |
FF800000 |
| NaN1 |
FFF0000000000001 |
FF800001 |
| |
to |
to |
| |
FFFFFFFFFFFFFFFF |
FFFFFFFF |
1 Certain values may be designated as quiet NaN (no diagnostic
when used) or signaling (produces diagnostic when used) by
particular implementations.
Appendix I: Reserved extension type names
(This Appendix is not part of the NOST FITS Standard,
but is included for
informational purposes. It describes the
extension type names registered as of the date this standard was
issued.) Tables I.1 and I.2 give the currently reserved FITSextension type names. A current list is available from the
FITS Support Office at
http://fits.gsfc.nasa.gov/xtension.html
or
ftp://nssdc.gsfc.nasa.gov/pub/fits/xtension.lis
Table I.2.:
Status codes.
| Code |
Significance |
| D |
Draft extension proposal for discussion by regional FITS
committees. |
| L |
Local FITS extension. |
| P |
Proposed FITS extension
approved by regional FITS committees |
| |
but not by IAU FITS Working Group. |
| R |
Reserved type name for which a full draft proposal has not been
submitted. |
| S |
Standard extension approved by IAU FITS Working Group and |
| |
endorsed by the IAU. |
Table I.3:
Acronyms in list of registered extensions.
Acronym |
Meaning |
NRAO |
National Radio Astronomy Observatory |
| AIPS |
Astronomical Image Processing System |
| A/WWW |
A/WWW Enterprises |
| HDF |
Hierarchical Data Format |
Table J.1 lists NOST publications pertaining to the FITS
Standard.
Table J.1:
NOST publications.
| Document |
Title |
Date |
Status |
| NOST 100-0.1 |
FITS Standard |
December, 1990 |
Draft
Standard |
| |
|
|
|
| NOST 100-0.2 |
FITS Implementation Standard |
June, 1991 |
Revised
Draft Standard |
| NOST 100-0.3 |
FITS Implementation Standard |
December, 1991 |
Revised Draft Standard |
| NOST 100-1.0 |
FITS Definition Standard |
March, 1993 |
Proposed
Standard |
| NOST 100-1.0 |
FITS Definition Standard |
June, 1993 |
NOST
Standard |
| NOST 100-1.1 |
FITS Definition Standard |
June, 1995 |
Proposed
Standard |
| NOST 100-1.1 |
FITS Definition Standard |
September, 1995 |
NOST
Standard |
| NOST 100-1.2 |
FITS Definition Standard |
April, 1998 |
Draft
Standard |
| NOST 100-2.0 |
FITS Definition Standard |
March, 1999 |
NOST
Standard |
Copyright ESO 2001