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

Is a card without equals character fixable? #6780

Open
MSeifert04 opened this issue Oct 22, 2017 · 3 comments
Open

Is a card without equals character fixable? #6780

MSeifert04 opened this issue Oct 22, 2017 · 3 comments

Comments

@MSeifert04
Copy link
Contributor

The current documentation of fits verification states that a card like "FIX4 2" should be fixable. However it currently isn't fixable:

>>> from astropy.io import fits
>>> c = fits.Card.fromstring('FIX4 2')
>>> c.verify('fix')
WARNING: The following header keyword is invalid or follows an unrecognized non-standard convention:
FIX4 2                                                                           [astropy.io.fits.card]

I'm not sure if that ever worked or when that regression was introduced. But should such a card be fixable?

@ayush1999
Copy link

ayush1999 commented Oct 25, 2017

>>> from astropy.io import fits
>>> c = fits.Card.fromstring('FIX4 2')
>>> c.verify('fix')
WARNING: The following header keyword is invalid or follows an unrecognized non-standard convention:
FIX4 2 [astropy.io.fits.card]
>>> d = fits.Card.fromstring('FIX1 = 2.1e23')
>>> d.verify('fix')
WARNING: VerifyWarning: Verification reported errors: [astropy.io.fits.verify]
WARNING: VerifyWarning: Card 'FIX1' is not FITS standard (invalid value string: '2.1e23'). Fixed 'FIX1' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING: VerifyWarning: Note: astropy.io.fits uses zero-based indexing.
[astropy.io.fits.verify]
>>> c.verify('fix')
>>>

`

Once we've fixed the second card, the first one (FIX4 2) gets fixed without any warning. That's weird. Any idea why this is happening? @MSeifert04

@MSeifert04
Copy link
Contributor Author

@ayush1999 Not sure what you mean and how it relates to the issue here.

But it's normal that a second c.verify('fix') doesn't print any warnings - you already verified and fixed it a few lines above.

However this issue was about how c can be fixed. It could fix it by having FIX4 as keyword and 2 as value, at least the old documentation indicated that. However as far as I can see that never worked (at least for astropy, no idea when and if it worked in pyfits) and I don't know if it should work.

@embray embray added the Bug label Jul 8, 2021
@embray
Copy link
Member

embray commented Jul 8, 2021

This could be seen as either a bug or a feature request... :)

I think it should be considered fixable by treating whitespace equivalently to the missing equal sign.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants