[fitsbits] CDELTn

Mark Calabretta mcalabre at atnf.CSIRO.AU
Fri Sep 21 05:21:24 EDT 2007


On Thu 2007/09/20 22:27:17 CST, Doug Tody wrote
in a message to: Mark Calabretta <mcalabre at atnf.csiro.au>
and copied to: Thierry Forveille <Thierry.Forveille at ujf-grenoble.fr>,
      fitsbits at donar.cv.nrao.edu

Hi Doug,

>dimensional "image" with degenerate axes.  The solution (which I think we
>actually adopted) was to separate the image NDIM and WCSDIM, so that the

Yes we did, though it is noteworthy that we made a subtle, though
important mistake in the definition of WCSAXESa by allowing it to take a
default value.  The effect of this is to nullify both NAXIS and WCSAXESa
and force parsers to be implemented in two passes - not a catastrophe but
probably not what we had in mind!  My notes for wcspih() say this:

*   Use of the WCSAXESa keyword is not mandatory and with its default value
*   of "the larger of NAXIS and the largest index of these keywords [CRPIXj,
*   PCi_j or CDi_j, CDELTi, CTYPEi, CRVALi, and CUNITi] found in the FITS
*   header" it effectively invalidates the use of NAXIS for determining the
*   number of coordinate axes and forces a preliminary pass through the header
*   to determine the "largest index" in headers where WCSAXESa was omitted.
*   Also since the use of WCSAXESa is optional there is no way to determine
*   the number of coordinate representations (the "a" value) other than by
*   parsing all of the WCS keywords in the header; even if WCSAXESa is
*   specified for some representations it cannot be known in advance whether
*   it was specified for all of those present in the header.  Hence the
*   scanner must be implemented in two passes.

Note how WCSAXESa nullifies itself and takes out NAXIS for good measure!
It actually becomes a liability if its value is smaller than the largest
index.  Pretty nifty eh?!

Cheers, Mark




More information about the fitsbits mailing list