I have to make the header of a fits file called 'exponential.fits' the same as the header of 'empirical.fits'. Is there any way to do it with writefits.pro?
Asked
Active
Viewed 117 times
1 Answers
0
Yes, you can do this with writefits.pro
but you will end up overwriting the file that already exists so you may want to look into doing it with another program. But the way to do it using writefits
(assuming you wanted the 0th extension header) would be:
; get the header you want and the data of the file you need
empirical_hdr = headfits('empirical.fits') ;header
exponential_data = readfits('exponential.fits') ;data
;overwrite the exponential.fits with what you want
writefits,'exponential.fits',exponential_data,header=empirical_hdr

veda905
- 782
- 2
- 12
- 32