View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

question on simple programming

Guest wrote on Jul 24, 2006

Dear IRAF support,

I'd like to as a question about how to make the simple script working.
I supply the next script to the "cl" :

cl> cl < a.cl

where a.cl is the following:
---- cat a.cl ---
apscatter @objects.list out=@obj.list refer=bs
hselect @objects.list $I,APSCATTE yes
---- end of a.cl ---

The first string works well, but the next one, actually any next
string, doesn't want to start up. What's wrong here?

Best wishes,

Mike Fitzpatrick wrote on Jul 24, 2006

Is the first APSCATTER supposed to be interactive? Redirected CL scripts like this take ALL input from the redirection, so an apscatter task prompt would actually be reading the next line in the a.cl file, not the keyboard.

-Mike

Dmitry wrote on Jul 24, 2006

Hi Mike, thank you for the answer,

yes, APSCATTER has to be interactive here. Can I do anything in this case to run more tasks in this script?

Dmitry

Mike Fitzpatrick wrote on Jul 24, 2006

Try the "compute mode" syntax, i.e.

apscatter ("@foo", out="@bar", ....)
next_task ("@foo", ....)

-Mike

Dmitry wrote on Jul 24, 2006

Hi, I tried the following sequence but it doesn't work when apscatter runs in interactive mode; it stops once the first line is done.

apscatter ("foo1", out="bar1", refer="foobar")
apscatter ("foo2", out="bar2", refer="foobar")
next_task ("foo", ....)

Mike Fitzpatrick wrote on Jul 24, 2006

Then does your work with APSCATTER require a response to a prompt or is it just cursor mode commands? For example, an input file like

[code]implot dev$pix
q[/quote]

run as "cl < foo" will work and see the 'q' as an invalid command once you normally quit the implot from the cursor mode. However, a task that prompts the user and reads from the stdin will read the next line of the re-directed file (I can post an example if needed).

Anyway, the best all-around method is to just make this a procedure script and run it as a regular task.

-Mike

Last post on Jul 24, 2006