Repository navigation
changed verify('fix') to verify('fix+warn') when printing fits cards - #5054
Conversation
|
The behavior I was actually looking for is fix+warn, so the card is fixed if possible but an exception is not raised if it can't be fixed (which happens only when the header keyword is invalid). I fixed this in the most recent commit, and now it passes all the unit tests. |
|
👍 on doing something for this issue (see also #3668, #887). cc @embray ;-) We had again this issue recently with a FITS file containing an illegal Ideally the default behavior could be configurable ? Currently it is possible to change it only when writing a file. |
| - Made TFORMx keyword check more flexible in test of compressed images to | ||
| enable copatibility of the test with cfitsio 3.380. [#4646] | ||
|
|
||
| - Converting a header card to a string now calls ``self.verify('warn')`` |
|
The real problem here is deeper problems with the verification system that I've groaned about before, but don't have a clear solution to offer. Part of the problem with this is that |
|
I think probably the call to I think there probably are reasons that |
|
Merging this one. If someone wants to revisit the deeper problems mentioned, it can be a new PR. |
Printing a fits header with an invalid keyword currently raises a
VerifyErroron the first try (see #887). This causes problems when headers are converted to strings inside of other functions, because those functions don't catch that error. For example,astropy.wcs.WCS(hdr)crashes whenhdrhas an invalid keyword, even if that keyword is unnecessary for the WCS object. (This is becauseWCScopies the header by converting to a string and back.) This pull request changes theself.verify('fix')call insideself.imagefor header cards toself.verify('warn')so that a warning is still shown but other higher-level functions will be able to continue.