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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -