[fitsbits] Primary & Alternate WCS Keyword Order

William Thompson William.T.Thompson at nasa.gov
Wed Jun 27 13:11:34 EDT 2012


I think this is the correct way to look at it.  The keywords BITPIX, NAXISi, 
etc. define the fundamental structure of the data part of the HDU, and thus it 
makes sense to require them to be at the beginning of the header.

It also makes sense to place WCSAXESa before the various other WCS *a keywords 
that might refer to virtual axes beyond that specified by NAXIS, but this has 
nothing to do with the underlying byte structure of the HDU.  It would be better 
to say that the placement of WCSAXESa near the top should be a recommendation 
rather than a requirement.

That's my $0.02 worth,

Bill Thompson


On 06/27/12 10:07, Rob Seaman wrote:
> On Jun 27, 2012, at 6:40 AM, Mark Calabretta wrote:
>
>> Indeed, it is clear why some of these need a specific order
>> (SIMPLE, XTENSION, END).
>>
>> However, it is less clear why others do.  Specifically, why
>> would I need to know the data format (BITPIX, NAXISj, PCOUNT,
>> GCOUNT) until I have finished reading the header?
>>
>> Others seem intended to facilitate one-pass sequential scanning
>> (NAXIS, TFIELDS, WCSAXESa) as these define the number of
>> parameterised keywords to expect.
>
> There do appear to be some rules in the standard (and thus in fitsverify), that no longer serve a useful purpose and could perhaps be relaxed (without jeopardizing OFAF).  Around here we've expended valuable time debating the ordering of PCOUNT and GCOUNT for some data products, when both were present and otherwise correct.
>
> Even on a streaming channel a FITS parser is likely to gobble 2880 header records using SIMPLE, XTENSION, and END as Mark calls out - and only then run through the various conditional statements on the next block of keywords to figure out the number of data records to expect.  This structural parsing is more fundamental than the semantic processing that follows.
>
> It's more human readable to place the most fundamental keywords at the beginning of the headers, but it isn't clear that merely recommending such a practice wouldn't be enough, rather than attempting to legislate it.
>
> Rob
>
>
> _______________________________________________
> fitsbits mailing list
> fitsbits at listmgr.cv.nrao.edu
> http://listmgr.cv.nrao.edu/mailman/listinfo/fitsbits
>

-- 
William Thompson
NASA Goddard Space Flight Center
Code 671
Greenbelt, MD  20771
USA

301-286-2040
William.T.Thompson at nasa.gov




More information about the fitsbits mailing list