i have a fits file and i want to add a new header to the fits file.
I've actually added a new fits header but it didn't save it. How to save and add new fits header?
Codes here:
from astropy.io import fits
hdul = fits.open('example.fits.gz')[0]
hdul.header.append('GAIN')
hdul.header['GAIN'] = 0.12
hdul.header.comments['GAIN']="e-/ADU"
print(hdul.header)
Thank in advance