[fitsbits] [Fwd: cfitisio/wcslib inheritance]

Mark Calabretta mcalabre at atnf.CSIRO.AU
Fri Jun 2 02:31:01 EDT 2006


On Wed 2006/05/31 14:43:55 -0400, William Pence wrote
in a message to: FITSBITS <fitsbits at nrao.edu>

>forwarded from the sci.astro.fits newsgroup....
>
>-------- Original Message --------
>Subject: cfitisio/wcslib inheritance
>Date: Thu, 25 May 2006 10:01:11 +0100
>From: Peter Bunclark <psb at ast.cam.ac.uk>
>Organization: University of Cambridge, England
>Newsgroups: sci.astro.fits
>
>Is there a simple way to inherit the primary header when using
>fits_hdr2str and wcspih ?  The particular case being, EQUINOX and
>RADESYS are in the primary (which has NAXIS  = 0) and the rest
>of the WCS in the extesions of a MEF.

Dear Peter,

wcspih() doesn't pay all that much attention to NAXIS (and ignores
NAXISi).  The number of axes it infers for each of the 27 possible
coordinate descriptions is the maximum of NAXIS, WCSAXESa, and the
maximum value of i or j in the CTYPEia, CRPIXia, PCi_ja, etc. cards;
the number may vary for each description 'a'.  (It counts axes on a
first pass through the header, allocates memory, then constructs the
coordinate descriptions on a second pass.)

>If I concatenate the strings from hdr2str for the primary and
>each extension, will wcspih skim past the initial dataless
>header?

I'm reasonably confident that it will work, but the proof would simply
be to try it!

Of course, such inheritance between HDUs is non-standard.  I would also
add that these keywords have an alternate version code, i.e. EQUINOXa
and RADESYSa; if unqualified they apply only to the primary description
and are not inherited by any secondaries.  (The only exceptions in this
regard are OBSGEO-X/Y/Z, DATE-OBS, DATE-AVG, MJD-OBS, and MJD-AVG.)

Regards,
Mark Calabretta
ATNF




More information about the fitsbits mailing list