View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Merging headers

jcadien1 wrote on Nov 28, 2006

I have a program which works on an image and writes new and updated header info to an ascii_header file. I used ref trying to find a function which would merge this new header file with the current one in the image file, updating keywords that are in both, and adding the ones that are not in the original image header. I did not find such a function. Is there something that will do this?

Thanks,

Jim

Francisco Valdes wrote on Nov 28, 2006

Hello Jim,

The two tasks that are relevant are artdata.mkheader and proto.hfix. The problem with the first one is the append option does not update existing keywords. The problem with the second is that you have to does some kind of sed or other task to modify the file the way you want.

The other potential tasks are hedit and astutil.hedit though for these you would need to do something further since they don't work directly off a file of keywords. Not knowing how you generate the ascii file note that the two tasks mentioned in the previous paragraph require the formating to be fairly close to FITS; i.e. you can just use "ABC = value" but instead "ABC = 'value'".

I hope this helps.

Yours,
Frank Valdes

Last post on Nov 28, 2006