1

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?

veda905
  • 782
  • 2
  • 12
  • 32
Rian
  • 111
  • 5

1 Answers1

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