View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Script Error

Nicolastro wrote on Dec 01, 2009

hi !
I'm trying to make a script on IRAF to measure the noise in a aperture. So I use the task "imstat" in the following script :
cl> list="coord.cat"
cl> while (fscan(list,s1) !=EOF){
>>>       imstat s1 >> text.out
>>>}

in which coord.cat is a list where each line is "name[x1:x2,y1:y2]".
And that return me that there is a Syntax Error.
Can you help me ?

Thanks

Nicolas

Mike Fitzpatrick wrote on Dec 01, 2009

If text.out[ is a literal file name, it needs to be in quotes.

Nicolastro wrote on Dec 01, 2009

Thanks for your help, but now I have an other error .

The variable s1 is not what is read by the task fscan in the file list, but s1 is 's1' during all the process. So in the file 'text.out' there is :
Error reading image s1 ...


Do you have an idea ?

Mike Fitzpatrick wrote on Dec 01, 2009

Try using the "program mode" syntax, i.e.


imstat (s1, >> "text.out")


What you have now is called "compute mode" and is the style you would use at the CL prompt. I thought I tested this before my earlier reply and it worked either way, but if you are really using procedure script and your post was just a snippet then that would explain the error.

-Mike

Nicolastro wrote on Dec 01, 2009

You're right !!!!

Now all it's ok, thank you very much for your answer fitz.

Regards

Nicolas

Last post on Dec 01, 2009