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
script 'fitscheck' not deleting CHECKSUM and DATASUM keywords #5874
changed the title [-]script `fitscheck` not deleting `CHECKSUM` and `DATASUM` keywords[/-][+]script 'fitscheck' not deleting CHECKSUM and DATASUM keywords[/+]on Mar 11, 2017
I would say bug fix should be a separate PR from adding tests because they are milestoned differently, but looks like you already added the fix into the testing PR.
Activity
[-]script `fitscheck` not deleting `CHECKSUM` and `DATASUM` keywords[/-][+]script 'fitscheck' not deleting CHECKSUM and DATASUM keywords[/+]mohanagr commentedon Mar 12, 2017
After some digging here's what I think the issue is :-
In order for the
CHECKSUMandDATASUMkeywords to be removed, the checksum kwarg should be passed asHDUList.writeto(checksum='remove')notFalseas is done by theFitscheckscript.(https://github.com/astropy/astropy/blob/master/astropy/io/fits/scripts/fitscheck.py#L112)
Since this calls
base._prewriteto()->base._update_checksum()which deletes only whenremoveis the kwarg.Now, as for the error raised, it is raised only when one uses
-k noneoption as I have highlighted in the issue. This is because in (https://github.com/astropy/astropy/blob/master/astropy/io/fits/scripts/fitscheck.py#L135)There we open the fits file, the call stack terminates at
base._readfrom_internal()which is supposed to call_verify checksum_datasum(which setshdu._checksum) but doesn't because the script option "none" sets the checksum kwarg to False. Check the reference below.Reference
(https://github.com/astropy/astropy/blob/master/astropy/io/fits/hdu/base.py#L460)
mohanagr commentedon Mar 12, 2017
@saimn @pllim Should I open a different PR for this or push it in #5858 where I was writing tests for
fitscheck? Thanks.Fix for issue astropy#5874 for fitscheck script not deleting CHECKSUM…
pllim commentedon Mar 13, 2017
I would say bug fix should be a separate PR from adding tests because they are milestoned differently, but looks like you already added the fix into the testing PR.
Fix for issue astropy#5874 for fitscheck script not deleting CHECKSUM…
bsipocz commentedon Sep 25, 2017
Closing, see #6571 for the fix.