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

Header.set can create empty valued keywords #9696

Closed
sergiopasra opened this issue Nov 27, 2019 · 3 comments
Closed

Header.set can create empty valued keywords #9696

sergiopasra opened this issue Nov 27, 2019 · 3 comments

Comments

@sergiopasra
Copy link
Contributor

sergiopasra commented Nov 27, 2019

I don't know if this is a bug or is expected, but in astropy 3.0 this:

from astropy.io import fits
hdr = fits.header()
hdr.set('A')
print(hdr)

gets you this

A = ' '
END

but in 3.2 you get this

A = 
END

with no value. Is this valid FITS?

EDIT: Fixed code

@pllim pllim added the io.fits label Nov 27, 2019
@pllim
Copy link
Member

pllim commented Nov 27, 2019

Hmm... I see that in 4.1dev too. Do you want to git bisect and see which commit was the culprit?

@saimn
Copy link
Contributor

saimn commented Nov 27, 2019

Yes, this is valid FITS, it creates an undefined card : #8572

@sergiopasra
Copy link
Contributor Author

Yes, the commit is 545f488
I see that before this commit a value of None in this function was mapped to ' '
It's my understanding that this is the intended behavior, so this can be closed.

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