If you have all your cards concatenated together into a single long string,
each occupying 80 characters (with no delimiters), you can insert them
into a FitsChan in a single call using
astPutCards.
This call first empties the supplied FitsChan of any existing cards, then
inserts the new cards, and finally rewinds the FitsChan so that a
subsequent call to
astRead
will start reading from the first supplied card. The
astPutCards function uses astPutFits
internally to interpret and store each individual card, and so the
caveats in should be read.
For instance, if you are using the CFITSIO library for access to FITS files, you can use the CFITSIO fits_hdr2str function to obtain a string suitable for passing to astPutCards:
if( !fits_hdr2str( fptr, 0, NULL, 0, &header, &nkeys, &status ) ) fitschan = astFitsChan( NULL, NULL, "" ); astPutCards( fitschan, header ); header = free( header ); wcsinfo = astRead( fitschan ); ... }
AST A Library for Handling World Coordinate Systems in Astronomy