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
Improve verification warnings/errors for FITS header values #3668
A recent thread on astropy-dev prompted some thoughts on things that could be improved in header verification.
There are already several issues related to this: #3603, #3497, #887, #873, and perhaps others.
What I want to specifically address in this issue is unhelpful VerifyError messages. In the case of the linked astropy-dev thread, the error was:
Card 'ESO DET CHIP PXSPACE' is not FITS standard (invalid value string: '2.000e-05 / Pixel-Pixel Spacing').
To begin with, this is misleading. What's being reported as the "value string" is actually the value and the comment--these are passed in, combined, to a single regular expression that breaks it into the value and the comment portions. If this regexp fails then this error is reported. However, there is no way, as currently implemented, for it to specify which part of the string is invalid. It might be possible to fix this by testing for a number of specific common problems; I could probably think of many classes of problems that can be checked for after the initial check fails. In the meantime there are several other things that can be improved about this:
Nowhere does it mention that calling .verify('fix') on the card, or passing verify='fix' to writeto()/close() might fix the issue. That should be fixed, and we should make sure there is a consistent message to that effect whenever verification errors are raised.
It might be nice to automatically try .verify('fix') on any object that fails verification, and actually show the user what would be fixed as a diff, then suggest that they do that. Note, there is also the option to ignore verification errors; then at least non-critical errors in data can still be saved back out (not recommended, but still needed in some cases). Point being, fixes shouldn't automatically be applied to the data, but we can at least show the user what would be fixed. That could help in identifying where the issue is in the original data too.
@hbouy It seems like maybe you deleted your comment. You should try uploading the file, or at least the header, to somewhere that someone can inspect it. If it's totally corrupt it may not be possible to fix automatically. Or it may be just slightly corrupt, but the automatic header fixing doesn't necessarily work for all possible errors.
Activity
embray commentedon May 23, 2016
@hbouy It seems like maybe you deleted your comment. You should try uploading the file, or at least the header, to somewhere that someone can inspect it. If it's totally corrupt it may not be possible to fix automatically. Or it may be just slightly corrupt, but the automatic header fixing doesn't necessarily work for all possible errors.
[astropy#5408] Add regression test and fix for astropy#5408
[astropy#5408] Add regression test and fix for astropy#5408
[astropy#5408] Add regression test and fix for astropy#5408
[astropy#5408] Add regression test and fix for astropy#5408
[astropy#5408] Add regression test and fix for astropy#5408
[astropy#5408] Add regression test and fix for astropy#5408
[astropy#5408] Add regression test and fix for astropy#5408