如何在IDL中使两个文件的标题相同?

时间:2016-04-13 12:17:54

标签: idl-programming-language fits

我必须使名为'exponential.fits'的拟合文件的标题与'empirical.fits'的标题相同。有什么办法可以用writefits.pro吗?

1 个答案:

答案 0 :(得分:0)

是的,您可以使用writefits.pro执行此操作,但最终会覆盖已存在的文件,因此您可能希望尝试使用其他程序执行此操作。但是使用writefits(假设你想要第0个扩展头)的方法是:

; 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