On Fri, 25 Nov 2005, Tim Jenness wrote:
> I've added a new routine to the NDF library that will read the .MORE.FITS
> from an NDF and convert it to a FitsChan. I hope nobody minds since I do
> realise that *technically* this is not part of the NDF standard but it
> clearly *is* an unofficial part of the standard since many many
> applications assume it exists. A fitschan seems to be the obvious choice
> although the fits header read from the NDF will not necessarily have its
> astrometry extracted.
I can see this is a very useful function. What was the reasoning for
putting it in the NDF library itself rather than KAPLIBS, which already
contains many other NDF "utility" functions?
> David may want look at this since I've probably been a bit inefficient.
Looks fine to me.
> I'm working on an ndfPtfts to put the FitsChan back into an NDF but I'm
> running into an AST issue. David: since there is no AST function to
> retrieve the nth card (can we have one? there is one to retrieve by name
> and also one to store by card)
Surely you just want to loop through all the cards in the FitsChan don't
you? To do that, just do:
astClear( fitschan, "Card" );
while( astFindFits( fitschan, "%f", card, 1 ) ) {
<append "card" in the end of the FITS extension>
}
If you *really* want to get the n'th card, you can set the Card attribute
to "n" and then do "astFindFits( fitschan, "%f", card, 1 )".
> I need to attach a sink function to the
> supplied fitschan but I don't see any way of doing that without
> constructing a new FitsChan object. How do I do this?
Not possible as things stand. But it shouldn't be necessary should it,
given the above use of astFindFits?
> A quick glance through KAPLIBS indicates that routines similar to the
> above do exist but they usually throw away the FitsChan after the WCS has
> been extracted. For SMURF I am using a FitsChan as my primary FITS header
> type.
Which again raises the question of why not put these new functions in
kaplibs, rather than ndf? As you say, putting them in ndf seems to break
the philosophy of the NDF library which says that anything in MORE is
beyond its control. The whole notion of a FITS extension is really a
KAPPA thing rather than an NDF thing. To do this job properly would
involve introducing a proper FITS component to the NDF structure,
analagous to WCS, HISTORY, etc.
David
|