View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Problem with tmerge in procedure script

Gabriel wrote on Mar 23, 2009

Hi,

I'm trying to run this simple procedure script:

procedure test ()

real dummy

begin

tmerge (file1,file2 file3 append)

end

and I get:

** Syntax error, line 7
**: tmerge (file1,file2 file3 append)
^ #the upwards arrow, points to the 'a' in append
INTERNAL ERROR: parser gagged
called as: `test ()'

Am I missing something?
Thanks!

Mike Fitzpatrick wrote on Mar 23, 2009

You need commas after each argument and a value of some sort for the 'append' param, i.e.

tmerge (file1, file2, file3, append+)

James Turner wrote on Mar 23, 2009

I think Gaba may be intending to do something more like this (his/her example was just a straight copy of the interactive syntax into parentheses and append is actually the value of the positional parameter "option"):
tmerge (file1//","//file2, file3, "append") 

Cheers,

James.

Gabriel wrote on Mar 23, 2009

Before I was running the script outside the 'Tables' package, now I've loaded it. Is it necessary to have that package loaded?

I tried this combinations (whit 'Tables' loaded):

1) tmerge (file1, file2, file3, append+)

2) tmerge (file1, file2, file3, "append+")

3) tmerge (file1, file2, file3, "append")

4) tmerge (file1//","//file2, file3, "append")

5) tmerge (file1//","//file2, file3, append+)

and they all get the same error:

parameter 'file1' not found (the file 'file1' is in the working folder)

James Turner wrote on Mar 23, 2009

If the files are actually called "file1" etc. (rather than being stored in variables of those names), you need to do this:
tmerge ("file1,file2", "file3", "append")

I'd suggest reading the guide to IRAF scripting, to understand where this syntax comes from:

http://iraf.net/irafdocs/script.pdf

Cheers,

James.

Gabriel wrote on Mar 23, 2009

Thanks James!

This is how I ended up writing that line:

tmerge ((imname//'.mag.1')//","//(imname//'.mag.2'),(imname//'.mag.3'),"append")

Cheers!

Last post on Mar 23, 2009