Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO.FITS: Problem with HIERARCH keywords #994

Closed
pchanial opened this issue Apr 17, 2013 · 6 comments
Closed

IO.FITS: Problem with HIERARCH keywords #994

pchanial opened this issue Apr 17, 2013 · 6 comments
Assignees
Labels
Milestone

Comments

@pchanial
Copy link

With the FITS package included in astropy 0.2.1, the HIERARCH keywords in the following FITS file cannot be read. It used to work with pyfits 3.0.6

@pchanial
Copy link
Author

Well... is there a way to attach a FITS file ?

The offending lines in the header are like :
HIERARCH key.META_4='calFileVersion'

reading this header as h, h['key.META_4'] does not return 'calFileVersion'.

@embray
Copy link
Member

embray commented Apr 17, 2013

Thanks for the report. I think I see what the problem is--in normal FITS keyword records the value indicator (the string between the keyword and the value) must be = (with a space after the equal sign). But a close reading of the HIERARCH keyword convention document indicates no such requirement for HIERARCH keywords. There may be no spaces after the =. I guess this inconsistency is a tradeoff for more space in the already cramped 80 byte record.

@pchanial
Copy link
Author

Thanks for the quick fix. There is still a minor issue:
such keywords as returned by header.keys() have a leading space: ' key.META_4'

@pchanial
Copy link
Author

There is also another issue, which is reproducible but it's hard to make a simple test case. Maybe if I tell you what happens, you'll understand:
There is a wrong verify warning: Card keyword 'key.META_0' is not upper case.

What's happening in Card._verify is that

  • self._image is None, so that the test checking for HIERARCH keyword does fail
  • if I force self._image to be populated before the test, simply by computing str(self) the warning is not issued (as expected).

@pchanial
Copy link
Author

I have filed these two issues (with a test case) as spacetelescope/PyFITS#6 and spacetelescope/PyFITS#7

@embray
Copy link
Member

embray commented May 14, 2013

This is fixed with the merge of #1076.

@embray embray closed this as completed May 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants