Tim,
> > My original version of fitschan (circa 1996) did indeed have a larger public
> > interface which allowed much more detailed manipulation of the cards in
> > the fitschan, but RFWS insisted I made the majority of it private. He
> > wanted to keep the public interface for AST as minimal as possible in
> > order to make it look "easy to use", with no peripheral clutter. I suppose
>
> :-)
It's true!
> > his point is that AST is a library for handling coordinate systems, not a
> > FITS header library. He did unbend sufficiently to allow the astDelFits
> > and astFindFits methods to be made public though, which are not strictly
> > necessary for the purposes of handling coordinate systems.
>
> Maybe a libfitshdr ? :-)
>
> >
> > Still RFWS is not around any longer, so we can talk about this again. Can
> > you specify what functionality you would need?
> >
>
> Standard header manipulation stuff.
>
> - create fitshdr struct from a char**
> from a char* (80xN block of memory)
>
> - extract values and comments from header for a specific keyword
>
> - create and parse header cards
>
> - add new cards to an existing header
>
> A FitsHdr* ?
>
> All without having to worry about memory management (all that handled by a
> struct initialisation routine and a dealloc routine) so that cards are
> added to the header without having to malloc anything explicitly.
>
> FitsChan would be layered on top of this.
All this stuff does of cource exist within FitsChan already. The simplest
(and most robust) course would be just to make it public, rather than
doing major deep surgery on FitsChan to create a lower level entity. The
existing public functionality of FitsChan allows you to create a FitsChan
and add entire formatted cards, either individually or as a single string
holding a long list of 80 char sub-strings. It allows you to search for
cards for a given keyword, and extract the complete formatted card. It
allows you to delete cards. What is missing is the function which splits a
card up into keyword, value and comment, and the corresponding
functionality to create a card from a keyword name, a value and a comment.
Look in fitschan.c and search for astFitsSet<X> and astFitsGet<X>. These
are the main two currently protected functions you may be interested in,
but there are others such as astSplit, astKeyFields, astEmpty,
astFitsSetCom, astFitsGetCom, ...
Would these do?
Do I remember you need stuff which is written in C? If not, of course
there is all the stuff in kaplibs.
David
|