next up previous contents
Next: 3. Opening, Locking, Closing Up: CFHT FITS Handling Library Previous: 1. Summary of All   Contents

Subsections

2. Using `idx' Sorting Numbers

2.1 What are `idx' numbers?

With other FITS libraries, the final order of the FITS cards in the header is detemined by one of two things:

  1. The order in which the cards were added in the source, OR
  2. The order in which the cards appear in a template.

For a large system where it may not alway be possible to write all cards from the same section of code, or even the same program, these methods are not the most convenient. A novel feature of this library is that it can sort cards based on numbers, like library of congress reference numbers, which you choose.

The `idx' argument required by many functions in this library is a floating point number used internally for sorting the cards before they are written to a FITS header. Values below 10.0 are reserved for use by the library itself. Other than that, values can be arbitrarily chosen.

2.2 Reserved Keywords

The following keywords must be placed in a specific order to conform to the FITS standard:


  SIMPLE, EXTENSION, BITPIX, NAXIS, NAXIS*, EXTEND, NEXTEND, GROUPS,
  PCOUNT, GCOUNT, TFIELDS, TFORM*, TBCOL*.

The `idx' values for these are ignored. Use FH_AUTO.

2.3 Auto-assigned `idx' Numbers

It is also possible to use FH_AUTO for everything, in which case the order of the FITS header depends only on the order in which cards were added (except for the specific ones listed in the previous section, which will always be first.)

The original `idx' numbers are lost once a header has been re-read from a FITS file. In this case they are assigned numbers 10.001, 10.002, 10.003, ... You can change the base starting number (10.0) by passing a different value to fh_read(). Something like that would be useful if the program uses fh_merge() after.


next up previous contents
Next: 3. Opening, Locking, Closing Up: CFHT FITS Handling Library Previous: 1. Summary of All   Contents
Jim Thomas
2013-12-19