Simple javascript code to copy header to new image?

Not sure what you mean here! Are you wanting to copy the FITS header from one file to another? Seems like an odd thing to want to do!
 
That's what I want to do. There are cases when some activity produces an image without a header (an external program's output brought back into PI, with no significant change to the image parameters).
a
 
You can copy FITS keywords with the following code

newImageWindow.keywords = oldImageWindow.keywords;

Not sure if that is what you mean by header.
 
Hi Alex

I already have a script that adds, edits or deletes keywords on a batch file basis. I have quickly doctored this to allow the facility to copy from a source file. This has been done quickly and without lots of testing but it may either do what you want or at least give you a starting point! Let me know how you get on!

Mike
 

Attachments

  • BatchFITSKeywordEditWithCopy.js.zip
    10.1 KB · Views: 111
Back
Top