A Space & astronomy forum. SpaceBanter.com

Go Back   Home » SpaceBanter.com forum » Astronomy and Astrophysics » FITS
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

[fitsbits] [Fwd: cfitisio/wcslib inheritance]



 
 
Thread Tools Display Modes
  #1  
Old June 2nd 06, 07:31 AM posted to sci.astro.fits
external usenet poster
 
Posts: n/a
Default [fitsbits] [Fwd: cfitisio/wcslib inheritance]


On Wed 2006/05/31 14:43:55 -0400, William Pence wrote
in a message to: FITSBITS

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
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

  #2  
Old June 2nd 06, 08:10 AM posted to sci.astro.fits
external usenet poster
 
Posts: n/a
Default [fitsbits] [Fwd: cfitisio/wcslib inheritance]

Mark Calabretta wrote:
On Wed 2006/05/31 14:43:55 -0400, William Pence wrote
in a message to: FITSBITS

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
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

Thanks chaps. I had used NAXIS as an example where a parser might get
confused, rather than the one and only central issue.
Perhaps inheritance isn't in the standard, but I'd say it's becoming
common practice. In the case of VISTA (4m IR telescope at ESO/Paranal
end of 2006) there are 16 extensions so inheritance is a real
efficiency.
I did the experiment and by concatenating each successive data header
to the primary and parsing the whole lot, it all seems to work fine.
But if I could add to the wish list, it would be good if wcspih could
inherit - so you would parse the primary, then when parsing each
extension, flag that you remember old stuff and overwrite if there
happens to be replacements in the inheriting header.

Also, I was glad to see there was a technical reason why my original
post was ignored for a week!

Cheers
Pete.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[fitsbits] [Fwd: cfitisio/wcslib inheritance] William Pence FITS 0 June 1st 06 06:38 PM
[fitsbits] [Fwd: cfitisio/wcslib inheritance] William Pence FITS 0 May 31st 06 07:43 PM
[fitsbits] [Fwd: FITS to HDF5 converter] William Pence FITS 1 January 27th 06 11:52 AM
[Fwd: [Fwd: Big Bang Busted in Science Classes for High Schools]] Double-A Misc 0 May 31st 04 11:17 PM
[Fwd: [Fwd: Big Bang Busted in Science Classes for HighSchools]] Richard Henry Misc 2 May 31st 04 05:10 PM


All times are GMT +1. The time now is 02:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 SpaceBanter.com.
The comments are property of their posters.