Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
FITS_TEST_CHECKSUM()
Verify the values of the CHECKSUM and DATASUM keywords in a FITS header
Follows the 23 May 2002 version of the FITS checksum proposal at http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
result = FITS_TEST_CHECKSUM(HDR, [ DATA, ERRMSG=, /FROM_IEEE ])
HDR - FITS header (vector string)
DATA - data array associated with the FITS header. If not supplied, or set to a scalar, then there is assumed to be no data array associated with the FITS header.
An integer -1, 0 or 1 indicating the following conditions: 1 - CHECKSUM (and DATASUM) keywords are present with correct values 0 - CHECKSUM keyword is not present -1 - CHECKSUM or DATASUM keyword does not have the correct value indicating possible data corruption.
/FROM_IEEE - If this keyword is set, then the input is assumed to be in big endian format (e.g. an untranslated FITS array). This keyword only has an effect on little endian machines (e.g. a Linux box).
ERRMSG - will contain a scalar string giving the error condition. If RESULT = 1 then ERRMSG will be an empty string. If this output keyword is not supplied, then the error message will be printed at the terminal.
The header and data must be *exactly* as originally written in the FITS file. By default, some FITS readers may alter keyword values (e.g. BSCALE) or append information (e.g. HISTORY or an inherited primary header) and this will alter the checksum value.
CHECKSUM32, FITS_ASCII_ENCODE(), SXPAR()
Verify the CHECKSUM keywords in the primary header/data unit of a FITS file 'test.fits' FITS_READ,'test.fits',data,hdr,/no_PDU,/NoSCALE print,FITS_TEST_CHECKSUM(hdr,data) Note the use of the /No_PDU and /NoSCALE keywords to avoid any alteration of the FITS header
W. Landsman SSAI December 2002 Return quietly if CHECKSUM keywords not found W. Landsman May 2003 Add /NOSAVE to CHECKSUM32 calls when possible W. Landsman Sep 2004
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]