home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / fits / spec / format.txt < prev    next >
Text File  |  1994-06-01  |  138KB  |  3,511 lines

  1.  
  2.  
  3.  
  4.  __________=====
  5.  __________=====
  6.  __________=====    NOST
  7.  
  8.  
  9.  
  10.             Implementation  of  the  Flexible  Image  Transport  System
  11.  
  12.                                       (FITS)
  13.  
  14.                                  November 6, 1991
  15.  
  16.                                   Draft Standard
  17.  
  18.                                    NOST 100-0.3b
  19.  
  20.  
  21.                       NASA/OSSA Office of Standards and Technology
  22.                       Code 933
  23.                       NASA Goddard Space Flight Center
  24.                       Greenbelt MD 20771
  25.                       USA
  26.  
  27.  
  28.  
  29.  
  30. The NASA/OSSA Office of Standards and Technology (NOST) has been established
  31. to serve the space science communities in evolving cost effective,
  32. interoperable data systems. The NOST performs a number of functions designed
  33. to facilitate the recognition, development, adoption, and use of standards by
  34. the space science communities.
  35.  
  36. Approval of a NOST Standard requires verification by the NOST that the
  37. following requirements have been met:  consensus of the technical panel,
  38. proper adjudication of the comments received from the targeted space and Earth
  39. science community, and conformance to the accreditation process.
  40.  
  41. A NOST standard represents the consensus of the technical panel convened by
  42. the NASA/OSSA Office of Standards and Technology (NOST) of the National Space
  43. Science Data Center (NSSDC) of the National Aeronautics and Space
  44. Administration (NASA). Consensus is established when the NOST Accreditation
  45. Panel determines that substantial agreement has been reached by the Technical
  46. Panel. However, consensus does not necessarily imply that all members were in
  47. full agreement with every item in the standard. NOST standards are not binding
  48. as published; however, they may serve as a basis for mandatory standards when
  49. adopted by NASA or other organizations. 
  50.  
  51. A NOST standard may be revised at any time, depending on developments in the
  52. areas covered by the standard. Also, within five years from the date of its
  53. issuance, this standard will be reviewed by the NOST to determine whether it
  54. should 1) remain in effect without change, 2) be changed to reflect the impact
  55. of new technologies or new requirements, or 3) be retired or canceled.
  56.  
  57. The Technical Panel that developed this standard consisted of the following
  58. members:
  59.  
  60.  
  61.       Robert J. Hanisch, Chair           Space Telescope Science Institute
  62.       Barry M. Schlesinger, Secretary    Hughes STX
  63.       Lee E. Brotzman                    Hughes STX
  64.       Edward Kemper                      Hughes STX
  65.       Peter J. Teuben                    University of Maryland
  66.       Michael E. Van Steenberg           NASA Goddard Space Flight Center
  67.       Wayne H. Warren Jr.                Hughes STX
  68.       Richard A. White                   NASA Goddard Space Flight Center
  69.  
  70. This standard is published and maintained by the NOST. Send comments and
  71. orders for NOST documents to:
  72.  
  73.  
  74.  
  75.            NOST, Code 933, NASA Goddard Space Flight Center
  76.            Greenbelt MD 20771
  77.            USA
  78.            Internet: nost@nssdca.gsfc.nasa.gov
  79.            DECNET: NSSDCA::NOST
  80.            301-286-3575
  81.  
  82.  
  83.  
  84.  
  85.  
  86. Contents
  87.  
  88.  
  89.  
  90. Introduction                                                          vii
  91.  
  92.  
  93. 1  Overview                                                             1 
  94.  
  95.    1.1  Purpose ......................................................  1
  96.    1.2  Scope ........................................................  1
  97.    1.3  Applicability ................................................  1
  98.    1.4  Organization and Recommendations .............................  2
  99.  
  100. 2  References                                                           3
  101.  
  102. 3  Definitions, Acronyms, and Symbols                                   5
  103.  
  104. 4  FITS File Organization                                               9
  105.  
  106.    4.1  Overall ......................................................  9
  107.    4.2  Individual FITS Structures ...................................  9
  108.    4.3  Primary Header and Data Array ................................  9
  109.       4.3.1   Primary Header ......................................... 10
  110.       4.3.2   Primary Data Array ..................................... 10
  111.    4.4  Extensions ................................................... 10
  112.       4.4.1   Requirements for Conforming Extensions ................. 10
  113.       4.4.2   Standard Extensions .................................... 11
  114.       4.4.3   Order of Extensions .................................... 11
  115.    4.5  Special Records .............................................. 12
  116.  
  117. 5  Headers                                                             13
  118.  
  119.    5.1  Card Images .................................................. 13
  120.       5.1.1   Syntax ................................................. 13
  121.       5.1.2   Components ............................................. 13
  122.    5.2  Keywords ..................................................... 14
  123.       5.2.1   Mandatory Keywords ..................................... 14
  124.       5.2.2   Other Reserved Keywords ................................ 17
  125.       5.2.3   Additional Keywords .................................... 21
  126.   5.3   Value ........................................................ 21
  127.       5.3.1   General Format Requirements ............................ 21
  128.       5.3.2   Fixed Format ........................................... 22
  129.  
  130. 6  Data Representation                                                 23
  131.  
  132.   6.1   Characters ................................................... 23
  133.   6.2   Integers ..................................................... 23
  134.       6.2.1   Eight-bit .............................................. 23
  135.       6.2.2   Sixteen-bit ............................................ 23
  136.       6.2.3   Thirty-two-bit ......................................... 23
  137.   6.3   IEEE-754 Floating Point ...................................... 24
  138.       6.3.1   Thirty-two-bit Floating Point .......................... 24
  139.       6.3.2   Sixty-four-bit Floating Point .......................... 24
  140.  
  141. 7  Random Groups Structure                                             27
  142.  
  143.   7.1   Keywords ..................................................... 27
  144.       7.1.1   Mandatory Keywords ..................................... 27
  145.       7.1.2   Reserved Keywords ...................................... 29
  146.   7.2   Data Sequence ................................................ 30
  147.   7.3   Data Representation .......................................... 30
  148.  
  149. 8   Standard Extensions                                                31
  150.  
  151.   8.1   ASCII Tables Extension ....................................... 31
  152.       8.1.1   Mandatory Keywords ..................................... 31
  153.       8.1.2   Other Reserved Keywords ................................ 33
  154.       8.1.3   Data Sequence .......................................... 34
  155.       8.1.4   Fields ................................................. 34
  156.       8.1.5   Entries ................................................ 34
  157.   8.2   Other Standard Extensions .................................... 35
  158.  
  159. 9  Restrictions on Changes                                             37
  160.  
  161.  
  162. Appendixes
  163.  
  164. A  Draft Proposal for Binary Table Extension                           39
  165.  
  166.   A.1   Abstract ..................................................... 39
  167.   A.2   Introduction ................................................. 40
  168.   A.3   Binary Tables ................................................ 40
  169.   A.4   Table Header ................................................. 40
  170.   A.5  Conventions for Multidimensional Arrays ....................... 43
  171.   A.6  Table Data Records ............................................ 43
  172.   A.7  Example Binary Table Header ................................... 45
  173.   A.8  Acknowledgments by Authors of Draft Proposal .................. 47
  174.   A.9  Appendixes to Draft Proposal for Binary Tables Extension ...... 48
  175.       A.9.1   "Multidimensional Array" Convention .................... 48
  176.       A.9.2   "Variable Length Array" Facility ....................... 48
  177.  
  178. B  Implementation on Physical Media                                    53
  179.  
  180.   B.1  Block Size .................................................... 53
  181.       B.1.1   Nine-Track, Half-Inch Magnetic Tape .................... 53
  182.       B.1.2   Other Media ............................................ 53
  183.   B.2  Physical Properties of Media .................................. 54
  184.   B.3  Labeling ...................................................... 54
  185.       B.3.1   Tape ................................................... 54
  186.       B.3.2   Other Media ............................................ 54
  187.   B.4  FITS File Boundaries .......................................... 54
  188.       B.4.1   Magnetic Reel Tape ..................................... 54
  189.       B.4.2   Other Media ............................................ 54
  190.   B.5  Multiple Physical Volumes ..................................... 54
  191.  
  192. C  Differences from IAU-endorsed Publications                          55
  193.  
  194. D  Summary of Keywords                                                 61
  195.  
  196. E  ASCII Text                                                          63
  197.  
  198. F  IEEE Special Formats                                                65
  199.  
  200. G  Reserved Extension Type Names                                       67
  201.  
  202. H  NOST Publications                                                   71
  203.  
  204. Index                                                                  73
  205.  
  206.  
  207.  List of Tables
  208.  
  209.  
  210.    5.1  Principal mandatory keywords. ................................ 14
  211.    5.2  Interpretation of valid BITPIX value. ........................ 15
  212.    5.3  Mandatory keywords in conforming extensions. ................. 16
  213.  
  214.    6.1  Content of 32-bit floating point bit positions. .............. 24
  215.    6.2   Content of 64-bit floating point bit positions. ............. 25
  216.  
  217.    7.1   Mandatory keywords in primary header preceding random groups. 28
  218.  
  219.    8.1   Mandatory keywords in ASCII tables extensions. .............. 32
  220.    8.2   Valid TFORMn format values in TABLE extensions. ............. 33
  221.  
  222.    D.1   Mandatory FITS keywords ..................................... 61
  223.    D.2   Reserved FITS keywords ...................................... 62
  224.    D.3   General Reserved FITS keywords .............................. 62
  225.  
  226.    E.1   ASCII character set ......................................... 64
  227.  
  228.    F.1   IEEE special floating point formats ......................... 65
  229.  
  230.    G.1   Reserved Extension Type Names ............................... 68
  231.    G.2   Status Codes ................................................ 69
  232.  
  233.    H.1   NOST Publications ........................................... 71
  234.  
  235.  
  236. List of Figures
  237.  
  238.  
  239.    4.1   Array data sequence ......................................... 11
  240.  
  241.  
  242.                                                                        
  243.  
  244. Introduction
  245.  
  246.  
  247.  
  248. The Flexible Image Transport System (FITS) evolved out of the recognition that
  249. a standard format was needed for transferring astronomical data from one
  250. installation to another. The original form, or Basic FITS [1], was designed
  251. for the transfer of images and consisted of a binary array, usually
  252. multidimensional, preceded by an ASCII text header with information describing
  253. the organization and contents of the array. The FITS concept was later
  254. expanded to accommodate more complex data formats. A new format for image
  255. transfer, random groups, was defined [2] in which the data would consist of a
  256. series of arrays, with each array accompanied by a set of associated
  257. parameters. These formats were formally endorsed by the International
  258. Astronomical Union (IAU) in 1982 [3]. Provisions for data structures other
  259. than simple arrays or groups were made later. These structures appear in
  260. extensions, each consisting of an ASCII header followed by the data whose
  261. organization it describes.  A set of general rules governing such extensions
  262. [4] and a particular extension ASCII Tables [5], were endorsed by the IAU
  263. General Assembly in 1988 [6]. At the same General Assembly, an IAU FITS
  264. Working Group was formed with the mandate to maintain the existing FITS
  265. standards and to review, approve, and maintain future extensions to FITS,
  266. recommended practices for FITS, implementations, and the thesaurus of approved
  267. FITS keywords [7].  In 1989, the IAU Commission 5 FITS Working Group approved
  268. a formal agreement [8] for the representation of floating point numbers. FITS
  269. was originally designed and defined for 9-track half-inch magnetic tape.
  270. However, as improvements in technology have brought forward other data storage
  271. and data distribution media, it has generally been agreed that the FITS format
  272. is to be understood as a logical format and not defined in terms of the
  273. physical characteristics of any particular data storage medium or media.
  274.  
  275.  
  276.  
  277.  
  278. Section  1
  279.  
  280.  
  281.  
  282. Overview
  283.  
  284.  
  285.  
  286. 1.1    Purpose
  287.  
  288.  
  289. This standard formally defines the implementation of the FITS format for data
  290. structuring and exchange to be used where applicable, as defined in Section
  291. 1.3. It is intended as a formal codification of the FITS format that has been
  292. endorsed by the IAU for transfer of astronomical data, fully consistent with
  293. all actions and endorsements of the IAU and the IAU Commission 5 FITS Working
  294. Group. Minor ambiguities and inconsistencies in FITS as described in the
  295. original papers are eliminated. The eventual goal is to submit this document
  296. to the IAU Commission 5 FITS Working Group for endorsement as a universal
  297. standard for FITS.
  298.  
  299.  
  300.  
  301. 1.2    Scope
  302.  
  303.  
  304. This standard specifies the organization and content of FITS data sets,
  305. including the header and data for all standard FITS formats: Basic FITS, the
  306. random groups structure, and the ASCII tables extension. It also specifies
  307. minimum structural requirements for new extensions and general principles
  308. governing the creation of new extensions, giving as an example the draft
  309. proposal for a Binary Table Extension.  For headers, it specifies the proper
  310. syntax for card images and defines required and reserved keywords. For data,
  311. it specifies character and value representations and the ordering of contents
  312. within the byte stream. It defines the general rules to which new extensions
  313. are required to conform.
  314.  
  315.  
  316.  
  317. 1.3    Applicability
  318.  
  319.  
  320. The IAU has recommended that all astronomical computer facilities support FITS
  321. for the interchange of binary data. All spacecraft projects and astrophysics
  322. data archives under the management of the Astrophysics Division of the
  323. National Aeronautics and Space Administration are required to make processed
  324. data available to users in the FITS format defined by this standard, unless
  325. the Astrophysics Division specifically determines otherwise. This standard may
  326. also be used to define the format for data transport in other disciplines, as
  327. may be determined by the appropriate authorities.
  328.  
  329.  
  330.  
  331. 1.4    Organization and Recommendations
  332.  
  333.  
  334. Following the definitions in Section 3, this document describes the overall
  335. organization of a FITS file, the contents of the first (primary) header and
  336. data, and the rules for creating new FITS extensions in Section 4. The next
  337. two sections provide additional details on the header and data, with a
  338. particular focus on the primary header. Section 5 provides details about
  339. header card image syntax and specifies those keywords required and reserved in
  340. a primary header. Section 6 describes how different data types are rep-
  341. resented in FITS. The following sections describe the headers and data of two
  342. standard FITS structures, the now to be deprecated random groups records
  343. (Section 7) and the only current standard extension, ASCII Tables (Section 8).
  344. Throughout the document, deprecation of structures or syntax is noted where
  345. relevant. Files containing deprecated features are valid FITS, but these
  346. features should not be used in new files; the old files using them remain
  347. standard because of the principle that no change in FITS shall cause a valid
  348. FITS file to become invalid.
  349.  
  350. The Appendixes contain material that is not part of the standard. The first
  351. two provide illustrations of FITS practice. Appendix A provides an example of
  352. a conforming extension, the draft proposal for the Binary Table Extension[9].
  353. The generally accepted recommendations for the expression of the logical FITS
  354. format on various physical media are provided in Appendix B as a guide to FITS
  355. practices. The next, Appendix C, lists the differences between this standard
  356. and the specifications of prior publications; it also identifies those
  357. ambiguities in the documents endorsed by the IAU on which this standard
  358. provides specific rules. The next four provide reference information: a
  359. tabular summary of the FITS keywords (Appendix D), a list of the ASCII
  360. character set and a subset designated ASCII text (Appendix E), the bit
  361. representation of the IEEE special values (Appendix F), and a list of the
  362. reserved extension type names (Appendix G).
  363.  
  364.  
  365.  
  366. Section  2
  367.  
  368.  
  369.  
  370. References
  371.  
  372.  
  373.  
  374. 1. Wells, D. C., Greisen, E. W., and Harten, R. H. 1981, "FITS: A Flexible
  375.    Image Transport System," Astron. Astrophys. Suppl., 44, 363-370.
  376.  
  377.  
  378. 2. Greisen, E. W. and Harten, R. H. 1981, "An Extension of FITS for Small
  379.    Arrays of Data," Astron. Astrophys. Suppl., 44, 371-374.
  380.  
  381.  
  382. 3. IAU. 1983, Information Bulletin No. 49.
  383.  
  384.  
  385. 4. Grosbol, P., Harten, R. H., Greisen, E. W., and Wells, D. C. 1988,
  386.    "Generalized Extensions and Blocking Factors for FITS," Astron. Astrophys.
  387.    Suppl., 73, 359-364.
  388.  
  389.  
  390. 5. Harten, R. H., Grosbol, P., Greisen, E. W., and Wells, D. C. 1988, 
  391.    "The FITS Tables Extension," Astron. Astrophys. Suppl., 73, 365-372.
  392.  
  393.  
  394. 6. IAU. 1988, Information Bulletin No. 61.
  395.  
  396.  
  397. 7. McNally, D., ed.  1988, Transactions of the IAU, Proceedings of the
  398.    Twentieth General Assembly. (Dordrecht:Kluwer).
  399.  
  400.  
  401. 8. Wells, D. C. and Grosbol, P. 1990, "Floating Point Agreement for FITS."
  402.    (available from the NOST FITS Support Office)
  403.  
  404.  
  405. 9. Cotton, W. D. and Tody, D. B. 1991 "Binary Table Extension to FITS: A 
  406.    Proposal", preprint.  (access instructions available from the NOST FITS 
  407.    Support Office).
  408.  
  409.  
  410. 10.  ANSI, 1978, "American National Standard for Information Processing:
  411.      Programming Language FORTRAN," ANSI X3.9 - 1978 (ISO 1539). Published by
  412.      American National Standards Institute, Inc., New York.
  413.  
  414.  
  415. 11.  ANSI, 1977 "American National Standard for Information Processing: Code
  416.      for Information Interchange," ANSI X3.4 - 1977 (ISO 646). Published by
  417.      American National Standards Institute, Inc., New York.
  418.  
  419.  
  420. 12.  IEEE, 1985, "American National Standard - IEEE Standard for Binary Float-
  421.      ing Point Arithmetic". ANSI/IEEE 754-1985, Published by American National
  422.      Standards Institute, Inc., New York.
  423.  
  424.  
  425. 13.  ANSI, 1976, "American National Standard for Information Processing: 
  426.      Unrecorded Magnetic Tape," ANSI X3.40 - 1976, Published by American 
  427.      National Standards Institute, Inc., New York.
  428.  
  429.  
  430. 14.  ANSI, 1978, "American National Standard for Information Processing:
  431.      Magnetic Tape Labels and File Structure," ANSI X3.27 - 1978, Published by
  432.      American National Standards Institute, Inc., New York.
  433.  
  434.  
  435. 15.  "Going AIPS," National Radio Astronomy Observatory, Charlottesville, VA,
  436.      1990.
  437.  
  438.  
  439. 16.  Munoz, J. R., "IUE Data in FITS Format," ESA IUE Newsletter 32, 12-45.
  440.  
  441.  
  442.  
  443.  
  444. Section  3
  445.  
  446.  
  447.  
  448. Definitions, Acronyms, and Symbols
  449.  
  450.  
  451.  
  452.   _               Used to designate an ASCII blank.
  453.  
  454. AIPS              Abbreviation of Astronomical Image Processing System.
  455.  
  456. ANSI              Abbreviation of American National Standards Institute.
  457.  
  458. Array             A sequence of data values, of zero or more dimensions.
  459.  
  460. Array value       The value of an element of an array in a FITS file, without
  461.                   the application of the associated linear transformation.
  462.  
  463. ASCII             Abbreviation of American National Standard Code for 
  464.                   Information Interchange.
  465.  
  466. ASCII blank       Hexadecimal 20.
  467.  
  468. ASCII character   Any member of the 7-bit ASCII character set.
  469.  
  470. ASCII text        ASCII characters hexadecimal 20-7E.
  471.  
  472. Basic FITS        The FITS structure consisting of the primary header followed
  473.                   by a single primary data array.
  474.  
  475. Bit               A single binary digit.
  476.  
  477. Byte              A string of eight bits treated as a single entity.
  478.  
  479. Card image        A sequence of 80 bytes containing ASCII text, treated as a
  480.                   logical record.
  481.  
  482. Conforming extension   An extension whose keywords and organization adhere to 
  483.                   the requirements for conforming extensions defined in 
  484.                   Section 4.4.1 of this standard.
  485.  
  486. Deprecate         To express earnest disapproval of. This term is used to
  487.                   refer to obsolete structures that ought not to be used but 
  488.                   remain valid.
  489.  
  490. Entry             A single value in a table.
  491.  
  492. Extension         A FITS HDU appearing after the primary HDU in a FITS file.
  493.  
  494.  
  495. Extension name    The identifier used to distinguish a particular extension
  496.                   HDU from others of the same type, appearing as the value of 
  497.                   the EXTNAME keyword.
  498.  
  499. Extension type    An extension format.
  500.  
  501. Field             A set of zero or more table entries collectively described
  502.                   by a single format.
  503.  
  504. File              A sequence of one or more records terminated by an
  505.                   end-of-file indicator appropriate to the medium.
  506.  
  507. FITS              Abbreviation of Flexible Image Transport System.
  508.  
  509. FITS file         A file with a format that conforms to the specifications in
  510.                   this document.
  511.  
  512. FITS logical record  A record of 23040 bits, corresponding to 2880 8-bit bytes
  513.                   within a FITS file.
  514.  
  515.  
  516. FITS structure    One of the components of a FITS file: the primary HDU, the
  517.                   random groups records, an extension, or, collectively, the 
  518.                   special records following the last extension.
  519.  
  520. Floating point    A number whose bit structure is composed of a mantissa and
  521.                   exponent, whose ASCII representation contains an explicit 
  522.                   decimal point and may include a power-of-ten exponent.
  523.  
  524. Group parameter value   The value of one of the parameters preceding a group
  525.                   in the random groups structure, without the application of 
  526.                   the associated linear transformation.
  527.  
  528. Header            A series of card images organized within one or more FITS
  529.                   Logical Records which describes structures and/or data which 
  530.                   follow it in the FITS file.
  531.  
  532. Header and Data Unit (HDU)     A data structure consisting of a Header and the
  533.                   data the Header describes. Note that an HDU may consist 
  534.                   entirely of a header with no data records.
  535.  
  536. IAU               Abbreviation of International Astronomical Union.
  537.  
  538. IUE               Abbreviation of International Ultraviolet Explorer.
  539.  
  540. IEEE              Abbreviation of Institute of Electrical and Electronic
  541.                   Engineers.
  542.  
  543. IEEE NaN          Abbreviation of IEEE Not-a-Number value.
  544.  
  545. IEEE special values   (-0, 1, NaN).
  546.  
  547. Indexed keyword   A keyword that is of the form of a fixed root with an
  548.                   appended integer count.
  549.  
  550. Keyword           The first eight bytes of a header card image.
  551.  
  552. Mandatory keyword   A keyword that must be used in all FITS files or a keyword
  553.                   required in conjunction with particular FITS structures.
  554.  
  555. Matrix            A data array of two or more dimensions.
  556.  
  557. MIDAS             Abbreviation of ESO-MIDAS, the European Southern Observatory
  558.                   Munich Image Data Analysis System.
  559.  
  560. NOAO              Abbreviation of National Optical Astronomy Observatories.
  561.  
  562. NOST              Abbreviation of NASA/OSSA Office of Standards and Technology.
  563.  
  564. NRAO              Abbreviation of National Radio Astronomy Observatory.
  565.  
  566. Physical value    The value in physical units represented by a member of an
  567.                   array and possibly derived from the array value using the 
  568.                   associated, but optional, linear transformation.
  569.  
  570. Picture element   A single location within an image array.
  571.  
  572. Pixel             Abbreviation of "picture element".
  573.  
  574. Primary data array   The data array contained in the Primary HDU.
  575.  
  576.  
  577. Primary header    The first header in a FITS file, containing information on
  578.                   the overall contents of the file as well as on the primary 
  579.                   data array.
  580.  
  581. Record            A sequence of bits treated as a single logical entity.
  582.  
  583. Reference point   The point along a given coordinate axis, given in units of
  584.                   pixel number, at which a value and increment are defined.
  585.  
  586. Reserved keyword  An optional keyword that may be used only in the manner
  587.                   defined in this standard.
  588.  
  589. Special records   A series of 23040-bit (2880 8-bit byte) records, following
  590.                   the primary HDU, whose internal structure does not otherwise
  591.                   conform to that for the primary HDU or to that specified for 
  592.                   a conforming extension in this standard.
  593.  
  594. Standard extension   A conforming extension whose header and data content are
  595.                   specified explicitly in this standard.
  596.  
  597. Type name         The value of the XTENSION keyword used to identify the type
  598.                   of the extension in the data following.
  599.  
  600. Valid value       A member of a data array or table corresponding to an actual
  601.                   physical quantity.
  602.  
  603.  
  604.  
  605.  
  606. Section  4
  607.  
  608.  
  609.  
  610. FITS  File  Organization
  611.  
  612.  
  613.  
  614. 4.1    Overall
  615.  
  616.  
  617. A FITS file shall be composed of the following FITS structures, in the order
  618. listed:
  619.  
  620.    o Primary HDU
  621.  
  622.    o Random Groups structure (optional; allowed only if there is no primary 
  623.      data array)
  624.  
  625.    o Conforming Extensions (optional)
  626.  
  627.    o Other special records (optional)
  628.  
  629. Each FITS structure shall consist of an integral number of FITS logical
  630. records. The primary HDU shall start with the first record of the FITS file.
  631. The first record of each subsequent FITS structure shall be the record
  632. immediately following the last record of the preceding FITS structure. The
  633. size of a FITS logical record shall be 23040 bits, corresponding to 2880 8-bit
  634. bytes.
  635.  
  636.  
  637.  
  638. 4.2    Individual FITS Structures
  639.  
  640.  
  641. The primary HDU and every extension HDU shall consist of an integral number of
  642. header records consisting of ASCII text, which may be followed by an integral
  643. number of data records. The first record of data shall be the record
  644. immediately following the last record of the header.
  645.  
  646.  
  647.  
  648. 4.3    Primary Header and Data Array
  649.  
  650.  
  651. The first component of a FITS file shall be the primary header. The primary
  652. header may, but need not be, followed by a primary data array. The presence or
  653. absence of a primary data array shall be indicated by the values of the NAXIS
  654. or NAXISn keywords in the primary header (Section 5.2.1.1).
  655.  
  656.  
  657.  
  658. 4.3.1    Primary Header
  659.  
  660.  
  661. The header of a primary HDU shall consist of a series of card images in ASCII
  662. text. All header records shall consist of 36 card images. Card images without
  663. information shall be filled with ASCII blanks (hexadecimal 20).
  664.  
  665.  
  666.  
  667. 4.3.2    Primary Data Array
  668.  
  669.  
  670. In FITS format, the primary data array shall consist of a single data array of
  671. 0-999 dimensions. The data values shall be a byte stream with no embedded
  672. fill or blank space. The first value shall be in the first position of the
  673. first primary data array record. The first value of each subsequent row of the
  674. array shall be in the position immediately following the last value of the
  675. previous row. Arrays of more than one dimension shall consist of a sequence
  676. such that the index along axis 1 varies most rapidly, that along axis 2 next
  677. most rapidly, and those along subsequent axes progressively less rapidly, with
  678. that along axis m, where m is the value of NAXIS, varying least rapidly; i.e.,
  679. the elements of an array A(x1, x2, ..., xm ) shall be in the order shown in
  680. Figure 4.1. The index count along each axis shall begin with 1 and increment
  681. by 1 up to the value of the NAXISn keyword (Section 5.2.1.1), If the data
  682. array does not fill the final record, the remainder of the record shall be
  683. filled with zero values with the same data repre- sentation as the values in
  684. the array. For IEEE floating point data, values of +0. shall be used to fill
  685. the remainder of the record.
  686.  
  687.  
  688.  
  689. 4.4    Extensions
  690.  
  691.  
  692.  
  693. 4.4.1    Requirements for Conforming Extensions
  694.  
  695.  
  696. All extensions, whether or not further described in this standard, shall
  697. fulfill the following requirements to be in conformance with this FITS
  698. standard.
  699.  
  700.  
  701.  
  702. 4.4.1.1    Identity
  703.  
  704.  
  705. Each extension type shall have a unique type name, specified in the header
  706. according to the syntax codified in Section 5.2.1.2.  To preclude conflict,
  707. extension type names must be registered with the IAU Commission 5 FITS Working
  708. Group. The NOST shall maintain and provide a list of the registered
  709. extensions.
  710.  
  711.  
  712.                          A(1, 1, ..., 1),
  713.                          A(2, 1, ..., 1),
  714.                                  ...,
  715.                     A(NAXIS1, 1, ..., 1),
  716.                          A(1, 2, ..., 1),
  717.                          A(2, 2, ..., 1),
  718.                                  ...,
  719.                     A(NAXIS1, 2, ..., 1),
  720.                                  ...,
  721.                     A(1, NAXIS2, ..., NAXISm),
  722.                                  ...,
  723.                A(NAXIS1, NAXIS2, ..., NAXISm)
  724.  
  725.  
  726. Figure 4.1: Arrays of more than one dimension shall consist of a sequence such
  727.             that the index along axis 1 varies most rapidly and those along 
  728.             subsequent axes progressively less rapidly. Except for the 
  729.             location of the first element, array structure is independent of 
  730.             record structure.
  731.  
  732.  
  733.  
  734. 4.4.1.2    Size Specification
  735.  
  736.  
  737. The total number of bits in the data of each extension shall be specified in
  738. the header for that extension, in the manner prescribed in Section 5.2.1.2.
  739.  
  740.  
  741.  
  742. 4.4.1.3    Compatibility with Existing FITS Files
  743.  
  744.  
  745. No extension shall be constructed that invalidates existing FITS files.
  746.  
  747.  
  748.  
  749. 4.4.2    Standard Extensions
  750.  
  751.  
  752. A standard extension shall be a conforming extension whose organization and
  753. content are completely specified in this standard. Only one FITS format shall
  754. be approved for each type of data organization. Each standard extension shall
  755. have a unique type name.
  756.  
  757.  
  758.  
  759. 4.4.3    Order of Extensions
  760.  
  761.  
  762. An extension may follow the primary HDU (or random groups records if present)
  763. or another conforming extension.  Standard extensions and other conforming
  764. extensions may appear in any order in a FITS file.
  765.  
  766.  
  767.  
  768. 4.5    Special Records
  769.  
  770.  
  771. The first 8 bytes of special records must not contain the string "XTENSION".
  772. It is recommended that they not contain the string "SIMPLE ". The records must
  773. have the standard FITS 23040-bit record length. The contents of special
  774. records are not otherwise specified by this standard.
  775.  
  776.  
  777.  
  778.  
  779.  
  780. Section  5
  781.  
  782.                 
  783.  
  784. Headers
  785.  
  786.  
  787.  
  788. 5.1    Card Images
  789.  
  790.  
  791.  
  792. 5.1.1    Syntax
  793.  
  794.  
  795. Header card images shall consist of a keyword, an optional value, and an
  796. optional comment.  If a value is present, column 9 shall contain an equal sign
  797. (hexadecimal 3D, "="), column 10 shall contain an ASCII blank (hexadecimal
  798. 20), and columns 11-80 shall be as specified in the remainder of Section 5.2.
  799. If no value is present, columns 9-80 may contain any ASCII text. Except where
  800. specifically stated otherwise in this standard, keywords may appear in any
  801. order.
  802.  
  803.  
  804.  
  805. 5.1.2    Components
  806.  
  807.  
  808. 5.1.2.1    Keyword (bytes 1-8)
  809.  
  810.  
  811. The keyword shall be a left justified, 8-character, blank filled, ASCII string
  812. with no embedded blanks. All digits (hexadecimal 30 to 39,"0123456789") and
  813. upper case Latin alphabetic characters (hexadecimal 41 to 5A, "ABCDEFG HIJKLMN
  814. OPQRST UVWXYZ") are permitted; no lower case characters shall be used.  The
  815. underscore (hexadecimal 5F, "_") and hyphen (hexadecimal 2D, "-") are also
  816. permitted. No other characters are permitted. For indexed keywords, the
  817. counter shall not have leading zeroes.
  818.  
  819.  
  820.  
  821. 5.1.2.2    Value Indicator (bytes 9-10)
  822.  
  823.  
  824. This field shall contain an ASCII "= " for keywords with an associated value
  825. field. If there is no associated value field, this field may contain any ASCII
  826. text.
  827.  
  828.  
  829.  
  830. 5.1.2.3    Value/Comment
  831.  
  832.  
  833. This field, when used, shall contain the value, if any, of the keyword,
  834. followed by optional comments. Separation of the value and comments by a slash
  835. (hexadecimal 2F, "/"), and a space between the value and the slash are
  836. strongly recommended. The value shall be the ASCII representation of a string
  837. or constant, in the format specified in Section 5.3.  The value field must be
  838. written in a notation consistent with list-directed read operations in ANSI
  839. FORTRAN-77 [10]. The comment may contain any ASCII text.
  840.  
  841.  
  842.  
  843. 5.2    Keywords
  844.  
  845.  
  846. 5.2.1    Mandatory Keywords
  847.  
  848.  
  849. Mandatory keywords are required as described in the remainder of this
  850. subsection. They may be used only as described in this standard.
  851.  
  852.  
  853.  
  854. 5.2.1.1    Principal
  855.  
  856.  
  857. Principal mandatory keywords other than SIMPLE are required in all FITS
  858. headers. The SIMPLE keyword is required in all primary headers. The card
  859. images of any primary header must contain the keywords shown in Table 5.1 in
  860. the order given.
  861.  
  862.  
  863.  
  864.                     1   SIMPLE
  865.                     2   BITPIX
  866.                     3   NAXIS
  867.                     4   NAXISn, n = 1,:: :, NAXIS
  868.                          ...
  869.                        (other keywords)
  870.                          ...
  871.                    last  END
  872.  
  873.  
  874.  
  875.                 Table 5.1: Principal mandatory keywords.
  876.  
  877.  
  878. The total number of bits in the primary data array, exclusive of fill that is
  879. needed after the data to complete the last record (Section 4.1), must be given
  880. by the following expression:
  881.  
  882.  
  883.  
  884.               NBITS    =  |BITPIX  | x
  885.  
  886.                       (NAXIS1  x NAXIS2  x ... x NAXISm  );            (5.1)
  887.  
  888.  
  889.  
  890. where NBITS is non-negative and the number of bits excluding fill, m is the
  891. value of NAXIS, and BITPIX and the NAXISn represent the values associated with
  892. those keywords.
  893.  
  894.  
  895.  
  896. SIMPLE Keyword  The value field shall contain a logical constant with the
  897. value T if the file conforms to this standard.  This keyword is mandatory only
  898. for the primary header. A value of F signifies that the file does not conform
  899. to this standard in some significant way.
  900.  
  901.  
  902.  
  903. BITPIX Keyword  The value field shall contain an integer.  The absolute value
  904. is used in computing the sizes of data structures. It shall specify the number
  905. of bits that represent a data value. The only valid values of BITPIX are given
  906. in Table 5.2.
  907.  
  908.  
  909.  
  910.            Value           Data_Represented
  911.          ________________________________________________________
  912.              8     Character or unsigned binary integer
  913.             16     16-bit twos complement binary integer
  914.             32     32-bit twos complement binary integer
  915.            -32     IEEE single precision floating point
  916.            -64     IEEE double precision floating point
  917.          ________________________________________________________
  918.  
  919.  
  920.  
  921.           Table 5.2: Interpretation of valid BITPIX value.
  922.  
  923.  
  924.  
  925. NAXIS Keyword  The value field shall contain a non-negative integer no greater
  926. than 999, representing the number of axes in an ordinary data array. A value
  927. of zero signifies that no data follow the header in the HDU.
  928.  
  929.  
  930.  
  931. NAXISn Keywords  The value field of this indexed keyword shall contain a non-
  932. negative integer, representing the number of positions along axis n of an
  933. ordinary data array. The NAXISn must be present for all values n = 1, ..., 
  934. NAXIS. A value of zero for any of the NAXISn signifies that no data follow the
  935. header in the HDU. If NAXIS is equal to 0, there should not be any NAXISn
  936. keywords.
  937.  
  938.  
  939.  
  940. END Keyword  This keyword has no associated value.  Columns 9-80 shall be
  941. filled with ASCII blanks.
  942.  
  943.  
  944.  
  945. 5.2.1.2    Conforming Extensions
  946.  
  947.  
  948. The use of extensions necessitates a single additional keyword in the primary
  949. header of the FITS file.
  950.  
  951.  
  952. EXTEND Keyword  If the FITS file may contain extensions, a card image with the
  953. keyword EXTEND and the value field containing the logical value T must appear
  954. in the primary header immediately after the last NAXISn card image, or, if
  955. NAXIS=0, the NAXIS card image. The presence of this keyword with the value T
  956. in the primary header does not require that extensions be present.
  957.  
  958.  
  959. The card images of any extension header must use the keywords defined in Table
  960. 5.3 in the order specified. This organization is required for any conforming
  961. extension, whether or not further specified in this standard.
  962.  
  963.  
  964.  
  965.                   1   XTENSION
  966.                   2   BITPIX
  967.                   3   NAXIS
  968.                   4   NAXISn, n = 1,:: :, NAXIS
  969.                          ...
  970.                       (other keywords, including ...)
  971.                       PCOUNT
  972.                       GCOUNT
  973.                         ...
  974.                  last   END
  975.  
  976.  
  977.  
  978.           Table 5.3: Mandatory keywords in conforming extensions.
  979.  
  980.  
  981. The total number of bits in the extension data array exclusive of fill that is
  982. needed after the data to complete the last record (Section 4.1) such as that
  983. for the primary data array (Section 4.3.2) must be given by the following
  984. expression:
  985.  
  986.  
  987.  
  988.           NBITS    =  | BITPIX | x GCOUNT x
  989.  
  990.                    (PCOUNT + NAXIS1 x NAXIS2 x ... x NAXISm  );         (5.2)
  991.  
  992. where NBITS is non-negative and the number of bits excluding fill, m is the
  993. value of NAXIS, and BITPIX, GCOUNT, PCOUNT, and the NAXISn represent the
  994. values associated with those keywords.
  995.  
  996.  
  997.  
  998. XTENSION Keyword  The value field shall contain a character string giving the
  999. name of the extension type. This keyword is mandatory for an extension header
  1000. and must not appear in the primary header. For an extension that is not a
  1001. standard extension, the type name must not be the same as that of a standard
  1002. extension. The IAU Commission 5 FITS Working Group may specify additional type
  1003. names that must be used only to identify specific types of extensions; the
  1004. full list shall be available from the NOST.
  1005.  
  1006.  
  1007. PCOUNT Keyword  The value field shall contain an integer that shall be used in
  1008. any way appropriate to define the data structure, consistent with equation 5.2.
  1009.  
  1010.  
  1011.  
  1012. GCOUNT Keyword  The value field shall contain an integer that shall be used in
  1013. any way appropriate to define the data structure, consistent with equation 5.2.
  1014.  
  1015.  
  1016.  
  1017. 5.2.2    Other Reserved Keywords
  1018.  
  1019.  
  1020. These keywords are optional but may be used only as defined in this standard.
  1021. These keywords apply to any FITS structure except where specifically further
  1022. restricted.
  1023.  
  1024.  
  1025.  
  1026. 5.2.2.1    Keywords Describing the History or Physical Construction of the HDU
  1027.  
  1028.  
  1029. DATE Keyword  The value field shall contain a character string giving the date
  1030. on which the HDU was created, in the form DD/MM/YY, where DD shall be the day
  1031. of the month, MM the month number, with January given by 01 and December by
  1032. 12, and YY the last two digits of the year.  Specification of the date using
  1033. Universal Time is recommended. Copying of a FITS file does not require
  1034. changing any of the keyword values in the file's HDUs.
  1035.  
  1036.  
  1037.  
  1038. ORIGIN Keyword  The value field shall contain a character string identifying
  1039. the organization creating the FITS file.
  1040.  
  1041.  
  1042.  
  1043. BLOCKED Keyword  This keyword may be used only in the primary header. It shall
  1044. appear within the first 36 card images of the FITS file.  (Note: This keyword
  1045. thus cannot appear if NAXIS is greater than 31, or if NAXIS greater than 30
  1046. and the EXTEND keyword is present.) Its presence with the required logical
  1047. value of T advises that the physical block size of the FITS file on which it
  1048. appears may be an integral multiple of the logical record length, and not
  1049. necessarily equal to it. Physical block size and logical record length may be
  1050. equal even if this keyword is present or unequal if it is absent. It is
  1051. reserved primarily to prevent its use with other meanings. The issuance of
  1052. this standard deprecates the BLOCKED keyword.
  1053.  
  1054.  
  1055.  
  1056. 5.2.2.2    Keywords Describing Observations
  1057.  
  1058.  
  1059. DATE-OBS Keyword  The value field shall contain a character string giving the
  1060. day on which the observations represented by the array were made, in the form
  1061. DD/MM/YY, where DD shall be the day of the month, MM the month number, with
  1062. January given by 01 and December by 12, and YY the last two digits of the
  1063. year. Specification of the date using Universal Time is recommended.
  1064.  
  1065.  
  1066. TELESCOP Keyword  The value field shall contain a character string identifying
  1067. the telescope used to acquire the data contained in the array.
  1068.  
  1069.  
  1070. INSTRUME Keyword  The value field shall contain a character string identifying
  1071. the instrument used to acquire the data contained in the array.
  1072.  
  1073.  
  1074. OBSERVER Keyword  The value field shall contain a character string identifying
  1075. who acquired the data associated with the header. This keyword is appropriate
  1076. when the data describe the results of observations.
  1077.  
  1078.  
  1079. OBJECT Keyword  The value field shall contain a character string giving the
  1080. name of the object observed.
  1081.  
  1082.  
  1083. EQUINOX Keyword  The value field shall contain a floating point number giving
  1084. the equinox in years for the celestial coordinate system in which positions
  1085. given in either the header or data are expressed.
  1086.  
  1087.  
  1088. EPOCH Keyword  The value field shall contain a floating point number giving
  1089. the equinox in years for the celestial coordinate system in which positions
  1090. given in either the header or data are expressed.  This document deprecates
  1091. the use of the EPOCH keyword and thus it shall not be used in FITS files
  1092. created after the adoption of this standard; rather, the EQUINOX keyword shall
  1093. be used.
  1094.  
  1095.  
  1096.  
  1097. 5.2.2.3    Bibliographic Keywords
  1098.  
  1099.  
  1100. AUTHOR Keyword  The value field shall contain a character string identifying
  1101. who compiled the information in the data associated with the header.  This
  1102. keyword is appropriate when the data originate in a published paper or are
  1103. compiled from many sources.
  1104.  
  1105.  
  1106.  
  1107. REFERENC Keyword  The value field shall contain a character string citing a
  1108. reference where the data associated with the header are published.
  1109.  
  1110.  
  1111.  
  1112. 5.2.2.4    Commentary Keywords
  1113.  
  1114.  
  1115. COMMENT Keyword  This keyword shall have no associated value; columns 9-80 may
  1116. contain any ASCII text. Any number of COMMENT card images may appear in a
  1117. header.
  1118.  
  1119.  
  1120. HISTORY Keyword  This keyword shall have no associated value; columns 9-80 may
  1121. contain any ASCII text.  The text should contain a history of steps and
  1122. procedures associated with the processing of the associated data.  Any number
  1123. of HISTORY card images may appear in a header.
  1124.  
  1125.  
  1126.  
  1127. Keyword Field is Blank  Columns 1-8 contain ASCII blanks. Columns 9-80 may
  1128. contain any ASCII text. Any number of card images with blank keyword fields
  1129. may appear in a header.
  1130.  
  1131.  
  1132.  
  1133. 5.2.2.5    Array Keywords
  1134.  
  1135.  
  1136. These keywords are used to describe the contents of an array, either alone or
  1137. in a series of random groups. They are optional, but if they appear in the
  1138. header describing an array or groups, they must be used as defined in this
  1139. section of this standard. They shall not be used in headers describing other
  1140. structures unless the meaning is the same as that for a primary or groups
  1141. array.
  1142.  
  1143.  
  1144.  
  1145. BSCALE Keyword  This keyword shall be used, along with the BZERO keyword, when
  1146. the array pixel values are not the true physical values, to transform the
  1147. primary data array values to the true physical values they represent, using
  1148. equation 5.3. The value field shall contain a floating point number
  1149. representing the coefficient of the linear term in the scaling equation, the
  1150. ratio of physical value to array value at zero offset. The default value for
  1151. this keyword is 1.0.
  1152.  
  1153.  
  1154.  
  1155. BZERO Keyword  This keyword shall be used, along with the BSCALE keyword, when
  1156. the array pixel values are not the true physical values, to transform the
  1157. primary data array values to the true values. The value field shall contain a
  1158. floating point number representing the physical value corresponding to an
  1159. array value of zero. The default value for this keyword is 0.0. The
  1160. transformation equation is as follows:
  1161.  
  1162.  
  1163.              physical value    =   BZERO + BSCALE  x array value    (5.3)
  1164.  
  1165.  
  1166.  
  1167. BUNIT Keyword  The value field shall contain a character string, describing
  1168. the physical units in which the quantities in the array, after application
  1169. of BSCALE and BZERO, are expressed. Use of the units defined in the IAU Style
  1170. Manual [7] is recommended.
  1171.  
  1172.  
  1173.  
  1174. BLANK Keyword  This keyword shall be used only in headers with positive values
  1175. of BITPIX (i.e. in arrays with integer data). Columns 1-8 contain the string,
  1176. "BLANK  " (ASCII blanks in columns 6-8). The value field shall contain an
  1177. integer that specifies the representation of array values whose physical
  1178. values are undefined.
  1179.  
  1180.  
  1181. CTYPEn Keywords  The value field shall contain a character string, giving the
  1182. name of the coordinate represented by axis n. Where this coordinate represents
  1183. a physical quantity, units defined in the IAU Style Manual [7] are
  1184. recommended.
  1185.  
  1186.  
  1187. CRPIXn Keywords  The value field shall contain a floating point number,
  1188. identifying the location of a reference point along axis n, in units of the
  1189. axis index. This value is based upon a counter that runs from 1 to NAXISn with
  1190. an increment of 1 per pixel. The reference point value need not be that for
  1191. the center of a pixel nor lie within the actual data array. Use comments to
  1192. indicate the location of the index point relative to the pixel.
  1193.  
  1194.  
  1195.  
  1196. CRVALn Keywords  The value field shall contain a floating point number, giving
  1197. the value of the coordinate specified by the CTYPEn keyword at the reference
  1198. point CRPIXn.
  1199.  
  1200.  
  1201.  
  1202. CDELTn Keywords  The value field shall contain a floating point number, giving
  1203. the partial derivative of the coordinate specified by the CTYPEn keywords with
  1204. respect to the pixel index, evaluated at the reference point CRPIXn, in units
  1205. of the coordinate specified by the CTYPEn keyword.
  1206.  
  1207.  
  1208.  
  1209. CROTAn Keywords  This keyword is used to indicate a rotation from a standard
  1210. coordinate system described by the CTYPEn to a different coordinate system in
  1211. which the values in the array are actually expressed. Rules for such rotations
  1212. are not further specified in this standard; the rotation should be explained
  1213. in comments. The value field shall contain a floating point number, giving the
  1214. rotation angle in degrees between axis n and the direction implied by the
  1215. coordinate system defined by CTYPEn.
  1216.  
  1217.  
  1218.  
  1219. DATAMAX Keyword  The value field shall always contain a floating point number,
  1220. regardless of the value of BITPIX. This number shall give the maximum valid
  1221. physical value represented in the array, exclusive of any special values.
  1222.  
  1223.  
  1224. DATAMIN Keyword  The value field shall always contain a floating point number,
  1225. regardless of the value of BITPIX. This number shall give the minimum valid
  1226. physical value represented in the array, exclusive of any special values.
  1227.  
  1228.  
  1229.  
  1230. 5.2.2.6    Extension Keywords
  1231.  
  1232.  
  1233. These keywords are used to describe an extension.
  1234.  
  1235.  
  1236.  
  1237. EXTNAME Keyword  The value field shall contain a character string, to be used
  1238. to distinguish among different extensions of the same type, i.e., with the
  1239. same value of XTENSION, in a FITS file.
  1240.  
  1241.  
  1242. EXTVER Keyword  The value field shall contain an integer, to be used to
  1243. distinguish among different extensions in a FITS file with the same type and
  1244. name, i.e., the same values for XTENSION and EXTNAME. The values need not
  1245. start with 1 for the first extension with a particular value of EXTNAME and
  1246. need not be in sequence for subsequent values. If the EXTVER keyword is
  1247. absent, the file should be treated as if the value were 1.
  1248.  
  1249.  
  1250.  
  1251. EXTLEVEL Keyword  The value field shall contain an integer, specifying the
  1252. level in a hierarchy of extension levels of the extension header containing
  1253. it. The value shall be 1 for the highest level; levels with a higher value of
  1254. this keyword shall be subordinate to levels with a lower value. If the
  1255. EXTLEVEL keyword is absent, the file should be treated as if the value were 1.
  1256.  
  1257.  
  1258.  
  1259. 5.2.3    Additional Keywords
  1260.  
  1261.  
  1262. 5.2.3.1    Requirements
  1263.  
  1264.  
  1265. New keywords may be devised in addition to those described in this standard,
  1266. so long as they are consistent with the generalized rules for keywords and do
  1267. not conflict with mandatory or reserved keywords.
  1268.  
  1269.  
  1270.  
  1271. 5.2.3.2    Restrictions
  1272.  
  1273.  
  1274. No keyword in the primary header shall specify the presence of a specific
  1275. extension in a FITS file; only the EXTEND keyword described in Section 5.2.1.2
  1276. shall be used to indicate the possible presence of extensions. No keyword in
  1277. either the primary or extension header shall explicitly refer to the physical
  1278. block size, other than the BLOCKED keyword of Section 5.2.2.1.
  1279.  
  1280.  
  1281.  
  1282. 5.3    Value
  1283.  
  1284.  
  1285.  
  1286. 5.3.1    General Format Requirements
  1287.  
  1288.  
  1289. The value field must be written in a notation consistent with the
  1290. list-directed read operations in ANSI FORTRAN-77 [10]. The structure shall be
  1291. determined by the type of the variable.  The fixed format is required for
  1292. values of mandatory keywords and recommended for values of all others. This
  1293. standard imposes no requirements on case sensitivity of character strings
  1294. other than those explicitly specified.
  1295.  
  1296.  
  1297. 5.3.2    Fixed Format
  1298.  
  1299.  
  1300. 5.3.2.1    Character String
  1301.  
  1302.  
  1303. If the value is a character string, column 11 shall contain a single quote
  1304. (hexadecimal code 27, "'"); the string shall follow, starting in column 12,
  1305. followed by a closing single quote (also hexadecimal code 27) that should not
  1306. occur before column 20 and must occur in or before column 80. Proper
  1307. interpretation of the FITS file should not require decoding any more than the
  1308. first eight characters of a character string. The character string shall be
  1309. composed only of ASCII text. A single quote is represented within a string as
  1310. two successive single quotes, e.g., O'HARA = 'O''HARA'. Leading blanks are
  1311. significant; trailing blanks are not.
  1312.  
  1313.  
  1314.  
  1315. 5.3.2.2    Logical Variable
  1316.  
  1317.  
  1318. If the value is a logical constant, it shall appear as a T or F in column 30.
  1319.  
  1320.  
  1321.  
  1322. 5.3.2.3    Integer
  1323.  
  1324.  
  1325. If the value is an integer, the ASCII representation shall appear right
  1326. justified in columns 11-30. For a complex integer, the imaginary part shall be
  1327. right justified in columns 31-50.
  1328.  
  1329.  
  1330.  
  1331. 5.3.2.4    Real Floating Point Number
  1332.  
  1333.  
  1334. If the value is a real floating point number, the ASCII representation shall
  1335. appear in columns 11-30. Letters in the exponential form shall be upper case.
  1336. The value shall be right justified, and the decimal point must appear. Note:
  1337. The full precision of 64-bit values can not be expressed as a single value
  1338. using the fixed format.
  1339.  
  1340.  
  1341.  
  1342. 5.3.2.5    Complex Floating Point Number
  1343.  
  1344.  
  1345. If the value is a complex floating point number, the ASCII representation of
  1346. the real part shall appear in the same manner as a real floating point number
  1347. (see above). The ASCII representation of the imaginary part shall appear in
  1348. columns 31 - 50. Letters in the exponential form shall be upper case.  The
  1349. value shall be right justified, and the decimal point must appear. Note: The
  1350. full precision of 64-bit values can not be expressed as a single value using
  1351. the fixed format.
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357. Section  6
  1358.  
  1359.  
  1360.  
  1361. Data  Representation
  1362.  
  1363.  
  1364.  
  1365. Primary and extension data shall be represented in one of the formats
  1366. described in this section.  FITS data shall be interpreted to be a byte
  1367. stream.  Bytes are in order of decreasing significance. The byte that includes
  1368. the sign bit shall be first, and the byte that has the ones bit shall be last.
  1369.  
  1370.  
  1371.  
  1372. 6.1    Characters
  1373.  
  1374.  
  1375. Each character shall be represented by one byte. A character shall be
  1376. represented by its 7-bit ASCII [11] code in the low order seven bits in the
  1377. byte. The high-order bit shall be zero.
  1378.  
  1379.  
  1380.  
  1381. 6.2    Integers
  1382.  
  1383.  
  1384. 6.2.1    Eight-bit
  1385.  
  1386.  
  1387. Eight-bit integers shall be unsigned binary integers, contained in one byte.
  1388.  
  1389.  
  1390.  
  1391. 6.2.2    Sixteen-bit
  1392.  
  1393.  
  1394. Sixteen-bit integers shall be twos-complement signed binary integers,
  1395. contained in two bytes.
  1396.  
  1397.  
  1398.  
  1399. 6.2.3    Thirty-two-bit
  1400.  
  1401.  
  1402. Thirty-two-bit integers shall be twos-complement signed binary integers,
  1403. contained in four bytes.
  1404.  
  1405.  
  1406.  
  1407. 6.3    IEEE-754 Floating Point
  1408.  
  1409.  
  1410. Transmission of 32- and 64-bit floating point data within the FITS format
  1411. shall use the ANSI/IEEE-754 standard [12]. BITPIX = -32 and BITPIX = -64
  1412. signify 32- and 64- bit IEEE floating point numbers, respectively; the
  1413. absolute value of BITPIX is used for computing the sizes of data structures.
  1414. The full IEEE set of number forms is allowed for FITS interchange, including
  1415. all special values (e.g., the "Not-a-Number" cases). The order of the bytes
  1416. will be sign and exponent first, followed by the mantissa bytes in order of
  1417. decreasing significance. The BLANK keyword should not be used when BITPIX =
  1418. -32 or -64. Use of the BSCALE and BZERO keywords is not recommended.
  1419.  
  1420.  
  1421.  
  1422. 6.3.1    Thirty-two-bit Floating Point
  1423.  
  1424.  
  1425. 6.3.1.1    Structure
  1426.  
  1427.  
  1428. Table 6.1 describes the bit structure of 32-bit floating point standard
  1429. numeric values.
  1430.  
  1431.  
  1432.  
  1433.                       Bit Positions     Content
  1434.                      (first to last)
  1435.                      ________________________________
  1436.                            1             sign
  1437.                          2 - 9         exponent
  1438.                         10 - 32        mantissa
  1439.                      ________________________________
  1440.  
  1441.  
  1442.  
  1443.            Table 6.1: Content of 32-bit floating point bit positions.
  1444.  
  1445.  
  1446.  
  1447. 6.3.1.2    Interpretation
  1448.  
  1449.  
  1450. Standard numeric values of IEEE 32-bit floating point numbers are interpreted
  1451. according to the following rule:
  1452.  
  1453.  
  1454.  
  1455.              value   =  (-1)sign x 2(exponent -127) x mantissa     (6.1)
  1456.  
  1457.  
  1458. The IEEE NaN (Not-a-Number) values shall be used to represent undefined
  1459. values. All IEEE special values are recognized.
  1460.  
  1461.  
  1462.  
  1463. 6.3.2    Sixty-four-bit Floating Point
  1464.  
  1465.  
  1466. 6.3.2.1    Structure
  1467.  
  1468.  
  1469. Table 6.2 describes the bit structure of 64-bit floating point standard
  1470. numeric values.
  1471.  
  1472.  
  1473.                       Bit Positions     Content
  1474.                      (first to last)
  1475.                      _______________________________
  1476.                            1             sign
  1477.                          2 - 12        exponent
  1478.                         13 - 64        mantissa
  1479.                      _______________________________
  1480.  
  1481.  
  1482.  
  1483.            Table 6.2: Content of 64-bit floating point bit positions.
  1484.  
  1485.  
  1486.  
  1487. 6.3.2.2    Interpretation
  1488.  
  1489.  
  1490. Standard numeric values for IEEE 64-bit floating point numbers are interpreted
  1491. according to the following rule:
  1492.  
  1493.  
  1494.  
  1495.              value   =   (-1)sign x 2(exponent -1023) x mantissa       (6.2)
  1496.  
  1497.  
  1498. The IEEE NaN (Not-a-Number) values shall be used to represent undefined
  1499. values. All IEEE special values are recognized.
  1500.  
  1501.  
  1502.  
  1503.  
  1504. Section  7
  1505.  
  1506.  
  1507.  
  1508. Random  Groups  Structure
  1509.  
  1510.  
  1511.  
  1512. Although it is standard FITS, the random groups structure has been used almost
  1513. exclusively for applications in radio interferometry; outside this field, few
  1514. FITS readers can read data in random groups format. A proposed binary tables
  1515. extension will eventually be able to accommodate the structure described by
  1516. random groups.  While existing FITS files use the format, and it is therefore
  1517. included in this standard, its use for future applications is deprecated by
  1518. this document.
  1519.  
  1520.  
  1521.  
  1522. 7.1    Keywords
  1523.  
  1524.  
  1525. 7.1.1    Mandatory Keywords
  1526.  
  1527.  
  1528. If the random groups format records follow the primary header, the card images
  1529. of the primary header must use the keywords defined in Table 7.1 in the order
  1530. specified.
  1531.  
  1532. The total number of bits in the random groups records exclusive of the fill
  1533. described in Section 7.2 must be given by the following expression:
  1534.  
  1535.  
  1536.  
  1537.            NBITS   =  | BITPIX | x GCOUNT  x
  1538.  
  1539.                    (PCOUNT  + NAXIS2  x NAXIS3   x ... x NAXISm  );    (7.1)
  1540.  
  1541.  
  1542. where NBITS is non-negative and the number of bits excluding fill, m is the
  1543. value of NAXIS, and BITPIX, GCOUNT, PCOUNT, and the NAXISn represent the
  1544. values associated with those keywords.
  1545.  
  1546.  
  1547.  
  1548. 7.1.1.1    SIMPLE Keyword
  1549.  
  1550.  
  1551. The card image containing this keyword is structured in the same way as if a
  1552. primary data array were present (Section 5.2.1).
  1553.  
  1554.  
  1555.                1   SIMPLE
  1556.                2   BITPIX
  1557.                3   NAXIS
  1558.                4   NAXIS1
  1559.                5   NAXISn, n=2, ..., value of NAXIS
  1560.                        ...
  1561.                   (other keywords, which must include ...)
  1562.                   GROUPS
  1563.                   PCOUNT
  1564.                   GCOUNT
  1565.                   ...
  1566.               last  END
  1567.  
  1568.  
  1569.  
  1570.    Table 7.1: Mandatory keywords in primary header preceding random groups.
  1571.  
  1572.  
  1573.  
  1574. 7.1.1.2    BITPIX Keyword
  1575.  
  1576.  
  1577. The card image containing this keyword is structured as prescribed in Section
  1578. 5.2.1.
  1579.  
  1580.  
  1581.  
  1582. 7.1.1.3    NAXIS Keyword
  1583.  
  1584.  
  1585. The value field shall contain an integer ranging from 1 to 999, representing
  1586. one more than the number of axes in each data array.
  1587.  
  1588.  
  1589.  
  1590. 7.1.1.4    NAXIS1 Keyword
  1591.  
  1592.  
  1593. The value field shall contain the integer 0, a signature of random groups
  1594. format indi- cating that there is no primary data array.
  1595.  
  1596.  
  1597.  
  1598. 7.1.1.5    NAXISn Keywords (n=2, ..., value of NAXIS)
  1599.  
  1600.  
  1601. The value field shall contain an integer, representing the number of positions
  1602. along axis n-1 of the data array in each group.
  1603.  
  1604.  
  1605.  
  1606. 7.1.1.6    GROUPS Keyword
  1607.  
  1608.  
  1609. The value field shall contain the logical constant T. The value T associated
  1610. with this keyword implies that random groups records are present.
  1611.  
  1612.  
  1613.  
  1614. 7.1.1.7    PCOUNT Keyword
  1615.  
  1616.  
  1617. The value field shall contain an integer equal to the number of parameters
  1618. preceding each group.
  1619.  
  1620.  
  1621.  
  1622. 7.1.1.8    GCOUNT Keyword
  1623.  
  1624.  
  1625. The value field shall contain an integer equal to the number of random groups
  1626. present.
  1627.  
  1628.  
  1629.  
  1630. 7.1.1.9    END Keyword
  1631.  
  1632.  
  1633. The card image containing this keyword is structured as described in Section
  1634. 5.2.1.
  1635.  
  1636.  
  1637.  
  1638. 7.1.2    Reserved Keywords
  1639.  
  1640.  
  1641. 7.1.2.1    PTYPEn Keywords
  1642.  
  1643.  
  1644. The value field shall contain a character string giving the name of parameter
  1645. n. If the PTYPEn keywords for more than one value of n have the same
  1646. associated name in the value field, then the data value for the parameter of
  1647. that name is to be obtained by adding the derived data values of the
  1648. corresponding parameters. This rule provides a mechanism by which a random
  1649. parameter may have more precision than the accompanying data array members;
  1650. for example, by summing two 16-bit values with the first scaled relative to
  1651. the other such that the sum forms a number of up to 32-bit precision.
  1652.  
  1653.  
  1654.  
  1655. 7.1.2.2    PSCALn Keywords
  1656.  
  1657.  
  1658. This keyword shall be used, along with the PZEROn keyword, when the nth FITS
  1659. group parameter value is not the true physical value, to transform the group
  1660. parameter value to the true physical values it represents, using equation 7.2.
  1661. The value field shall contain a floating point number representing the
  1662. coefficient of the linear term in equation 7.2, the scaling factor between
  1663. true values and group parameter values at zero offset. The default value for
  1664. this keyword is 1.0.
  1665.  
  1666.  
  1667.  
  1668. 7.1.2.3    PZEROn Keywords
  1669.  
  1670.  
  1671. This keyword shall be used, along with the PSCALn keyword, when the nth FITS
  1672. group parameter value is not the true physical value, to transform the group
  1673. parameter value to the physical value. The value field shall contain a
  1674. floating point number, representing the true value corresponding to a group
  1675. parameter value of zero. The default value for this keyword is 0.0. The
  1676. transformation equation is as follows:
  1677.  
  1678.  
  1679.  
  1680.          physical value   =  PZEROn  + PSCALn  x group parameter value  (7.2)
  1681.  
  1682.  
  1683. 7.2    Data Sequence
  1684.  
  1685.  
  1686. Random groups data shall consist of a set of groups. The number of groups
  1687. shall be specified by the GCOUNT keyword in the associated header record. 
  1688. Each group shall consist of the number of parameters specified by the PCOUNT
  1689. keyword followed by an array with the number of members GMEM given by the
  1690. following expression:
  1691.  
  1692.  
  1693.  
  1694.               GMEM  = (NAXIS2 x NAXIS3  x ... x NAXISm):        (7.3)
  1695.  
  1696.  
  1697. where GMEM is the number of members in the data array in a group, m is the
  1698. value of NAXIS, and the NAXISn represent the values associated with those
  1699. keywords. The first parameter of the first group shall appear in the first
  1700. location of the first data record. The first element of each array shall
  1701. immediately follow the last parameter associated with that group. The first
  1702. parameter of any subsequent group shall imme- diately follow the last member
  1703. of the array of the previous group. The arrays shall be organized internally
  1704. in the same way as an ordinary primary data array. If the groups data do not
  1705. fill the final record, the remainder of the record shall be filled with zero
  1706. val- ues in the same way as a primary data array (Section 4.3.2). If random
  1707. groups records are present, there shall be no primary data array.
  1708.  
  1709.  
  1710.  
  1711. 7.3    Data Representation
  1712.  
  1713.  
  1714. Permissible data representations are those listed in Section 6. Parameters and
  1715. members of associated data arrays shall have the same representation. Should
  1716. more precision be required for an associated parameter than for a member of a
  1717. data array, the parameter shall be divided into two or more addends,
  1718. represented by the same value for the PTYPEn keyword.  The value shall be the
  1719. sum of the physical values, which may have been obtained from the group
  1720. parameter values using the PSCALn and PZEROn keywords.
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726. Section  8
  1727.  
  1728.  
  1729.  
  1730. Standard  Extensions
  1731.  
  1732.  
  1733.  
  1734. 8.1    ASCII Tables Extension
  1735.  
  1736.  
  1737. Data shall appear as an ASCII Tables extension if the primary header of the
  1738. FITS file has the keyword EXTEND set to T and the first keyword of that
  1739. extension header has XTENSION= 'TABLE  '.
  1740.  
  1741.  
  1742.  
  1743. 8.1.1    Mandatory Keywords
  1744.  
  1745.  
  1746. The card images in the header of an ASCII Tables Extension must use the
  1747. keywords defined in Table 8.1 in the order specified.
  1748.  
  1749.  
  1750.  
  1751. XTENSION Keyword  The value field shall contain the character string 
  1752. 'TABLE '.
  1753.  
  1754.  
  1755.  
  1756. BITPIX Keyword  The value field shall contain the integer 8, denoting that the
  1757. array contains ASCII characters.
  1758.  
  1759.  
  1760.  
  1761. NAXIS Keyword  The value field shall contain the integer 2, denoting that the
  1762. included data array is two-dimensional: rows and columns.
  1763.  
  1764.  
  1765.  
  1766. NAXIS1 Keyword  The value field shall contain a non-negative integer, giving
  1767. the number of ASCII characters in each row of the table.
  1768.  
  1769.  
  1770.  
  1771. NAXIS2 Keyword  The value field shall contain a non-negative integer, giving
  1772. the number of rows in the table.
  1773.  
  1774.  
  1775.  
  1776. PCOUNT Keyword  The value field shall contain the integer 0.
  1777.  
  1778.  
  1779.            1   XTENSION
  1780.            2   BITPIX
  1781.            3   NAXIS
  1782.            4   NAXIS1
  1783.            5   NAXIS2
  1784.            6   PCOUNT
  1785.            7   GCOUNT
  1786.            8   TFIELDS
  1787.                 ...
  1788.               (other keywords, which must include ...)
  1789.               TBCOLn, n=1,2,...,k where k is the value of TFIELDS
  1790.               TFORMn, n=1,2,...,k where k is the value of TFIELDS
  1791.                  ...
  1792.           last   END
  1793.  
  1794.  
  1795.  
  1796.          Table 8.1: Mandatory keywords in ASCII tables extensions.
  1797.  
  1798.  
  1799.  
  1800. GCOUNT Keyword  The value field shall contain the integer 1; the data records
  1801. contain a single table.
  1802.  
  1803.  
  1804.  
  1805. TFIELDS Keyword  The value field shall contain a non-negative integer
  1806. representing the number of fields in each row. The maximum permissible value
  1807. is 999.
  1808.  
  1809.  
  1810. TBCOLn Keywords  The value field of this indexed keyword shall contain an
  1811. integer specifying the column in which field n starts. The first column of a
  1812. row is numbered 1.
  1813.  
  1814.  
  1815. TFORMn Keywords  The value field of this indexed keyword shall contain a
  1816. character string describing the FORTRAN-77 [10] format in which field n is
  1817. coded. The formats in Table 8.2 are permitted for encoding.
  1818.  
  1819. Repetition of a format from one field to the next must be indicated by using
  1820. separate pairs of TBCOLn and TFORMn keywords for each field; format repetition
  1821. may not be indicated by prefixing the format by a number.
  1822.  
  1823.  
  1824. END Keyword  This keyword has no associated value.  Columns 9-80 shall contain
  1825. ASCII blanks.
  1826.  
  1827.  
  1828.             Field Value        Data Type
  1829.             __________________________________________________________
  1830.                  Aw       Character
  1831.                  Iw       Integer
  1832.                Fw.d       Single precision real
  1833.                Ew.d       Single precision real, exponential notation
  1834.                Dw.d       Double precision real, exponential notation
  1835.             __________________________________________________________
  1836.  
  1837.  
  1838.  
  1839.           Table 8.2: Valid TFORMn format values in TABLE extensions.
  1840.  
  1841.  
  1842.  
  1843. 8.1.2    Other Reserved Keywords
  1844.  
  1845.  
  1846. In addition to the mandatory keywords defined in section 8.1.1, these keywords
  1847. may be used to describe the structure of an ASCII Tables data array. They are
  1848. optional, but if they appear within an ASCII Tables extension header, they
  1849. must be used as defined in this section of this standard.
  1850.  
  1851.  
  1852.  
  1853. TSCALn Keywords  This indexed keyword shall be used, along with the TZEROn
  1854. key- word, when the quantity in field n does not represent a true physical
  1855. quantity.  The value field shall contain a floating point number representing
  1856. the coefficient of the linear term in equation 8.1, which must be used to
  1857. compute the true physical value of the field. The default value for this
  1858. keyword is 1.0. This keyword may not be used for A-format fields.
  1859.  
  1860.  
  1861.  
  1862. TZEROn Keywords  This indexed keyword shall be used, along with the TSCALn
  1863. key- word, when the quantity in field n does not represent a true physical
  1864. quantity.  The value field shall contain a floating point number representing
  1865. the zero point for the true physical value of field n. The default value for
  1866. this keyword is 0.0. This keyword may not be used for A-format fields. The
  1867. transformation equation used to compute a true physical value from the
  1868. quantity in field n is
  1869.  
  1870.  
  1871.              physical value     =  TZEROn   + TSCALn   x field value
  1872.  
  1873.  
  1874. TNULLn Keywords  The value field for this indexed keyword shall contain the
  1875. character string that represents an undefined value for field n. The string is
  1876. implicitly blank filled to the width of the field.
  1877.  
  1878.  
  1879.  
  1880. TTYPEn Keywords  The value field for this indexed keyword shall contain a
  1881. character string, giving the name of field n. It is recommended that only
  1882. letters, digits, and underscore (hexadecimal code 5F, "__") be used in the
  1883. name. However, string comparisons with the values of TTYPEn keywords should
  1884. not be case sensitive. The use of identical names for different fields should
  1885. be avoided.
  1886.  
  1887.  
  1888.  
  1889. TUNITn Keywords  The value field shall contain a character string describing
  1890. the phys- ical units in which the quantity in field n, after any application
  1891. of TSCALn and TZEROn, is expressed. Use of the units defined in the IAU Style
  1892. Manual [7] is recommended.
  1893.  
  1894.  
  1895.  
  1896. 8.1.3    Data Sequence
  1897.  
  1898.  
  1899. The table is constructed from a two-dimensional array of ASCII characters. The
  1900. row length and the number of rows shall be those specified, respectively, by
  1901. the NAXIS1 and NAXIS2 keywords of the associated header records. The number of
  1902. characters in a row and the number of rows in the table shall determine the
  1903. size of the character array. Every row in the array shall have the same number
  1904. of characters. The first character of the first row shall be at the start of
  1905. the record immediately following the last header record. The first character
  1906. of subsequent rows shall follow immediately the character at the end of the
  1907. previous row, independent of the record structure. The positions in the last
  1908. data record after the last character of the last row of the data array shall
  1909. be filled with ASCII blanks.
  1910.  
  1911.  
  1912.  
  1913. 8.1.4    Fields
  1914.  
  1915.  
  1916. Each row in the array shall consist of a sequence of fields, with one entry in
  1917. each field. For every field, the FORTRAN-77 format of the information
  1918. contained, location in the row of the beginning of the field and (optionally)
  1919. the field name, shall be specified in keywords of the associated header
  1920. records. A separate format keyword must be provided for each field. The
  1921. location and format of fields shall be the same for every row. Fields may
  1922. overlap.
  1923.  
  1924.  
  1925.  
  1926. 8.1.5    Entries
  1927.  
  1928.  
  1929. All data in an ASCII tables extension record shall be ASCII text in FORTRAN
  1930. format. The only possible formats shall be those specified in Table 8.2.  If
  1931. values of -0 and +0 must be distinguished, then the sign character should
  1932. appear in a separate field in character format. TNULLn keywords may be used to
  1933. specify a character string that represents an undefined value in each field.
  1934. The characters representing an undefined value may differ from field to field
  1935. but must be the same within a field. Blanks within the fields are not to be
  1936. interpreted as zeroes; zeroes must be given explicitly.
  1937.  
  1938.  
  1939. 8.2    Other Standard Extensions
  1940.  
  1941.  
  1942. At the effective date of this standard there are no other standard extensions.
  1943.  
  1944.  
  1945.  
  1946. Section  9
  1947.  
  1948.  
  1949.  
  1950. Restrictions on Changes
  1951.  
  1952.  
  1953. Any structure that is a valid FITS structure shall remain a valid FITS
  1954. structure at all future times. Use of certain valid FITS structures may be
  1955. deprecated by this or future FITS standard documents.
  1956.  
  1957.  
  1958.  
  1959.  
  1960. Appendix  A
  1961.  
  1962.  
  1963.  
  1964. Draft Proposal for Binary Table
  1965.  
  1966.  
  1967.  
  1968. Extension
  1969.  
  1970.  
  1971.  
  1972. (This Appendix is not part of the NOST FITS Standard but is included for
  1973. informa- tional purposes only.)
  1974.  
  1975. This appendix contains a draft proposal for a Binary Table extension, type
  1976. name "BINTABLE", developed by W. D. Cotton (NRAO) and D. Tody (NOAO), dated
  1977. September 20, 1991. With their permission, that proposal [9] is reproduced
  1978. nearly verbatim; the only changes are those required for stylistic consistency
  1979. with the rest of this document. The BINTABLE extension has been developed from
  1980. the earlier A3DTABLE extension implemented in AIPS by NRAO. It supports all
  1981. features of the earlier, more limited extension. Binary tables are being used
  1982. at a number of different installations and by NASA and NASA-supported
  1983. projects.  A limited subset, without the repeat count feature, has
  1984. successfully been exchanged between AIPS and MIDAS, and full interoperability
  1985. testing of the BINTABLE extension is in progress. However, much of the
  1986. existing FITS-reading software cannot yet decode the format. The extension is
  1987. now undergoing community review as part of the process leading to eventual
  1988. consideration by the IAU Commission 5 FITS Working Group. Because it is
  1989. becoming widely used, and because it illustrates an application of the rules
  1990. for conforming extensions, the text of the proposal is included as the
  1991. remainder of this Appendix.
  1992.  
  1993.  
  1994.  
  1995. A.1     Abstract
  1996.  
  1997.  
  1998.  
  1999. This paper describes the FITS binary tables which are a flexible and efficient
  2000. means of transmitting a wide variety of data structures. Table rows may be a
  2001. mixture of a number of numerical, logical and character data entries. In
  2002. addition, each entry is allowed to be a single dimensioned array. Numeric data
  2003. are kept in IEEE formats.
  2004.  
  2005.  
  2006.  
  2007. A.2     Introduction
  2008.  
  2009.                                                                  
  2010. The Flexible Image Transport System (FITS) [1], [2] has been used for a number
  2011. of years both as a means of transporting data between computers and/or
  2012. processing systems and as an archival format for a variety of astronomical
  2013. data. The success of this system has resulted in the introduction of
  2014. enhancements. In particular, considerable use has been made of the records
  2015. following the "main" data file.  Grosbol et al.  [4] introduced a generalized
  2016. header format for extension "files" following the "main" data file, but in the
  2017. same physical file. Harten et al. [5] defined an ASCII table structure which
  2018. could convey information that could be conveniently printed as a table. This
  2019. paper generalizes the ASCII tables and defines an efficient means for
  2020. conveying a wide variety of data structures as "extension" files.
  2021.  
  2022.  
  2023.  
  2024. A.3     Binary Tables
  2025.  
  2026.  
  2027. The binary tables are tables in the sense that they are organized into rows
  2028. and columns. They are multi-dimensional since an entry, or set of values
  2029. associated with a given row and column, can be an array of arbitrary size.
  2030. These values are represented in a standardized binary form. Each row in the
  2031. table contains an entry for each column. This entry may be one of a number of
  2032. different data types, 8 bit unsigned integers, 16 or 32 bit signed integers,
  2033. logical, character, bit, 32 or 64 bit floating point or complex values.  The
  2034. datatype and dimensionality are independently defined for each column but each
  2035. row must have the same structure. Additional information associated with the
  2036. table may be included in the table header as keyword/value pairs.
  2037.  
  2038. The binary tables come after the "main" data file, if any, in a FITS file and
  2039. follow the standards for generalized extension tables defined in [4].
  2040.  
  2041. The use of the binary tables requires the use of a single additional keyword
  2042. in the main header:
  2043.  
  2044.  
  2045. EXTEND (logical)  if true (ASCII 'T') indicates that there may be extension
  2046. files fol- lowing the data records and, if there are, that they conform to the
  2047. generalized extension file header standards.
  2048.  
  2049.  
  2050.  
  2051. A.4     Table Header
  2052.  
  2053.  
  2054. The table header begins at the first byte in the first record following the
  2055. last record of main data (if any) or following the last record of the previous
  2056. extension file. The format of the binary table header is such that a given
  2057. FITS reader can decide if it wants (or understands) it and can skip the table
  2058. if not.
  2059.  
  2060.  
  2061. A table header consists of one or more 2880 8-bit byte logical records each
  2062. containing 36 80-byte "card images" in the form:
  2063.  
  2064.  
  2065.     keyword = value    / comment
  2066.  
  2067.  
  2068. where the keyword begins in column 1 and contains up to eight characters and
  2069. the value begins in column 10 or later. Keyword/value pairs in binary table
  2070. headers conform to standard FITS usage.
  2071.  
  2072. The number of columns in the table is given by the value associated with
  2073. keyword TFIELDS. The type, dimensionality, labels, units, blanking values, and
  2074. display formats for entries in column nnn may be defined by the values
  2075. associated with the keywords TFORMnnn, TTYPEnnn, TUNITnnn, TNULLnnn, and
  2076. TDISPnnn. Of these only TFORMnnn is required but the use of TTYPEnnn is
  2077. strongly recommended. An entry may be omitted from the table, but still
  2078. defined in the header, by using a zero element count in the TFORMnnn entry.
  2079.  
  2080. The required keywords XTENSION, BITPIX, NAXIS, NAXIS1, NAXIS2, PCOUNT, GCOUNT
  2081. and TFIELDS must be in order; other keywords follow these in an arbitrary
  2082. order. The required keywords in a binary table header record are:
  2083.  
  2084.  
  2085. XTENSION (character)  indicates the type of extension file, this must be the
  2086. first keyword in the header. This is 'BINTABLE' for the binary tables.
  2087.  
  2088.  
  2089. BITPIX (integer)  gives the number of bits per "pixel" value. For binary
  2090. tables this value is 8.
  2091.  
  2092.  
  2093. NAXIS (integer)  gives the number of "axes"; this value is 2 for binary
  2094. tables.
  2095.  
  2096.  
  2097. NAXIS1 (integer)  gives the number of 8 bit bytes in each "row". This should
  2098. correspond to the sum of the values defined in the TFORMnnn keywords.
  2099.  
  2100.  
  2101. NAXIS2 (integer)  gives the number of rows in the table.
  2102.  
  2103.  
  2104. PCOUNT (integer)  is used to tell the number of bytes following the regular
  2105. portion of the table. These bytes are allowed but no meaning is attached to
  2106. them in this document. PCOUNT should normally be 0 for binary tables (see
  2107. however Section A.9.2).
  2108.  
  2109.  
  2110. GCOUNT (integer)  gives the number of groups of data defined as for the random
  2111. group main data records. This is 1 for binary tables.
  2112.  
  2113.  
  2114. TFIELDS (integer)  gives the number of fields (columns) present in the table.
  2115.  
  2116.  
  2117. TFORMnnn1 (character)  gives the size and data type of field nnn. Allowed
  2118. values of nnn range from 1 to the value associated with TFIELDS. Allowed
  2119. values of TFORMnnn are of the form rL, rX, rI, rJ, rA, rE, rD, rB, rC, rM, or
  2120. rP (logical, bit, 16-bit integers, 32- bitntegers, characters, single
  2121. precision, double precision, unsigned bytes, complex pair of single precision
  2122. values, double complex pair of double precision values and variable length
  2123. array descriptor [64 bits]) where r=number of elements. If the element count
  2124. is absent, it is assumed to be 1. A value of zero is allowed. Note: additional
  2125. characters may follow the datatype code character but they are not defined in
  2126. this document.
  2127.  
  2128. The number of bytes determined from summing the TFORMnnn values should equal
  2129. NAXIS1 but NAXIS1 should be used as the definition of the actual length of the
  2130. row.
  2131.  
  2132.  
  2133. END  is always the last keyword in a header. The remainder of the FITS logical
  2134. (2880- byte) record following the END keyword is blank filled. 
  2135.  
  2136.  
  2137. The optional standard keywords are:
  2138.  
  2139. EXTNAME (character)  can be used to give a name to the extension file to
  2140. distinguish it from other similar files. The name may have a hierarchical
  2141. structure giving its relation to other files (e.g., "map1.cleancomp")
  2142.  
  2143.  
  2144. EXTVER (integer)  is a version number which can be used with EXTNAME to
  2145. identify a file.
  2146.  
  2147.  
  2148. EXTLEVEL (integer)  specifies the level of the extension file in a
  2149. hierarchical structure. The default value for EXTLEVEL should be 1.
  2150.  
  2151.  
  2152. TTYPEnnn (character)  gives the label for field nnn.
  2153.  
  2154.  
  2155.  
  2156. TUNITnnn (character)  gives the physical units of field nnn.
  2157.  
  2158.  
  2159. TSCALnnn (floating)  gives the scale factor for field nnn. True_value =
  2160. FITS_value * TSCAL + TZERO. Note: TSCALnnn and TZEROnnn are not defined for A,
  2161. L, P, or X format fields. Default value is 1.0.
  2162.  
  2163.  
  2164. TZEROnnn (floating)  gives the offset for field nnn. (See TSCALnnn.) Default
  2165. value is 0.0.
  2166.  
  2167.  
  2168. TNULLnnn (integer)  gives the undefined value for integer (B, I, and J) field
  2169. nnn. Section A.6 discusses the conventions for indicating invalid data of
  2170. other data types.
  2171.  
  2172.  
  2173. NOTE:  The "nnn" in keyword names indicates an integer index in the range 
  2174. 1 - 999. The integer is left justified with no leading zeroes, e.g. TFORM1,
  2175. TFORM19, etc.
  2176.  
  2177.  
  2178. TDISPnnn (character)  gives the Fortran 90 format suggested for the display of
  2179. field nnn.  Each byte of bit and byte arrays will be considered to be a signed
  2180. integer for purposes of display.  The allowed forms are Aw, Lw, Iw.m, Bw.m
  2181. (Binary, integers only), Ow.m (Octal, integers only), Zw.m (Hexadecimal,
  2182. integers only) Fw.d, Ew.dEe, ENw.d, ESw.d, Gw.dEe, and Dw.dEe where w is the
  2183. width of the displayed value in characters, m is the minimum number of digits
  2184. possibly requiring leading zeroes, d is the number of digits to the right of
  2185. the decimal, and e is the number of digits in the exponent. All entries in a
  2186. field are displayed with a single, repeated format. If Fortran 90 formats are
  2187. not available to a reader which prints a table then equivalent FORTRAN 77
  2188. formats may be substituted. Any TSCALnnn and TZEROnnn values should be applied
  2189. before display of the value. Note that characters and logical values may be
  2190. null (zero byte) terminated.
  2191.  
  2192.  
  2193. TDIMnnn (character)  This keyword is reserved for use by the convention
  2194. described in Section A.9.1.
  2195.  
  2196.  
  2197. THEAP (integer)  This keyword is reserved for use by the convention described
  2198. in Section A.9.2.
  2199.  
  2200.  
  2201. AUTHOR (character)  gives the name of the author or creator of the table.
  2202.  
  2203.  
  2204. REFERENC (character)  gives the reference for the table.
  2205.  
  2206. Nonstandard keyword/value pairs adhering to the FITS keyword standards are al-
  2207. lowed although a reader may chose to ignore them.
  2208.  
  2209.  
  2210. A.5     Conventions for Multidimensional Arrays
  2211.  
  2212.  
  2213. There is commonly a need to use data structures more complex than the one
  2214. dimen- sional definition of the table entries defined for this table format. 
  2215. Multidimensional arrays, or more complex structures, may be implemented by
  2216. passing dimensions or other structural information as either column entries or
  2217. keywords in the header. Pass- ing the dimensionality as column entries has the
  2218. advantage that the array can have variable dimension (subject to a fixed
  2219. maximum size and storage usage). A convention is suggested in Section A.9.1.
  2220.  
  2221.  
  2222. A.6     Table Data Records
  2223.  
  2224.  
  2225. The binary table data records begin with the next logical record following the
  2226. last header record. If the intersection of a row and column is an array then
  2227. the elements of this array are contiguous and in order of increasing array
  2228. index. Within a row, columns are stored in order of increasing column number.
  2229. Rows are given in order of increasing row number.  All 2880-byte logical
  2230. records are completely filled with no extra bytes between columns or rows.
  2231. Columns and rows do not necessarily begin in the first byte of a 2880-byte
  2232. record. Note that this implies that a given word may not be aligned in the
  2233. record along word boundaries of its type; words may even span 2880-byte
  2234. records. The last 2880-byte record should be zero byte filled past the end of
  2235. the valid data.
  2236.  
  2237. If word alignment is ever considered important for efficiency considerations
  2238. then this may be accomplished by the proper design of the table. The simplest
  2239. way to accomplish this is to order the columns by data type (M, D, C, P, E, J,
  2240. I, B, L, A, X) and then add sufficient padding in the form of a dummy column
  2241. of type B with the number of elements such that the size of a row is either an
  2242. integral multiple of 2880 bytes or an integral number of rows is 2880 bytes.
  2243.  
  2244. The data types are defined in the following list (r is the number of elements
  2245. in the entry):
  2246.  
  2247.  
  2248. rL  A logical value consists of an ASCII "T" indicating true and "F"
  2249. indicating false. A null character (zero byte) indicates an invalid value.
  2250.  
  2251.  
  2252. rX  A bit array will start in the most significant bit of the byte and the
  2253. following bits in the order of decreasing significance in the byte. Bit
  2254. significance is in the same order as for integers. A bit array entry consists
  2255. of an integral number of bytes with trailing bits zero.
  2256.  
  2257. No explicit null value is defined for bit arrays but if the capability of
  2258. blanking bit arrays is needed it is recommended that one of the following
  2259. conventions be adopted: 1) designate a bit in the array as a validity bit, 2)
  2260. add an L type column to indicate validity of the array or 3) add a second bit
  2261. array which contains a validity bit for each of the bits in the original
  2262. array. Such conventions are beyond the scope of this general format design and
  2263. in general readers will not be expected to understand them.
  2264.  
  2265.  
  2266. rB  Unsigned 8-bit integer with bits in decreasing order of significance.
  2267. Signed values may be passed with appropriate values of TSCALnnn and TZEROnnn.
  2268.  
  2269.  
  2270. rI  A 16-bit twos complement integer with the bits in decreasing order of
  2271. significance. Unsigned values may be passed with appropriate values of
  2272. TSCALnnn and TZEROnnn.
  2273.  
  2274.  
  2275. rJ  A 32-bit twos complement integer with the bits in decreasing order of
  2276. significance. Unsigned values may be passed with appropriate values of
  2277. TSCALnnn and TZEROnnn.
  2278.  
  2279.  
  2280. rA  Character strings are represented by ASCII characters in their natural
  2281. order. A character string may be terminated before its explicit length by an
  2282. ASCII NULL char- acter. An ASCII NULL as the first character will indicate an
  2283. undefined string i.e. a NULL string. Legal characters are printable ASCII
  2284. characters in the range ' ' (hex 20) to '"' (hex 7E) inclusive and ASCII NULL
  2285. after the last valid character. Strings the full length of the field are not
  2286. NULL terminated.
  2287.  
  2288.  
  2289. rE  Single precision floating point values are in IEEE 32-bit precision format
  2290. in the order: sign bit, exponent and mantissa in decreasing order of
  2291. significance. The IEEE NaN (not a number) values are used to indicate an
  2292. invalid number; a value with all bits set is recognized as a NaN. All IEEE
  2293. special values are recognized.
  2294.  
  2295.  
  2296. rD  Double precision floating point values are in IEEE 64-bit precision format
  2297. in the order: sign bit, exponent and mantissa in decreasing order of
  2298. significance. The IEEE NaN values are used to indicate an invalid number; a
  2299. value with all bits set is recognized as a NaN. All IEEE special values are
  2300. recognized.                   
  2301.  
  2302.  
  2303. rC  A Complex value consists of a pair of IEEE 32-bit precision floating point
  2304. values with the first being the real and the second the imaginary part. If
  2305. either word contains a NaN value the complex value is invalid.
  2306.  
  2307.  
  2308. rM  Double precision complex values. These consist of a pair of IEEE 64-bit
  2309. precision floating point values with the first being the real and the second
  2310. the imaginary part. If either word contains a NaN value the complex value is
  2311. invalid.
  2312.  
  2313.  
  2314. rP  Variable length array descriptor. An element is equal in size to a pair of
  2315. 32-bit integers (i.e., 64 bits).  The anticipated use of this data type is
  2316. described in Section A.9.2. Arrays of type P are not defined; the r field is
  2317. permitted, but values other than 0 or 1 are undefined. For purposes of
  2318. printing, an entry of type P should be considered equivalent to 2J.
  2319.  
  2320.  
  2321. A.7     Example Binary Table Header
  2322.  
  2323.  
  2324. The following is an example of a binary table header which has 19 columns
  2325. using a number of different data types and dimensions. Columns labeled
  2326. "IFLUX", "QFLUX", "UFLUX", "VFLUX", "FREQOFF", "LSRVEL" and "RESTFREQ" are
  2327. arrays of dimension 2.  Columns labeled "SOURCE" and "CALCODE" are character
  2328. strings of length 16 and 4 respectively.  The nonstandard keywords "NO_IF",
  2329. VELTYP", and "VELDEF" also appear at the end of the header. The first two
  2330. lines of numbers are only present to show card columns and are not part of the
  2331. table header.
  2332.  
  2333.  
  2334.          1         2         3         4         5         6         7         8
  2335. 12345678901234567890123456789012345678901234567890123456789012345678901234567890
  2336. XTENSION= 'BINTABLE'          / Extension type
  2337. BITPIX  =                    8/ Binary data
  2338. NAXIS   =                    2/ Table is a matrix
  2339. NAXIS1  =                  168/ Width of table row in bytes
  2340. NAXIS2  =                    5/ Number of rows in table
  2341. PCOUNT  =                    0/ Random parameter count
  2342. GCOUNT  =                    1/ Group count
  2343. TFIELDS =                   19/ Number of columns in each row
  2344. EXTNAME = 'AIPS SU '          / AIPS source table
  2345. EXTVER  =                    1/ Version number of table
  2346. TFORM1  = '1I      '          / 16-bit integer
  2347. TTYPE1  = 'ID. NO.       '    / Type (label) of column  1
  2348. TUNIT1  = '        '          / Physical units of column  1
  2349. TFORM2  = '16A     '          / Character string
  2350. TTYPE2  = 'SOURCE        '    / Type (label) of column  2
  2351. TUNIT2  = '        '          / Physical units of column  2
  2352. TFORM3  = '1I      '          / 16-bit integer
  2353. TTYPE3  = 'QUAL          '    / Type (label) of column  3
  2354. TUNIT3  = '        '          / Physical units of column  3
  2355. TNULL3  =                32767/ Undefined value for column 3
  2356. TFORM4  = '4A      '          / Character string
  2357. TTYPE4  = 'CALCODE       '    / Type (label) of column  4
  2358. TUNIT4  = '        '          / Physical units of column  4
  2359. TFORM5  = '2E      '          / Single precision array
  2360. TTYPE5  = 'IFLUX         '    / Type (label) of column  5
  2361. TUNIT5  = 'JY      '          / Physical units of column  5
  2362. TFORM6  = '2E      '          / Single precision array
  2363. TTYPE6  = 'QFLUX         '    / Type (label) of column  6
  2364. TUNIT6  = 'JY      '          / Physical units of column  6
  2365. TFORM7  = '2E      '          / Single precision array
  2366. TTYPE7  = 'UFLUX         '    / Type (label) of column  7
  2367. TUNIT7  = 'JY      '          / Physical units of column  7
  2368. TFORM8  = '2E      '          / Single precision array
  2369. TTYPE8  = 'VFLUX         '    / Type (label) of column  8
  2370. TUNIT8  = 'JY      '          / Physical units of column  8
  2371. TFORM9  = '2D      '          / Double precision array.
  2372. TTYPE9  = 'FREQOFF       '    / Type (label) of column  9
  2373. TUNIT9  = 'HZ      '          / Physical units of column  9
  2374. TSCAL9  =                1.0D9/ Scaling factor of column 9
  2375. TZERO9  =                  0.0/ Offset of column 9
  2376. TFORM10 = '1D      '          / Double precision
  2377. TTYPE10 = 'BANDWIDTH      '   / Type (label) of column 10
  2378. TUNIT10 = 'HZ      '          / Physical units of column 10
  2379. TFORM11 = '1D      '          / Double precision
  2380. TTYPE11 = 'RAEPO         '    / Type (label) of column 11
  2381. TUNIT11 = 'DEGREES '          / Physical units of column 11
  2382. TFORM12 = '1D      '          / Double precision
  2383. TTYPE12 = 'DECEPO        '    / Type (label) of column 12
  2384. TUNIT12 = 'DEGREES '          / Physical units of column 12
  2385. TFORM13 = '1D      '          / Double precision
  2386. TTYPE13 = 'EPOCH         '    / Type (label) of column 13
  2387. TUNIT13 = 'YEARS   '          / Physical units of column 13
  2388. TFORM14 = '1D      '          / Double precision
  2389. TTYPE14 = 'RAAPP         '    / Type (label) of column 14
  2390. TUNIT14 = 'DEGREES '          / Physical units of column 14
  2391. TFORM15 = '1D      '          / Double precision
  2392. TTYPE15 = 'DECAPP        '    / Type (label) of column 15
  2393. TUNIT15 = 'DEGREES '          / Physical units of column 15
  2394. TFORM16 = '2D      '          / Double precision array
  2395. TTYPE16 = 'LSRVEL        '    / Type (label) of column 16
  2396. TUNIT16 = 'M/SEC   '          / Physical units of column 16
  2397. TFORM17 = '2D      '          / Double precision array
  2398. TTYPE17 = 'RESTFREQ       '   / Type (label) of column 17
  2399. TUNIT17 = 'HZ      '          / Physical units of column 17
  2400. TDISP17 = 'D17.10  '          / Display format of column 17
  2401. TFORM18 = '1D      '          / Double precision array
  2402. TTYPE18 = 'PMRA          '    / Type (label) of column 18
  2403. TUNIT18 = 'DEG/DAY '          / Physical units of column 18
  2404. TFORM19 = '1D      '          / Double precision array
  2405. TTYPE19 = 'PMDEC         '    / Type (label) of column 19
  2406. TUNIT19 = 'DEG/DAY '          / Physical units of column 19
  2407. NO_IF   =                    2
  2408. VELTYP  = 'LSR     '
  2409. VELDEF  = 'OPTICAL '
  2410. END
  2411.  
  2412.  
  2413.  
  2414. A.8     Acknowledgments by Authors of Draft Proposal
  2415.  
  2416.  
  2417.  
  2418. The authors would like to thank E. Greisen, D. Wells, P. Grosbol, B. Hanisch,
  2419. E. Mandel, E. Kemper, S. Voels, B. Schlesinger, W. Pence and many others for
  2420. invaluable discussions and suggestions.
  2421.  
  2422.  
  2423. A.9     Appendixes to Draft Proposal for Binary Tables Extension
  2424.  
  2425.  
  2426. A.9.1    "Multidimensional Array" Convention
  2427.  
  2428.  
  2429. It is anticipated that binary tables will need to contain data structures more
  2430. complex that those describable by the basic notation. Examples of these are
  2431. multidimensional arrays and nonrectangular data structures. Suitable
  2432. conventions may be defined to pass these structures using some combination of
  2433. keyword/value pairs and table entries to pass the parameters of these
  2434. structures.
  2435.  
  2436. One case, multidimensional arrays, is so common that it is prudent to describe
  2437. a simple convention. The "Multidimensional array" convention consists of the
  2438. following: any column with a dimensionality of 2 or larger will have an
  2439. associated character keyword TDIMnnn='(l,m,n,...)' where l, m, n,... are the
  2440. dimensions of the array. The data is ordered such that the array index of the
  2441. first dimension given (l) is the most rapidly varying and that of the last
  2442. dimension given is the least rapidly varying. The size implied by the TDIMnnn
  2443. keyword will equal the element count specified in the TFORMnnn key- word. The
  2444. adherence to this convention will be indicated by the presence of a TDIMnnn
  2445. keyword in the form described above.
  2446.  
  2447. A character string is represented in a binary table by a one-dimensional
  2448. character array, as described in section A.6. For example, a FORTRAN
  2449. CHARACTER*20 variable could be represented in a binary table as a character
  2450. array declared as TFORMn = '20A '. Arrays of character strings, i.e.,
  2451. multidimensional character arrays, may be represented using the TDIMnnn
  2452. notation. If a column is an array of strings then each string may be null
  2453. terminated. For example, if TFORMn='20A' and TDIMn='(5,4)' then the entry
  2454. consists of 4 strings of up to 5 characters each of which may be null
  2455. terminated.
  2456.  
  2457.  
  2458. This convention is optional and will not preclude other conventions. This
  2459. convention is not part of the proposed binary table definition.
  2460.  
  2461.  
  2462.  
  2463. A.9.2    "Variable Length Array" Facility
  2464.  
  2465.  
  2466. One of the most attractive features of binary tables is that any field of the
  2467. table can be an array. In the standard case this is a fixed size array, i.e.,
  2468. a fixed amount of storage is allocated in each record for the array data 
  2469. whether it is used or not. This is fine so long as the arrays are small or a
  2470. fixed amount of array data will be stored in each record, but if the stored
  2471. array length varies for different records, it is necessary to impose a fixed
  2472. upper limit on the size of the array that can be stored. If this upper limit
  2473. is made too large excessive wasted space can result and the binary table
  2474. mechanism becomes seriously inefficient. If the limit is set too low then it
  2475. may become impossible to store certain types of data in the table.
  2476.  
  2477. The "variable length array" construct presented here was devised to deal with
  2478. this problem. Variable length arrays are implemented in such a way that, even
  2479. if a table contains such arrays, a simple reader program which does not
  2480. understand variable length arrays will still be able to read the main table
  2481. (in other words a table containing variable length arrays conforms to the
  2482. basic binary table standard). The implementation chosen is such that the
  2483. records in the main table remain fixed in size even if the table contains a
  2484. variable length array field, allowing efficient random access to the main
  2485. table.
  2486.  
  2487. Variable length arrays are logically equivalent to regular static arrays, the
  2488. only differences being 1) the length of the stored array can differ for
  2489. different records, and 2) the array data is not stored directly in the table
  2490. records. Since a field of any datatype can be a static array, a field of any
  2491. datatype can also be a variable length array (excluding type P, the variable
  2492. length array descriptor itself, which is not a datatype so much as a storage
  2493. class specifier). Conventions such as TDIMnnn apply equally to both to
  2494. variable length and static arrays.
  2495.  
  2496. A variable length array is declared in the table header with a special field
  2497. datatype specifier of the form
  2498.  
  2499.     rPt(maxelem)
  2500.  
  2501. where the "P" indicates the amount of space occupied by the array descriptor
  2502. in the data record (64 bits), the element count "r" should be 0, 1, or absent,
  2503. t is a character denoting the datatype of the array data (L, X, B, I, J, etc.,
  2504. but not P), and maxelem is a quantity guaranteed to be equal to or greater
  2505. than the maximum number of elements of type t actually stored in a table
  2506. record. There is no built-in upper limit on the size of a stored array;
  2507. maxelem merely reflects the size of the largest array actually stored in the
  2508. table, and is provided to avoid the need to preview the table when, for
  2509. example, reading a table containing variable length elements into a database
  2510. that supports only fixed size arrays.
  2511.  
  2512.    For example,
  2513.  
  2514.  
  2515.     TFORM8  = 'PB(1800)'        / Variable length byte array
  2516.  
  2517.  
  2518. indicates that field 8 of the table is a variable length array of type byte,
  2519. with a maximum stored array length not to exceed 1800 array elements (bytes in
  2520. this case).
  2521.  
  2522. The data for the variable length arrays in a table is not stored in the actual
  2523. data records; it is stored in a special data area, the heap, following the
  2524. last fixed size data record. What is stored in the data record is an array
  2525. descriptor. This consists of two 32 bit integer values: the number of elements
  2526. (array length) of the stored array, followed by the zero-indexed byte offset
  2527. of the first element of the array, measured from the start of the heap area.
  2528. Storage for the array is contiguous. The array descriptor for field N as it
  2529. would appear embedded in a data record is illustrated symbolically below.
  2530.  
  2531.  
  2532.     field N-1  ;  - nelem  offset "  ;  field N+1
  2533.  
  2534.  
  2535. If the stored array length is zero there is no array data, and the offset
  2536. value is undefined (it should be set to zero). The storage referenced by an
  2537. array descriptor must lie entirely within the heap area; negative offsets are
  2538. not permitted.
  2539.  
  2540. A binary table containing variable length arrays consists of three main
  2541. segments, as follows:
  2542.  
  2543.  
  2544.     table header
  2545.     record storage area (data records)
  2546.     heap area (variable array data)
  2547.  
  2548.  
  2549. The table header consists of one or more 2880 byte FITS logical records with
  2550. the last record indicated by the keyword END somewhere in the record. The
  2551. record storage area begins with the next 2880 byte logical record following
  2552. the last header record and is NAXIS1*NAXIS2 bytes in length. The zero indexed
  2553. byte offset of the heap measured from the start of the record storage area is
  2554. given by the THEAP keyword in the header. If this keyword is missing the heap
  2555. is assumed to begin with the byte immediately following the last data record,
  2556. otherwise there may be a gap between the last stored record and the start of
  2557. the heap. If there is no gap the value of the heap offset is NAXIS1*NAXIS2.
  2558. The total length in bytes of the area following the last stored record (gap
  2559. plus heap) is given by the PCOUNT keyword in the table header.
  2560.  
  2561. For example, suppose we have a table containing 5 168 byte records, with a
  2562. heap area 2880 bytes long, beginning at an offset of 2880, thereby aligning
  2563. the record storage and heap areas on FITS record boundaries (this alignment is
  2564. not necessarily recommended but is useful for our example). The data portion
  2565. of the table consists of 2 2880 byte FITS records, 840 bytes of which are used
  2566. by the 5 table records, hence PCOUNT is 2*2880-840, or 4920 bytes.
  2567.  
  2568.  
  2569.     NAXIS1  =                168 / Width of table row in bytes
  2570.     NAXIS2  =                  5 / Number of rows in table
  2571.     PCOUNT  =               4920 / Random parameter count
  2572.       ...
  2573.     THEAP   =               2880 / Byte offset of heap area
  2574.  
  2575.  
  2576.  
  2577. While the above description is sufficient to define the required features of
  2578. the variable length array implementation, some hints regarding usage of the
  2579. variable length array facility may also be useful.
  2580.  
  2581. Programs which read binary tables should take care to not assume more about
  2582. the physical layout of the table than is required by the specification. For
  2583. example, there are no requirements on the alignment of data within the heap.
  2584. If efficient runtime access is a concern one may want to design the table so
  2585. that data arrays are aligned to the size of an array element. In another case
  2586. one might want to minimize storage and forgo any efforts at alignment (by
  2587. careful design it is often possible to achieve both goals). Variable array
  2588. data may be stored in the heap in any order, i.e., the data for record N+1 is
  2589. not necessarily stored at a larger offset than that for record N. There may be
  2590. gaps in the heap where no data is stored. Pointer aliasing is permitted, i.e.,
  2591. the array descriptors for two or more arrays may point to the same storage
  2592. location (this could be used to save storage if two or more arrays are
  2593. identical).
  2594.  
  2595. Byte arrays are a special case because they can be used to store a "typeless"
  2596. data sequence. Since FITS is a machine independent storage format, some form
  2597. of machine specific data conversion (byte swapping, floating point format
  2598. conversion) is implied when accessing stored data with types such as integer
  2599. and floating, but byte arrays are copied to and from external storage without
  2600. any form of conversion.
  2601.  
  2602. An important feature of variable length arrays is that it is possible that the
  2603. stored array length may be zero.  This makes it possible to have a column of
  2604. the table for which, typically, no data is present in each stored record. 
  2605. When data is present the stored array can be as large as necessary.  This can
  2606. be useful when storing complex objects as records in a table.
  2607.  
  2608. Accessing a binary table stored on a random access storage medium is
  2609. straightforward. Since the data records in the main table are fixed in size
  2610. they may be randomly accessed given the record number, by computing the
  2611. offset. Once the record has been read in, any variable length array data may
  2612. be directly accessed using the element count and offset given by the array
  2613. descriptor stored in the data record.
  2614.  
  2615. Reading a binary table stored on a sequential access storage medium requires
  2616. that a table of array descriptors be built up as the main table records are
  2617. read in. Once all the table records have been read, the array descriptors are
  2618. sorted by the offset of the array data in the heap. As the heap data is read,
  2619. arrays are extracted sequentially from the heap and stored in the affected
  2620. records using the back pointers to the record and field from the table of
  2621. array descriptors. Since array aliasing is permitted, it may be necessary to
  2622. store a given array in more than one field or record.
  2623.  
  2624. Variable length arrays are more complicated than regular static arrays and
  2625. imply an extra data access per array to fetch all the data for a record. For
  2626. this reason, it is recommended that regular static arrays be used instead of
  2627. variable length arrays unless efficiency or other considerations require the
  2628. use of a variable array.
  2629.  
  2630.  
  2631. This facility is still undergoing trials and is not currently part of the main
  2632. binary table definition.
  2633.  
  2634.  
  2635.  
  2636.  
  2637. Appendix  B
  2638.  
  2639.  
  2640.  
  2641. Implementation  on  Physical Media
  2642.  
  2643.  
  2644.  
  2645. (This Appendix is not part of the NOST FITS Standard, but is included as a
  2646. guide to recommended practices)
  2647.  
  2648.  
  2649.  
  2650. B.1     Block Size
  2651.  
  2652.  
  2653. The block size (physical record length) for transport of data should, where
  2654. possible, equal the logical record length or an integer blocking factor times
  2655. this record length. Standard values of the blocking factor may be specified
  2656. for each medium; if not otherwise specified, the expected value is unity.
  2657.  
  2658.  
  2659.  
  2660. B.1.1    Nine-Track, Half-Inch Magnetic Tape
  2661.  
  2662.  
  2663. For nine-track half-inch magnetic tapes conforming to the ANSI X3.40-1983
  2664. specifications [13], there should be from one to ten logical records per
  2665. physical block. The BLOCKED keyword (section 5.2.2.1) may be used to warn that
  2666. there may be more than one logical record per physical block. The last
  2667. physical block of a FITS file should be truncated to the minimum number of
  2668. FITS logical records required to hold the remaining data, in accordance with
  2669. ANSI X3.27-1978 specifications [14]. With the issuance of this standard, the
  2670. BLOCKED keyword is deprecated by this document.
  2671.  
  2672.  
  2673.  
  2674. B.1.2    Other Media
  2675.  
  2676.  
  2677. For media where the physical block size cannot be equal to or an integral
  2678. multiple of the FITS logical record length of 23040-bits (2880 8-bit bytes),
  2679. records should be written over multiple blocks as a byte stream.  Conventions
  2680. regarding the relation between physical block size and logical record length
  2681. of FITS files have not been otherwise established for other media.
  2682.  
  2683.  
  2684.  
  2685. B.2     Physical Properties of Media
  2686.  
  2687.  
  2688. The arrangement of digital bits and other physical properties of any medium
  2689. should be in conformance with the relevant national and/or international
  2690. standard for that medium.
  2691.  
  2692.  
  2693.  
  2694. B.3     Labeling
  2695.  
  2696.  
  2697. B.3.1    Tape
  2698.  
  2699.  
  2700. Tapes may be either ANSI standard labeled or unlabeled. Unlabeled tapes are
  2701. preferred.
  2702.  
  2703.  
  2704.  
  2705. B.3.2    Other Media
  2706.  
  2707.  
  2708. Conventions regarding labels for physical media containing FITS files have not
  2709. been established for other media.
  2710.  
  2711.  
  2712.  
  2713. B.4     FITS File Boundaries
  2714.  
  2715.  
  2716. B.4.1    Magnetic Reel Tape
  2717.  
  2718.  
  2719. Individual FITS files are terminated by a tape-mark.
  2720.  
  2721.  
  2722.  
  2723. B.4.2    Other Media
  2724.  
  2725.  
  2726. For media where the physical record size cannot be equal to or an integral
  2727. multiple of the standard FITS logical record length, a record of fewer than
  2728. 23040 bits (2880 8-bit bytes) immediately following the end of the primary
  2729. header, data, or an extension should be treated as an end-of-file. Otherwise,
  2730. individual FITS files should be terminated by a delimiter appropriate to the
  2731. medium, analogous to the tape end-of-file mark. If more than one FITS file
  2732. appears on a physical structure, the appropriate end-of-file indicator should
  2733. immediately precede the start of the primary headers of all files after the
  2734. first.
  2735.  
  2736.  
  2737.  
  2738. B.5     Multiple Physical Volumes
  2739.  
  2740.  
  2741. Storage of a single FITS file on more than one unlabeled tape or on multiple
  2742. units of any other medium is not universally supported in FITS. One possible
  2743. way to handle multivolume unlabeled tape was suggested in [1].
  2744.  
  2745.  
  2746.  
  2747.  
  2748. Appendix  C
  2749.  
  2750.  
  2751.  
  2752. Differences  from  IAU-endorsed Publications
  2753.  
  2754.  
  2755.  
  2756. (This Appendix is not part of the NOST FITS Standard but is included for
  2757. informational purposes only.)
  2758.  
  2759. Note: In this discussion, the term the FITS papers refers to [1], [2], [4],
  2760. and [5], collectively, and the term Floating Point Agreement (FPA) refers to
  2761. [8].
  2762.  
  2763.  
  2764. 1. Section 3 - Definitions, Acronyms, and Symbols
  2765.  
  2766.  
  2767. Array value     - This precise definition is not used in the original FITS
  2768.                   papers.
  2769.  
  2770. ASCII text      - This permissible subset of the ASCII character set, used in
  2771.                   many contexts, is not precisely defined in the FITS papers.
  2772.  
  2773. Basic FITS      - This definition includes the possibility of floating point
  2774.                   data arrays, while the terminology in the FITS papers refers  
  2775.                   to FITS as described in [1], where only integer arrays were 
  2776.                   possible.
  2777.  
  2778. Conforming Extension   - This terminology is not used in the FITS papers.
  2779.  
  2780. Deprecate       - The concept of deprecation does not appear in the FITS FITS
  2781.                   papers.
  2782.  
  2783. FITS structure  - This terminology is not used in the FITS papers in the
  2784.                   precise way that it is in this standard.
  2785.  
  2786. Header and Data Unit  - This terminology is not used in the FITS papers.
  2787.  
  2788. Indexed keyword - This terminology is not used in the original FITS papers.
  2789.  
  2790. Physical value  - This precise definition is not used in the original FITS
  2791.                   papers.
  2792.  
  2793. Reference point - This term replaces the reference pixel of the FITS
  2794.                   papers. The new terminology is consistent with the fact that 
  2795.                   the array need not represent a digital image and that the 
  2796.                   reference point (or pixel) need not lie within the array.
  2797.  
  2798. Reserved keyword - The FITS papers describe optional keywords but do not
  2799.                   say explicitly that they are reserved.
  2800.  
  2801. Standard Extension  - This precise definition is new. The term standard
  2802.                   extension is used in some contexts in the FITS papers to 
  2803.                   refer to what this standard defines as a standard extension 
  2804.                   and in others to refer to what this standard defines as a 
  2805.                   conforming extension.
  2806.  
  2807.  
  2808.   2.  Section 4.3.2 Primary Data Array
  2809.  
  2810. Fill format     - This specification is new. The FITS papers and the FPA do
  2811.                   not precisely specify the format of data fill for the 
  2812.                   primary data array.
  2813.  
  2814.  
  2815.   3.  Section 4.4.1.1 Identity (of conforming extensions)
  2816.  
  2817. The FITS papers specify that creators of new extension types should check with
  2818. the FITS standards committee. This standard identifies the committee specifi-
  2819. cally, introduces the role of the NOST as its agent, and mandates
  2820. registration.
  2821.  
  2822.  
  2823.   4.  Section 5.1.2.1 Keyword (as header component)
  2824.  
  2825. The specification of permissible keyword characters is new. The FITS papers do
  2826. not precisely define the permissible characters for keywords.
  2827.  
  2828.  
  2829.   5.  Section 5.2.1.1 Principal (mandatory keywords)
  2830.  
  2831.  
  2832. (a)  NAXIS keyword    - The requirement that the NAXIS keyword may not be
  2833.                         negative is not explicitly specified in the FITS papers.
  2834.  
  2835. (b)  NAXISn keyword   - The requirement that the NAXISn keyword may not be
  2836.                         negative is not explicitly specified in the FITS papers.
  2837.  
  2838.  
  2839.   6.  Section 5.2.1.2 Conforming Extensions
  2840.  
  2841.  
  2842. (a)  NBITS            - The requirement that NBITS may not be negative is not
  2843.                         explicitly specified in the FITS papers.
  2844.  
  2845. (b)  XTENSION keyword - That this keyword may not appear in the primary header
  2846.                         is only implied by the FITS papers; the prohibition is 
  2847.                         explicit in this standard. The FITS papers name a FITS 
  2848.                         standards committee as the keeper of the list of 
  2849.                         accepted extension type names. This standard 
  2850.                         specifically identifies the committee and introduces 
  2851.                         the role of the NOST as its agent.
  2852.  
  2853.  
  2854.   7.  Section 5.2.2 Other Reserved Keywords
  2855.  
  2856. That the optional keywords defined in the FITS papers are to be reserved with
  2857. the meanings and usage defined in those papers, as in the standard, is not
  2858. explicitly stated in them.
  2859.  
  2860.  
  2861.   8.  Section 5.2.2.1 Keywords Describing the History...
  2862.  
  2863. (a)  DATE Keyword     - The recommendation for use of Universal Time is not in
  2864.                         the FITS papers.
  2865.  
  2866. (b)  BLOCKED keyword  - The FITS papers require the BLOCKED keyword to appear
  2867.                         in the first record of the primary header even though 
  2868.                         it cannot when the value of NAXIS exceeds the values 
  2869.                         described in the text. They do not address this
  2870.                         contradiction.  Deprecation of the BLOCKED keyword is 
  2871.                         new with this standard.
  2872.  
  2873.  
  2874.   9. Section 5.2.2.2 Keywords Describing Observations
  2875.  
  2876.  
  2877. (a)  DATE-OBS Keyword - The recommendation for use of Universal Time is not in
  2878.                         the FITS papers.
  2879.  
  2880. (b)  EQUINOX and EPOCH keywords - This standard replaces the EPOCH keyword
  2881.                         with the more appropriately named EQUINOX keyword and 
  2882.                         deprecates the EPOCH name.
  2883.  
  2884.  
  2885.  10.  Section 5.2.2.4 Commentary keywords
  2886.  
  2887. Keyword field is blank - Reference [1] contains the text "BLANK" to represent
  2888.                          a blank keyword field. The standard clarifies the 
  2889.                          intention.
  2890.  
  2891.  
  2892.  11.  Section 5.2.2.5 Array keywords
  2893.  
  2894.  
  2895. (a)  BUNIT Keyword     - The FITS papers recommend the use of SI units and
  2896.                          identify other units standard in astronomy. This 
  2897.                          standard makes the recommendation more specific by 
  2898.                          referring to the IAU Style Manual [7].
  2899.  
  2900. (b)  CTYPEn Keywords   - This standard extends the recommendations on units to
  2901.                          coordinate axes.
  2902.  
  2903. (c)  CRPIXn Keywords   - This standard explicitly notes the ambiguity in the
  2904.                          location of the index number relative to an image
  2905.                          pixel.
  2906.  
  2907. (d)  CDELTn Keywords   - The definition in the standard differs from that in
  2908.                          the FITS papers in that it provides for the case 
  2909.                          where the spacing between index points varies over 
  2910.                          the grid. For the case of constant spacing, it is
  2911.                          identical to the specification in the FITS papers.
  2912.  
  2913. (e)  DATAMAX and DATAMIN Keywords - The standard clarifies that the value
  2914.                          refers to the physical value represented by the array, 
  2915.                          after any scaling, not the array value before scaling. 
  2916.                          The standard also notes that special values are not 
  2917.                          to be considered when determining the values of 
  2918.                          DATAMAX and DATAMIN, an issue not specifically 
  2919.                          addressed by the FITS papers or the FPA.
  2920.  
  2921.  
  2922.  12.  Section 5.3.2.1 Character String (fixed format) 
  2923.  
  2924. The standard explicitly describes how single quotes are to be coded into
  2925. keyword values, a rule only implied by the FORTRAN-77 list-directed read
  2926. requirements of the FITS papers.
  2927.  
  2928.  
  2929.  13.  Section 5.3.2.4 Real Floating Point Number (fixed format)
  2930.  
  2931. The standard explicitly notes that the full precision of 64-bit values cannot
  2932. be expressed as a single value using the fixed format.
  2933.  
  2934.  
  2935.  14.  Section 5.3.2.4 Complex Floating Point Number (fixed format)
  2936.  
  2937. The standard explicitly notes that the full precision of 64-bit values cannot
  2938. be expressed as a single value using the fixed format.
  2939.  
  2940.  
  2941.  15.  Section 7 Random Groups Structure
  2942.  
  2943. The standard deprecates the Random Groups structure.
  2944.  
  2945.  
  2946.  16.  Section 7.1.2 Reserved keywords (random groups)
  2947.  
  2948. That the optional keywords defined in the FITS papers are to be reserved with
  2949. the meanings and usage defined in those papers, as in the standard, is not
  2950. explicitly stated in them.
  2951.  
  2952.  
  2953.  17.  Section 7.1.2.2 
  2954.  
  2955. PSCALn Keywords    - The default value is explicitly specified in the standard,
  2956.                      whereas in the FITS papers it is assumed by analogy with 
  2957.                      the BSCALE keyword.
  2958.  
  2959.  
  2960.  18.  Section 7.1.2.3 
  2961.  
  2962. PZEROn Keywords    - The default value is explicitly specified in the standard,
  2963.                      whereas in the FITS papers it is assumed by analogy with 
  2964.                      the BZERO keyword.
  2965.  
  2966.  
  2967.  19.  Section 8.1 ASCII Tables Extension
  2968.  
  2969. The name ASCII Tables is given to the Tables extension discussed in the FITS
  2970. papers to distinguish it from binary tables.
  2971.  
  2972.  
  2973.  20.  Section 8.1.1 Mandatory Keywords (ASCII tables)
  2974.  
  2975.  
  2976.  
  2977. (a)  NAXIS1 keyword     - The requirement that the NAXIS1 keyword may not be
  2978.                           negative in an ASCII table header is not explicitly 
  2979.                           specified in the FITS papers.
  2980.  
  2981. (b)  NAXIS2 keyword     - The requirement that the NAXIS2 keyword may not be
  2982.                           negative in an ASCII table header is not explicitly  
  2983.                           specified in the FITS papers.
  2984.  
  2985. (c)  TFIELDS keyword    - The requirement that the TFIELDS keyword may not be
  2986.                           negative is not explicitly specified in the FITS 
  2987.                           papers.
  2988.  
  2989.  
  2990.  21.  Section 8.1.2 Other Reserved Keywords (ASCII tables)
  2991.  
  2992. That the optional keywords defined in the FITS papers are to be reserved with
  2993. the meanings and usage defined in those papers, as in the standard, is not
  2994. explicitly stated in them.
  2995.  
  2996.  
  2997. (a)  TUNIT Keyword      - The FITS papers do not explicitly recommend the use
  2998.                           of any particular units for this keyword, although 
  2999.                           the reference to the BUNIT keyword may be considered 
  3000.                           an implicit extension of the recommendation for that
  3001.                           keyword. This standard makes the recommendation more 
  3002.                           specific for the TUNIT keyword by referring to the 
  3003.                           IAU Style Manual [7].
  3004.  
  3005. (b)  TSCALn Keyword     - The prohibition against use in A-format fields is
  3006.                           stronger than the statement in the FITS papers that 
  3007.                           the keyword "is not relevant".
  3008.  
  3009. (c)  TZEROn Keywords    - The prohibition against use in A-format fields is
  3010.                           stronger than the statement in the FITS papers that  
  3011.                           the keyword "is not relevant".
  3012.  
  3013.  
  3014.  22.  Section 9 Restrictions on Changes
  3015.  
  3016. The concept of deprecation is not provided for in the FITS papers.
  3017.  
  3018.  
  3019.  23.  Appendix B Implementation on Physical Media
  3020.  
  3021. Material in the FITS papers specifying the expression of FITS on specific
  3022. physical media is not part of this Standard.
  3023.  
  3024.  
  3025.  
  3026.  
  3027. Appendix  D
  3028.  
  3029.  
  3030.  
  3031. Summary  of  Keywords
  3032.  
  3033.  
  3034. (This Appendix is not part of the NOST FITS Standard, but is included for
  3035. convenient reference).
  3036.  
  3037.  
  3038.  
  3039.   Principal    Conforming     ASCII Table     Random Groups  Proposed Binary
  3040.     HDU         Extension      Extension        Extension    Table_Extension
  3041. _______________________________________________________________________________
  3042.     SIMPLE      XTENSION       XTENSION (1)      SIMPLE          XTENSION (2)
  3043.     BITPIX      BITPIX         BITPIX = 8        BITPIX          BITPIX = 8
  3044.     NAXIS       NAXIS          NAXIS = 2         NAXIS           NAXIS = 2
  3045.     NAXISn      NAXISn         NAXIS1            NAXIS1 = 0      NAXIS1
  3046.     EXTEND (3)  PCOUNT         NAXIS2            NAXISn          NAXIS2
  3047.     END         GCOUNT         PCOUNT = 0        GROUPS          PCOUNT = 0
  3048.                 END            GCOUNT = 1        PCOUNT          GCOUNT = 1
  3049.                                TFIELDS           GCOUNT          TFIELDS
  3050.                                TBCOLn            END             TFORMn
  3051.                                TFORMn                            END
  3052.                                END
  3053.  
  3054. _______________________________________________________________________________
  3055. 1 XTENSION= 'TABLE  ' for the ASCII Table extension.
  3056. 2 XTENSION= 'BINTABLE' for the proposed binary table extension.
  3057. 3 Required only if extensions are present.
  3058.  
  3059.  
  3060. Table D.1: Mandatory FITS keywords for the structures described in this
  3061.            document.
  3062.  
  3063.  
  3064.  
  3065.  
  3066. Principal    HDU      Conforming   ASCII Table  Random Groups   Binary Table
  3067.  General     Array    Extension     Extension     Extension      Extension
  3068. _______________________________________________________________________________
  3069.  DATE        BSCALE    EXTNAME       TSCALn        PTYPEn         TTYPEn
  3070.  ORIGIN      BZERO     EXTVER        TZEROn        PSCALn         TUNITn
  3071.  BLOCKED     BUNIT     EXTLEVEL      TNULLn        PZEROn         TNULLn
  3072.  AUTHOR      BLANK                   TTYPEn                       TSCALn
  3073.  REFERENC    CTYPEn                  TUNITn                       TZEROn
  3074.  COMMENT     CRPIXn                                               TDISPn
  3075.  HISTORY     CROTAn                                               TDIMn
  3076.              CRVALn                                               THEAP
  3077.  DATE-OBS    CDELTn
  3078.  TELESCOP    DATAMAX
  3079.  INSTRUME    DATAMIN
  3080.  OBSERVER
  3081.  OBJECT
  3082.  EQUINOX
  3083.  EPOCH
  3084.  
  3085. _______________________________________________________________________________
  3086.  
  3087.  
  3088. Table D.2: Reserved FITS keywords for the structures described in this document.
  3089.            Note that the EPOCH and BLOCKED keywords are deprecated by this
  3090.            document.
  3091.  
  3092.  
  3093.  
  3094.        Production  Bibliographic  Commentary    Observation     Array         
  3095.       ____________________________________________________________________
  3096.          DATE        AUTHOR        COMMENT        DATE-OBS      BSCALE
  3097.          ORIGIN      REFERENC      HISTORY        TELESCOP      BZERO
  3098.          BLOCKED                                  INSTRUME      BUNIT
  3099.                                                   OBSERVER      BLANK
  3100.                                                   OBJECT        CTYPEn
  3101.                                                   EQUINOX       CRPIXn
  3102.                                                   EPOCH         CROTAn
  3103.                                                                 CRVALn
  3104.                                                                 CDELTn
  3105.                                                                 DATAMAX
  3106.                                                                 DATAMIN
  3107.  
  3108.       ____________________________________________________________________
  3109.  
  3110.  
  3111. Table D.3: General Reserved FITS keywords described in this document. 
  3112.            Note that the EPOCH and BLOCKED keywords are deprecated by this 
  3113.            document.
  3114.  
  3115.  
  3116.  
  3117.  
  3118. Appendix  E
  3119.  
  3120.  
  3121. ASCII  Text
  3122.  
  3123.  
  3124.  
  3125. (This appendix is not part of the NOST FITS standard; the material in it is
  3126. taken from the ANSI standard for ASCII [11] and is included here for
  3127. informational purposes.)
  3128.  
  3129. In the table below the first column is the decimal and the second column the
  3130. hexadecimal value for the character in the third column. The characters
  3131. hexadecimal 20 to 7E (decimal 32 to 126) constitute the subset referred to in
  3132. this document as ASCII text.
  3133.  
  3134.  
  3135.  
  3136.     _______________________________________________________________________
  3137.     |  ASCII Control  ||                 ASCII Text                       |
  3138.     | dec hex    char || dec hex  char | dec hex char  | dec  hex  char   | 
  3139.     -----------------------------------------------------------------------
  3140.     |  0   00    NUL  || 32   20   SP  | 64   40   @   |  96   60    `    |
  3141.     |  1   01    SOH  || 33   21   !   | 65   41   A   |  97   61    a    |
  3142.     |  2   02    STX  || 34   22   "   | 66   42   B   |  98   62    b    |
  3143.     |  3   03    ETX  || 35   23   #   | 67   43   C   |  99   63    c    |
  3144.     |  4   04    EOT  || 36   24   $   | 68   44   D   | 100   64    d    |
  3145.     |  5   05    ENQ  || 37   25   %   | 69   45   E   | 101   65    e    |
  3146.     |  6   06    ACK  || 38   26   &   | 70   46   F   | 102   66    f    |
  3147.     |  7   07    BEL  || 39   27   '   | 71   47   G   | 103   67    g    |
  3148.     |  8   08    BS   || 40   28   (   | 72   48   H   | 104   68    h    |
  3149.     |  9   09    HT   || 41   29   )   | 73   49   I   | 105   69    i    |
  3150.     | 10   0A    LF   || 42   2A   *   | 74   4A   J   | 106   6A    j    |
  3151.     | 11   0B    VT   || 43   2B   +   | 75   4B   K   | 107   6B    k    |
  3152.     | 12   0C    FF   || 44   2C   ,   | 76   4C   L   | 108   6C    l    |
  3153.     | 13   0D    CR   || 45   2D   -   | 77   4D   M   | 109   6D    m    |
  3154.     | 14   0E    SO   || 46   2E   .   | 78   4E   N   | 110   6E    n    |
  3155.     | 15   0F    SI   || 47   2F   /   | 79   4F   O   | 111   6F    o    |
  3156.     | 16   10    DLE  || 48   30   0   | 80   50   P   | 112   70    p    |
  3157.     | 17   11    DC1  || 49   31   1   | 81   51   Q   | 113   71    q    |
  3158.     | 18   12    DC2  || 50   32   2   | 82   52   R   | 114   72    r    |
  3159.     | 19   13    DC3  || 51   33   3   | 83   53   S   | 115   73    s    |
  3160.     | 20   14    DC4  || 52   34   4   | 84   54   T   | 116   74    t    |
  3161.     | 21   15    NAK  || 53   35   5   | 85   55   U   | 117   75    u    |
  3162.     | 22   16    SYN  || 54   36   6   | 86   56   V   | 118   76    v    |
  3163.     | 23   17    ETB  || 55   37   7   | 87   57   W   | 119   77    w    |
  3164.     | 24   18    CAN  || 56   38   8   | 88   58   X   | 120   78    x    |
  3165.     | 25   19    EM   || 57   39   9   | 89   59   Y   | 121   79    y    |
  3166.     | 26   1A    SUB  || 58   3A   :   | 90   5A   Z   | 122   7A    z    |
  3167.     | 27   1B    ESC  || 59   3B   ;   | 91   5B   [   | 123   7B    -    |
  3168.     | 28   1C    FS   || 60   3C   <   | 92   5C   "   | 124   7C    _    |
  3169.     | 29   1D    GS   || 61   3D   =   | 93   5D   ]   | 125   7D    "    |
  3170.     | 30   1E    RS   || 62   3E   >   | 94   5E   ^   | 126   7E    "    |
  3171.     | 31   1F    US   || 63   3F   ?   | 95   5F   _   | 127   7F    DEL  |  
  3172.     -----------------------------------------------------------------------
  3173.  
  3174.  
  3175.  
  3176.                    Table E.1: ASCII character set
  3177.  
  3178.  
  3179.  
  3180.  
  3181. Appendix  F
  3182.  
  3183.  
  3184.  
  3185. IEEE  Special  Formats
  3186.  
  3187.  
  3188.  
  3189. (The material in this Appendix is not part of this standard; it is taken from
  3190. the IEEE- 754 floating point standard [12] for informational purposes).
  3191.  
  3192. The table below displays the hexadecimal contents, most significant byte
  3193. first, of the double and single precision IEEE special values. bytes are used.
  3194.  
  3195.  
  3196.  
  3197.           IEEE special value     Double Precision     Single Precision         
  3198.        _________________________________________________________________
  3199.                 NaN (1)          7FFFFFFFFFFFFFFF          FFFFFFFF
  3200.                 -0               8000000000000000          80000000
  3201.                 +0               0000000000000000          00000000
  3202.                 +1               7FF0000000000000          7F800000
  3203.                 -1               FFF0000000000000          FF800000
  3204.                 underflow        7FEFFFFFFFFFFFFF          7F7FFFFF
  3205.                 overflow         0010000000000000          00800000
  3206.        _________________________________________________________________
  3207.         1 Referred to as the quiet NaN, as opposed to the signaling NaN
  3208.  
  3209.  
  3210.  
  3211.               Table F.1: IEEE special floating point formats
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217. Appendix  G
  3218.  
  3219.  
  3220. Reserved Extension Type Names
  3221.  
  3222.  
  3223.  
  3224. (This Appendix is not part of the NOST FITS Standard, but is included for
  3225. informational purposes)
  3226.  
  3227.  
  3228.  
  3229.    Type Name     Status  Reference   Sponsor           Comments  
  3230. ______________________________________________________________________________
  3231.    'A3DTABLE'       L      [15]       NRAO      Prototype binary table design
  3232.                                                 supported in AIPS; superseded
  3233.                                                 by BINTABLE, which supports
  3234.                                                 all A3DTABLE features.
  3235.  
  3236.    'BINTABLE'       D       [9]       IAU       Draft Proposal for
  3237.                                       NRAO      binary table design.
  3238.                                       NOAO
  3239.  
  3240.    'DUMP '          R      none       none      Intended for binary dumps.
  3241.  
  3242.    'FILEMARK'       R      none       NRAO      Intended for structure to
  3243.                                                 represent equivalent of
  3244.                                                 tape mark on other media.
  3245.  
  3246.    'IMAGE '        R      [16]        IUE       For including multidimensional
  3247.                                                 matrices in extensions.
  3248.  
  3249.    'TABLE '        S       [5]        IAU       ASCII Tables.
  3250.  
  3251. _______________________________________________________________________________
  3252.  
  3253.  
  3254.  
  3255.                Table G.1: Reserved Extension Type Names
  3256.  
  3257.  
  3258.  
  3259.  Code                               Significance
  3260. _______________________________________________________________________________
  3261.  D     Draft extension proposal for discussion by regional FITS committees.
  3262.  L     Local FITS extension.
  3263.  P     Proposed FITS extension approved by regional FITS committees but not by
  3264.        IAU FITS Working Group.
  3265.  R     Reserved type name for which a full draft proposal has not been
  3266.        submitted.
  3267.  
  3268.  S     Standard extension approved by IAU FITS Working Group and endorsed by
  3269.        the IAU.
  3270. _______________________________________________________________________________
  3271.  
  3272.  
  3273.  
  3274.                       Table G.2: Status Codes
  3275.  
  3276.  
  3277.  
  3278.  
  3279. Appendix  H
  3280.  
  3281.  
  3282. NOST  Publications
  3283.  
  3284.  
  3285.  
  3286. Document           Title                   Date             Status
  3287. _______________________________________________________________________________
  3288. NOST 100-0.1 FITS Standard                December, 1990 Draft Standard
  3289. NOST 100-0.2 FITS Implementation Standard June, 1991     Revised Draft Standard
  3290. NOST 100-0.3 FITS Implementation Standard December, 1991 Revised Draft Standard
  3291. _______________________________________________________________________________
  3292.  
  3293.                     Table H.1: NOST Publications
  3294.  
  3295.  
  3296.  
  3297.  
  3298. Index
  3299.  
  3300.  
  3301.  
  3302. ', 22                                              
  3303. /, 14                                              
  3304. =, 13                                              
  3305.                                                    
  3306. A3DTABLE, 68                                       
  3307. A3DTABLE, extension, 39                            
  3308. AIPS, 5, 39, 68                                    
  3309. ANSI, 5                                            
  3310. ANSI, ASCII, 4                                     
  3311. ANSI, FORTRAN, 3, 14, 21, 43                       
  3312. ANSI, IEEE, 4, 24                                  
  3313. ANSI, tapes, 4, 54                                 
  3314. ANSI, X3.27-1978, 53                               
  3315. ANSI, X3.27-1978, 4                                
  3316. ANSI, X3.40-1983, 53                               
  3317. ANSI, X3.40-1976, 4                                
  3318. array value, 5, 7, 19, 55, 57                      
  3319. array, multidimensional, 10, 11                    
  3320. ASCII Tables, 3                                    
  3321. ASCII tables, vii, 1, 2, 31, 40, 58, 67            
  3322. ASCII, ANSI, 4                                     
  3323. ASCII, character, 5, 23, 31, 34, 45, 63            
  3324. ASCII, characters, 2                               
  3325. ASCII, text, vii, 2, 5, 9, 10, 13, 14, 18,        
  3326.            19, 22, 34, 55, 63                      
  3327. AUTHOR, 18, 43                                     
  3328.                                                    
  3329. Basic FITS, vii, 1, 5, 55                          
  3330. binary tables, 1-3, 27, 39, 61                     
  3331. BINTABLE, 41, 68                                   
  3332. BINTABLE, extension, 39, 61, 67                    
  3333. bit array, 44                                      
  3334. BITPIX, 15, 16, 19, 20, 24, 27, 28, 31, 41
  3335. BLANK, 19, 24, 57                                 
  3336. BLOCKED, 17, 21, 53, 57, 62                       
  3337. BSCALE, 19, 24, 58                                
  3338. BUNIT, 19, 57, 59                                 
  3339. byte order, 23, 24                                
  3340. BZERO, 19, 24, 58                                 
  3341.                                                   
  3342. case sensitivity, 21                              
  3343. CDELTn, 20, 57                                    
  3344. character string, 21, 22, 45, 48, 57              
  3345. COMMENT, 18                                       
  3346. complex, 42                                       
  3347. complex, floating point, 22, 45, 58               
  3348. complex, integer, 22                              
  3349. conforming extension, 2, 5, 8-11, 15, 39, 55, 56  
  3350. CROTAn, 20                                        
  3351. CRPIXn, 20, 57                                    
  3352. CRVALn, 20                                        
  3353. CTYPEn, 20, 57                                    
  3354.                                                   
  3355. data, invalid, 42                                 
  3356. DATAMAX, 20, 57                                   
  3357. DATAMIN, 20, 57                                   
  3358. DATE, 17, 57                                      
  3359. DATE-OBS, 17, 57                                  
  3360. deprecate, 2, 6, 17, 18, 27, 37, 53, 55, 57, 58 
  3361. DUMP, 68                                          
  3362.                                                   
  3363. END, 15, 29, 32, 42                               
  3364. EPOCH, 18, 57, 62                                 
  3365. EQUINOX, 18, 57                                   
  3366. ESA, IUE Newsletter, 4                            
  3367.                                                    
  3368. EXTEND, 16, 17, 21, 31, 40                         
  3369. extension, vii, 1, 2, 6, 8-11, 20, 21, 23, 39, 40, 54, 56, 67 
  3370. extension, conforming, 2, 5, 8-11, 15, 39, 55, 56 
  3371. extension, name, 6                                 
  3372. extension, registration, 10, 56                    
  3373. extension, standard, 11, 16, 56                    
  3374. extension,standard, 8, 11, 31                      
  3375. EXTLEVEL, 21, 42                                   
  3376. EXTNAME, 6, 20, 42                                 
  3377. EXTVER, 21, 42                                     
  3378.                                                    
  3379. FILEMARK, 68                                       
  3380. fill, 10, 13, 30, 33, 34, 56                       
  3381. FITS, structure, 2, 5-7, 9, 11, 17, 37, 55         
  3382. FITS, Working Group, vii, 1, 10, 16, 39            
  3383. floating point, 6, 10, 22, 45, 65                  
  3384. floating point, 64 bit, 24, 58                     
  3385. floating point, complex, 22, 45                    
  3386. floating  point, FITS  agreement, vii, 3, 55 
  3387. floating point, format, 65                         
  3388. format, 32                                         
  3389. format, data, vii, 23                              
  3390. format, extension, 6                               
  3391. format, fixed, 21                                  
  3392. format, keywords, 21                               
  3393. format, standard, 1                                
  3394. format,fixed, 58                                   
  3395. FORTRAN, ANSI manual, 3                            
  3396. FORTRAN-77, format, 32, 34                         
  3397. FORTRAN-77, list-directed read, 14, 21, 58 
  3398.                                                    
  3399. GCOUNT, 16, 17, 27, 29, 30, 32, 41                 
  3400. Going AIPS, 4                                      
  3401. group parameter value, 6, 29, 30                   
  3402. GROUPS, 28                                         
  3403.                                                    
  3404. HDU, 6, 15, 17                                     
  3405. HDU, extension, 9                                  
  3406. HDU, primary, 8-10                                   
  3407. HDU,extension, 6                                     
  3408. HDU,primary, 6, 7, 9, 11                             
  3409. HISTORY, 19                                          
  3410.                                                      
  3411. i, 42                                                
  3412. IAU, vii, 1-3, 6, 55, 68                             
  3413. IAU, 1988 General Assembly, vii                      
  3414. IAU, Commission 5, vii, 1, 10, 16, 39                
  3415. IAU, Style Manual, 3, 19, 34, 57, 59                 
  3416. IAU,Style Manual, 20                                 
  3417. IEEE, 7, 39                                          
  3418. IEEE, ANSI, 4                                        
  3419. IEEE, floating point, 24, 25                         
  3420. IEEE, floating point +0.0, 10                        
  3421. IEEE, NaN, 7, 24, 25, 45                             
  3422. IEEE, special format, 65                             
  3423. IEEE, special values, 2, 7, 20, 24, 25, 45, 57 
  3424. IMAGE, 68                                            
  3425. INSTRUME, 18                                         
  3426. integer value, 22, 44                                
  3427. integer value, 16 bit, 23                            
  3428. integer value, 32 bit, 23                            
  3429. integer value, 8 bit, 23                             
  3430. interferometry, 27                                   
  3431. IUE, 6, 68                                           
  3432. IUE, FITS, 4                                         
  3433.  
  3434. keyword, indexed, 7, 13, 55                          
  3435. keyword, required, 1, 2, 7, 14-16, 27, 31, 56, 58 
  3436. keyword, reserved, 1, 2, 7, 17, 29, 33, 56, 58, 59  
  3437. keyword, valid characters, 13                        
  3438.  
  3439. logical, 42                                          
  3440. logical value, 22, 44                                
  3441.                                                      
  3442. MIDAS, 7, 39                                         
  3443. multidimensional entries, 43, 48                     
  3444.                                                      
  3445. NAXIS, 10, 15-17, 27, 28, 30, 31, 41, 56, 57 
  3446. NAXIS1, 28, 31, 34, 41, 42, 50, 58                  
  3447. NAXIS2, 31, 34, 41, 50, 58                          
  3448. NAXISn, 10, 15, 16, 20, 27, 28, 30                  
  3449. NBITS, 15, 16, 27, 56                               
  3450. NOAO, 7, 68                                         
  3451. NOST, 7, 10, 16, 56                                 
  3452. NRAO, 7, 39, 68                                     
  3453.                                                     
  3454. OBJECT, 18                                          
  3455. OBSERVER, 18                                        
  3456. ORIGIN, 17                                          
  3457.                                                     
  3458. parameter, vii, 29, 30                              
  3459. PCOUNT, 16, 17, 27, 29-31, 41, 50                   
  3460. physical value, 7, 19, 20, 29, 30, 33, 55, 57 
  3461. primary  data  array, 5, 7, 9, 10, 16, 19, 27, 28, 30, 56
  3462. primary header, 2, 5, 7, 9, 14-16, 21, 27, 54, 57
  3463. PSCALn, 29, 30, 58                                  
  3464. PTYPEn, 29, 30                                      
  3465. PZEROn, 29, 30, 58                                  
  3466.                                                     
  3467. quote, 22                                           
  3468.                                                    
  3469. random groups, vii, 1-3, 6, 9, 11, 19, 27, 58 
  3470. random groups, array, vii, 30                      
  3471. REFERENC, 18, 43                                   
  3472. reference point, 7, 20, 55                         
  3473. registration, extension, 10                        
  3474.                                                    
  3475. scaling, data, 19, 29, 30, 33, 57                  
  3476. sign, bit, 23, 24                                  
  3477. sign, character, 34                                
  3478. SIMPLE, 27                                         
  3479. SIMPLE, in primary header, 14, 15                  
  3480. SIMPLE, in special records, 12                     
  3481. special records, 6, 8, 9, 12                       
  3482. standard extension, 8, 11, 16, 31, 56        
  3483.                                              
  3484. TABLE, 31, 68                                
  3485. TABLE, extension, 31, 61                     
  3486. tape, 9-track half-inch, vii, 53             
  3487. TBCOLn, 32                                   
  3488. TDIMnnn, 43, 48, 49                          
  3489. TDISPnnn, 41, 43                             
  3490. TELESCOP, 18                                 
  3491. TFIELDS, 32, 41, 58                          
  3492. TFORMn, 32, 41, 48                           
  3493. THEAP, 43, 50                                
  3494. TNULLn, 33, 34, 41, 42                       
  3495. TSCALn, 33, 34, 42-44, 59                    
  3496. TTYPEn, 33, 41, 42                           
  3497. TUNIT, 59                                    
  3498. TUNITn, 34, 41, 42                           
  3499. TZEROn, 33, 34, 42-44, 59                    
  3500.                                              
  3501. units, 19, 20, 34, 57                        
  3502. Universal Time, 17, 57                       
  3503.  
  3504. value undefined, 34                          
  3505. value, invalid, 44                           
  3506. value, null, 44                              
  3507. value, undefined, 33, 42                     
  3508.                                              
  3509. XTENSION, 8, 12, 16, 20, 31, 41, 56          
  3510.  
  3511.