next up previous contents
Next: World Coordinate Systems Up: FITS Fundamentals Previous: Reading FITS Format

3.8 FITS Files and Physical Media

  FITS is defined as a logical structure, independent of the medium on which the data appear. FITS files are regarded as bit/byte streams with a 2880-byte logical record length. Data written in FITS format can, for example, be on magnetic tape, magnetic disk, optical disk, or simply on-line. However, the reader of a FITS file must know its physical structure in order to unpack it.

Historically, magnetic tape was the original storage medium for FITS formats. The initial conventions for 1/2-inch 9-track magnetic tape were established in the original FITS paper (Wells, Greisen, and Harten 1981) and modifications to these conventions were presented at the same time as the rules for extensions (Grosbøl et al. 1988). The IAUFWG has since endorsed an additional set of formal rules to relate physical and logical structure for other media. Each medium has its own particular rules. The complete rules are as follows:

Except where a logical record of fewer than 23040 bits serves as an end-of-file indicator, a file should be terminated by the structure for the given medium that corresponds to the tape end-of-file mark. If more than one FITS file appears on a physical structure, the end-of-file indicator appropriate to the medium should separate the files, appearing immediately before the start of the primary header of the next file.

In the original FITS specification, the physical block size was set equal to the logical record length for simplicity. As time passed, however, it became clear that a significant number of the major institutes producing data regarded this physical block size as an inefficient use of tape. On a 6250-bpi tape, only 55% would contain data and 45% would be inter-record gaps; consequently, at the same time as the rules for extensions were developed, it was agreed that physical blocks on 1/2-inch 9-track magnetic tape could contain one to ten logical records. Blocks containing more than one record were called long blocks. At that time, because the multirecord blocks were new and might not be expected by some FITS readers, the BLOCKED keyword was introduced as an indicator that there might be more than one logical record per physical block on a tapes. However, usage was not universal; therefore, absence of the BLOCKED keyword therefore did not guarantee single record blocks, and by its definition, its presence did not guarantee multiple-record blocks. It could thus not be used effectively as intended. As the multiple record block became established as standard, and with the rise of the concept of FITS as a purely logical structure, the need for a BLOCKED keyword has disappeared. Information describing how a tape is blocked should be sent with it, and users should ask for blocking information when receiving tapes. The keyword itself should no longer be used as a blocking indicator, but it remains formally reserved for its original purpose and should also not be used for any other.

(The rules for the BLOCKED keyword also were in conflict with other rules in FITS. This keyword was required to be in the first logical record; however, if the value of NAXIS was greater than 33--or 32 when EXTEND was present--it could not be put in the first record without violating the rule that the NAXISn keywords must be consecutive.)

Conventions for writing a FITS file on more than one physical unit (tape, disk) are only now being developed. In the original FITS paper, Wells, Greisen, and Harten (1979) suggested a method for handling multivolume unlabeled tape, but this proposal has not been put into practice widely. Many current programs that read FITS files will be unable to handle a multiple-unit file. The grouping proposal, discused in section 5.3, uses tables to associate physically separated FITS HDUs into a logical unit.


next up previous contents
Next: World Coordinate Systems Up: FITS Fundamentals Previous: Reading FITS Format