TJ> Clearly this also means that SCUBA-2 will need to manipulate blocks of
TJ> FITS headers but I don't want to have to write YAFH manipulation library
The original FTS routines were written before FITSIO existed used by
FITS(D)IN. These are more tolerant of `not-quite FITS' than FITSIO.
When I came to write CONVERT I used FITSIO, being the de facto standard,
code reuse etc.
Later I added the FITSMOD task, and needed to deal with the FITS
airlock. There weren't (and still aren't) sufficient public API utility
routines in FITSIO at the time, and probably still, so I wrote some for
myself. Most of the FITSIO routines operate on a FITS file (unit
argument); here we have an array of _CHAR*80 after access from the NDF
extension. There was the issue of hierarchical headers too. Having
those coded was very helpful when I came to tackle ESO instruments in
ORAC-DR.
TJ> [SURF has its own since I don't think John knew about the kappa
TJ> implementation - which bit of kaplibs does this?
FTS1_EDKEY Edits keywords in a FITS card array.
FTS1_LOKEY Locates an occurrence of a keyword in a FITS header.
FTS1_ISKEY Inquires whether or not a string is a valid FITS keyword.
FTS1_GKEYx Gets the value and comment of a named header of type <x>
from an array of FITS-header card images.
FTS1_QTYPE Determines the data type of a FITS header value.
FTS1_UKEYx Updates value of keyword stored in array FITS-header card
images.
FTS1_WKEYx Writes a FITS-header card for a <x> value or a comment.
These make use of CHR, ERR, and the odd KPG routine (KPG1_SGDIG to
determine whether a keyword value is real or double).
TJ> [...] I see convert seems to have it's own FITS header code as well!].
In CONVERT the COF library largely invokes FITSIO routines rather than
hack the strings as in KAPPA's manipulations of the airlock. They also
call HDS and NDF to interaqce with our data structures. Some interface
our generic and HDS types with FITSIO's, e.g. C->S, and are wrappers to
add contextual error reporting.
There are some rebadged from KAPPA: CON_FKEYx (equivalent to
FTS1_WKEYx), CON_GKEYx, CON_SGDIG, COF_HDATE. They predate KAPLIBS,
and could be factored out.
Malcolm
|