Say I read a FITS file
from astropy.io import fits
from astropy.utils.data import get_pkg_data_filename
image_file = get_pkg_data_filename('tutorials/FITS-images/HorseHead.fits')
cube = fits.open(image_file)[0]
And I want to make a copy of its header so I can modify the copy without changing the original header
header_copy = cube.header
header_copy.remove('OBJCTY')
However, this also modifies cube.header
.
How would I go about to make an actual copy of the header, rather than creating a new pointer to the header?
header_copy = ?