You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
astropy.io.fits.Header totextfile and Header.__init__ disagree on 'endcard' convention #339
astropy.io.fits.Header.totextfile creates a header with endcard=False, but Header.__init__ enforces endcard=True (fromfile is modifiable, and fromtextfile defaults to endcard=False, so at least those are not a problem).
I'm not entirely sure what Header.__init__ has to do with this. It's txtfile argument is deprecated anyways. For to/fromtextfile it might at least be worth making this optional.
I didn't realize the txtfile keyword was deprecated; that is the source of the problem. It caused astropy.io.fits to break code that worked with pyfits - I think the endcard keyword was not always used? Anyway, I guess since it's deprecated, there's no reason to fix it.
Well, even though it's deprecated doesn't mean it shouldn't work.... Though I suppose it not working is a good motivation for people to not use it :) But really that's what fromtextfile is for. I think adding support for the endcard argument to to/fromtextfile might be worthwhile. What do you think?
Absolutely. If the endcard keyword is supported in both input & output, it's easier to make code self consistent (i.e., will always be able to read what it writes).
Activity
embray commentedon Aug 10, 2012
I'm not entirely sure what
Header.__init__has to do with this. It's txtfile argument is deprecated anyways. For to/fromtextfile it might at least be worth making this optional.keflavich commentedon Aug 10, 2012
I didn't realize the
txtfilekeyword was deprecated; that is the source of the problem. It causedastropy.io.fitsto break code that worked withpyfits- I think theendcardkeyword was not always used? Anyway, I guess since it's deprecated, there's no reason to fix it.embray commentedon Aug 13, 2012
Well, even though it's deprecated doesn't mean it shouldn't work.... Though I suppose it not working is a good motivation for people to not use it :) But really that's what fromtextfile is for. I think adding support for the
endcardargument to to/fromtextfile might be worthwhile. What do you think?keflavich commentedon Aug 13, 2012
Absolutely. If the
endcardkeyword is supported in both input & output, it's easier to make code self consistent (i.e., will always be able to read what it writes).embray commentedon Oct 2, 2012
I finally got around to fixing this in PyFITS: https://trac.assembla.com/pyfits/ticket/176 Should be included in the next merge from PyFITS.
embray commentedon Nov 26, 2012
This was auto-closed by a commit in a branch that I didn't mean to push to the main repository.
embray commentedon Dec 5, 2012
This is fixed by #495.
Merge branch 'fits/astropy' into astropy
Merge pull request astropy#339 from eteq/add-ze-gsoc