Skip to content

fitscheck checksum corrections don't work #6530

Description

@jaytmiller

While it was originally written as a migration utility from buggy obsolete pyfits checksums to standard FITS checksums, fitscheck was also designed as a utility simply for working with standard checksums. It could check, add, remove, or correct FITS checksums in the standard form from the command line. Whether they were correct or incorrect, missing or present. No python shell or coding required.

Sometime since 2010, fitscheck lost the ability to correct standard checksums. Checking still works, but not corrections or removals of bad checksums.

I doubt it's used much so it should probably be deprecated and/or dropped. However, another option is to fix checksum updates. Any logic related to "nonstandard vs. standard" checksums can be dropped, it addressed a problem that is long gone.

Activity

  1. pllim commented on Sep 9, 2017

    @pllim
    Member

    Can you please give an example that used to work but does not anymore (and with the offending file if possible)? Did you use a command like stated in http://docs.astropy.org/en/stable/io/fits/usage/scripts.html#module-astropy.io.fits.scripts.fitscheck?

    Verify and update checksums, tolerating non-standard checksums, updating to standard checksum:

    fitscheck --checksum either --write *.fits
    
  2. saimn commented on Sep 12, 2017

    @saimn
    Contributor

    It would be useful to have a more precision description of what doesn't work. There are a few related issues (#5874, #5875, #5902, maybe other) but it's not clear to me what exactly is broken (and I guess it's not only in fitscheck ?).
    About the nonstandard option, if I understand correctly it's here to support the old way of computing the checksum from PyFITS, so it's seems reasonable to remove this.

    ping @embray, it would be super usedful if you have some time to explain a bit more the current behavior !

  3. jaytmiller commented on Sep 14, 2017

    @jaytmiller
    Author

    Sorry, I'm pretty surprised there was interest in fixing it.

    I use it like this:

    $ fitscheck ./*.fits
    EXCEPTION './nrs_rnoise_nrs1_w_01.00.fits' .. Checksum verification failed for HDU ('SCI', 1).
    1 errors

    That seems fine.

    Then I tried to correct like this:

    $ fitscheck --checksum standard --compliance --ignore-missing --write --force *.fits

    I thought that would work anyway, and it appears to.

    But rerunning the check, the errors remain, so the update failed somehow.

    --checksum either

    is the same, doesn't work.

    I suspect the "migration" aspect of the script was little used or never used. So the entire "standard" vs. "non-standard" complexity might be something to deprecate or rip out.

    Zipped test file or box-link to test file forthcoming.

  4. jaytmiller commented on Sep 14, 2017

    @jaytmiller
    Author
  5. saimn commented on Sep 15, 2017

    @saimn
    Contributor

    I have looked at the code yesterday evening, and ... 😱
    It's really broken, I'm working on a fix. I'm also tempted to remove the 'nonstandard' option by the same occasion, is it ok for you @MSeifert04 @pllim ?

  6. pllim commented on Sep 15, 2017

    @pllim
    Member

    I spoke to @jaytmiller who wrote the original script that went into PyFITS. Since he's okay with it, it's fine by me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions