fchecksum -- Verify or update the checksum keywords in a FITS file.


        fchecksum filename 


This task verifies or updates the CHECKSUM and DATASUM keywords in each HDU of the input FITS file. These keywords are used to embed a 32-bit 1's complement checksum into each HDU of the FITS file which can be used to verify the integrity of the file. The CHECKSUM keyword gives an ASCII encoded representation of the complement of the checksum for the entire HDU. A valid CHECKSUM keyword value causes the checksum for the whole HDU to have a value of zero. The DATASUM keyword gives the 32-bit unsigned integer value for the checksum of the data unit alone, stored as an ASCII string since the value may be too large to represent as a 32-bit signed integer. Further details of this checksum algorithm have been published by Rob Seaman in the Astronomical Society of the Pacific Conference Series, Volume 77, "Astronomical Data Analysis Software and Systems IV" and in a revised draft dated June 1995.

This task may be used to either verify the checksums in a file or to update the checksum keyword values if they do not exist or are out of date. If the 'update' parameter has the default value of 'no' then the input file is not modified and the checksums are merely verified; a warning message is issued if the checksum values are not correct, thus indicating that the file has been modified or corrupted since the checksum keywords were originally written.

If an existing FITS file does not contain the checksum keywords or if the keyword values are out of date, then this task may be used to compute the new checksum keyword values by specifying 'update = yes'. If the FITS file already has the correct DATASUM keyword value in each HDU and only the header(s) have been modified then the CHECKSUM keywords can be quickly updated by specifying 'datasum = no'. Specifying 'yes' for this parameter will force the DATASUM keyword to be recomputed (which may take a while for large files) and updated if necessary before recomputing the CHECKSUM keyword value in each HDU.

Note that the fverify task also checks the values of the checksum keywords if they are present.


infile [file name]
Name of the FITS file to be checksummed. Can use @filename to specify a text file containing a list of files to process.

(update = no) [boolean]
Should the checksum keywords be updated if they are no longer correct? By default the checksum keywords are simply verified and a warning message is issued if they are not correct.

(datasum = yes) [boolean]
Should the DATASUM keyword be verified and updated before recomputing the CHECKSUM keyword value? If not, then the DATASUM keyword will be assumed to be correct and will simply be added to the checksum for the header to generate the total checksum for the HDU.

(ok ) [boolean]
Returns the status of checksum verification. This parameter is set to NO if there were problems found while verifying checksums. For a succesful checksum test, it returns YES.


1. Verify the checksum values, without updating the input file:

             ft> fchecksum test.fits

2. Update both the CHECKSUM and DATASUM keywords in the file test.fits:

             ft> fchecksum test.fits update+ datasum+


ftchecksum, ftverify


May95 ftools.futils