PyFITS installs a couple of useful utility programs on your system that are built with PyFITS.
fitscheck is a command line script based on pyfits for verifying and updating the CHECKSUM and DATASUM keywords of .fits files. fitscheck can also detect and often fix other FITS standards violations. fitscheck facilitates re-writing the non-standard checksums originally generated by pyfits with standard checksums which will interoperate with CFITSIO.
fitscheck will refuse to write new checksums if the checksum keywords are missing or their values are bad. Use --force to write new checksums regardless of whether or not they currently exist or pass. Use --ignore-missing to tolerate missing checksum keywords without comment.
Example uses of fitscheck:
Verify and update checksums, tolerating non-standard checksums, updating to standard checksum:
$ fitscheck --checksum either --write *.fits
Write new checksums, even if existing checksums are bad or missing:
$ fitscheck --write --force *.fits
Verify standard checksums and FITS compliance without changing the files:
$ fitscheck --compliance *.fits
Verify original nonstandard checksums only:
$ fitscheck --checksum nonstandard *.fits
Only check and fix compliance problems, ignoring checksums:
$ fitscheck --checksum none --compliance --write *.fits
Verify standard interoperable checksums:
$ fitscheck *.fits
Delete checksum keywords:
$ fitscheck --checksum none --write *.fits