Subject: fitsio lib -> STS

From: conrad at jupiter.ucsc.edu (Al Conrad, x3208)
Date: 1 Aug 91 16:28:26 GMT

I am using the fitsio library (HEASARC, GSFC, version 2.0) for a spectograph
data taking system and have been asked to extend the system to produce
the two-file fits-on-disk format used by IRAF-STSdAS.  Are there plans
to extend fitsio to produce this format?

Thank you in advance,

Al Conrad
conrad at helios.ucsc.edu

---

From: warnock at nssdca.gsfc.nasa.gov (Archie Warnock)
Date: 2 Aug 91 22:32:00 GMT

In article <jwright.681120716 at cfht.hawaii.edu>, jwright at cfht.hawaii.edu (Jim Wright)          writes...
>This sort of brings up a problem we've been having with FITS.  How do you
>support adding an arbritary number of cards to a FITS header?  The obvious
>solution (two separate files, concatenated when finished) is less attractive
>as the size of the data portion grows.  Right now we're at 8MB files (2Kx2K)

Well, the problem isn't so much that using two files is unattractive - 
rather that the FITS reader you use insists on having a single file.  
The approach taken by IRAF/SDAS/etc, while not FITS (see, Don?  I _have_ 
learned that much), is close enough to allow virtually trivial 
conversion.  There is also code in the IDL User's Library to handle this 
flavor.  Perhaps the solution is in modifying the software to read what 
you can easily manipulate, rather than modifying the data to fit what 
the software can read.  FITS isn't all that flexible, at least, not in 
that sense.

The separate file approach has also been used by the International 
Halley Watch, so solve the problem of how you get the darn headers out 
of the way of tabular data so you can read it with something useful, 
like a database program.

Final solution?  If you're absolutely tied to reading FITS (single file,
as it were :-), try putting in some blank 80-byte records (don't you
dare call them "cards"!!) before the final END statement.  Since
everything is fixed length, 80-bytes within the 2880 byte logical
structure, you can do random-access writes into the blanks. 

Be sure to fill those records with genuine, ASCII 32s, though.  Anything 
else may cause your FITS reader (or someone else's) to puke.  FITS isn't 
flexible in _that_ sense, either.

----------------------------------------------------------------------------
-- Archie Warnock                     Internet:  warnock at nssdc.gsfc.nasa.gov
-- ST Systems Corp.                   SPAN:      NSSDC::WARNOCK
-- NASA/GSFC                          "Unix - JCL for the 90s"