python - Astropy add checksum to existing fits file -
i have fits file written (someone sent me) , want add checksum , datasum header. examples found adding checksum using astropy.io.fits involve building new fits hdu , verifying it on adding each section hdu. do, seems have lot more overhead needed.
is there way add checksum , datasum existing hdu?
imagehdu
objects have method called .add_checksum
. should want.
so open fits file in update mode , call , close file again.
hdus = astropy.io.fits.open(filename, mode='update'): hdus[0].add_checksum() # fill in arguments need them hdus.close()
or if with
statement:
with astropy.io.fits.open(filename, mode='update') hdus: hdus[0].add_checksum() # fill in arguments need them
Comments
Post a Comment