Skip Menu |

This queue is for tickets about the Astro-FITS-Header CPAN distribution.

Report information
The Basics
Id: 2845
Status: resolved
Priority: 0/
Queue: Astro-FITS-Header

People
Owner: aa [...] astro.ex.ac.uk
Requestors: djerius [...] head-cfa.harvard.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: stripping of leading blanks and slashes from comment like cards
When A::F::H parses FITS headers, leading blanks and /'s are explicitly stripped from comment-like cards. In my experience leading spaces are usually significant, as they are often used to improve readability of the comments. In addition, removal of leading slashes may lead to loss of information. In any case, removing the leading characters means that one can't write out exactly the same header as before, which is sometimes necessary to ensure that header checksums aren't recalculcated. Here's a real world example. The salient bits of the header: HISTORY data file: HISTORY /proj/axaf/foo.fits Here's what happens to the comment for the second HISTORY line: DB<1> print (($hdr->itembyname('HISTORY'))[1]->comment) proj/axaf/foo.fits Since the code explicitly removes those characters, I'm sure that someone out there needs this behavior. Perhaps an option? I think that the default behavior should be to retain all of the original characters (excluding trailing blanks, perhaps, as they will be added in automatically anyway). Diab
Diab, Show quoted text
> When A::F::H parses FITS headers, leading blanks and /'s are > explicitly stripped from comment-like cards. In my experience > leading spaces are usually significant, as they are often used to > improve readability of the comments. In addition, removal of > leading slashes may lead to loss of information. In any case, > removing the leading characters means that one can't write out > exactly the same header as before, which is sometimes necessary to > ensure that header checksums aren't recalculcated. Here's a real > world example. The salient bits of the header: > > HISTORY data file: > HISTORY /proj/axaf/foo.fits > > Here's what happens to the comment for the second HISTORY line: > > DB<1> print (($hdr->itembyname('HISTORY'))[1]->comment) > proj/axaf/foo.fits > > > Since the code explicitly removes those characters, I'm sure that > someone out there needs this behavior. Perhaps an option? I think > that the default behavior should be to retain all of the original > characters (excluding trailing blanks, perhaps, as they will be > added in automatically anyway).
Do you have a patch you want to submit to modify this behaviour? Al.