Use a warning instead of a print statement. Do not use deprecated io.fits.Header interface.