Lianne |
11/26/2008 05:05PM (Read 4168 times)
|
|
|
Status: offline
Registered: 11/24/2008
Posts: 8
|
I'm trying to create a new task in Iraf. I have been given a script[color=green:2de29b8269][i:2de29b8269]procedure markit (reffile)string reffile
string *flistbegin
flist = reffilewhile ( fscan (flist, s1) != EOF ) { if (access (s1) ) {
print ('Displaying ',s1 )
disp (s1, 1)
tvmark (1, s1//".mark", col=205, interactive=yes)
}
;
}end[/i:2de29b8269]
[/color:2de29b8269]I put this into notepad++ and saved it into the directory where I am working on my images. I called it markit.cl. Then in iraf I used the command to make the task. cl> task $markit = markit.clwhich works, then when I'm trying to call the task I get the following error:cl> markit
**: begin
^
ERROR: syntax error, line 6
called as: 'markit ()'
Any help would be much appreciated.
|
|
|
|
fitz |
11/26/2008 05:05PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Because the task has parameters (i.e. arguments in the procedure declaration, more generally, anything before the 'begin'), you must declare it without the '$', e.g.[code:1:d5473f03f7]task markit = /path/markit.cl[/code:1:d5473f03f7]As for the syntax error, I think notepad may have put some control characters in the file that are causing the problem, the script runs fine for me (file created with 'vi').-Mike
|
|
|
|
Lianne |
11/26/2008 05:05PM
|
|
|
Status: offline
Registered: 11/24/2008
Posts: 8
|
Mike,Ok, I changed the editor to vim, and entered the command task markit = /iraf/markit.clThere is now an error that comes up saying...ERROR: task 'markit' has no param fileThanks!
Lianne
|
|
|
|
fitz |
11/26/2008 05:05PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Do an "cl> unlearn markit" before running the task, its still using the param definition from the first time that lives in your uparm directory.
|
|
|
|
Lianne |
11/26/2008 05:05PM
|
|
|
Status: offline
Registered: 11/24/2008
Posts: 8
|
Ok, i did that, then logged out of iraf, then logged back in. Then I did it again
cl> unlearn markitand it came back with:
ERROR: task 'markit' not found
called as: 'unlearn markit ()'so I then created it again. cl> task markit = markit.cland again it came up with no param file.
|
|
|
|
fitz |
11/26/2008 05:05PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
[quote:5a6be4296b]cl> task markit = markit.cl[/quote:5a6be4296b]Is markit.cl in the current directory or in /iraf/markit.cl as in your last post? Since the parameters are part of the script, a 'has no param file' could also mean the script doesn't exist where the task declaration said it lives (which is the current directory if you don't specify a path).
|
|
|
|
Lianne |
11/26/2008 05:05PM
|
|
|
Status: offline
Registered: 11/24/2008
Posts: 8
|
The markit.cl file is in the current directory.
|
|
|
|
fitz |
11/26/2008 05:05PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Did you do the 'unlearn' after the 'task' statement? Did you change directories after declaring the task?
|
|
|
|
Lianne |
11/26/2008 05:05PM
|
|
|
Status: offline
Registered: 11/24/2008
Posts: 8
|
I did unlearn before the task statement, and I've been in the same directory for everything.
|
|
|
|