Documentation Center

  • Trials
  • Product Updates

matlab.io.fits.writeChecksum

Compute and write checksum for current HDU

Syntax

writeChecksum(fptr)

Description

writeChecksum(fptr) computes and writes the DATASUM and CHECKSUM keyword values for the current HDU into the current header. If the keywords already exist, their values are updated only if necessary (for example, if the file has been modified since the original keyword values were computed).

This function corresponds to the fits_write_chksum (ffpcks) function in the CFITSIO library C API.

Examples

import matlab.io.*
fptr = fits.createFile('myfile.fits');
fits.createImg(fptr,'long_img',[10 20]);
fits.writeChecksum(fptr)
fits.closeFile(fptr);
fitsdisp('myfile.fits','mode','full');

See Also

Was this topic helpful?