With other FITS libraries, the final order of the FITS cards in the header is detemined by one of two things:
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.
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.
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.