comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL batch mode: Command line args?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL batch mode: Command line args? [message #11482] Thu, 02 April 1998 00:00 Go to previous message
bowman is currently offline  bowman
Messages: 121
Registered: September 1991
Senior Member
In article <35215975.41C6@mail.mmrrcc.upenn.edu>, Mark Elliott
<mark@mail.mmrrcc.upenn.edu> wrote:

> I'd like to run IDL (from UNIX) in batch mode with a command
> like:
>
> unixprompt> idl batchprog.pro

This is how I run an IDL program in batch mode with arguments.

Create a script file named batch_myprog like this:

---------------------------------
echo Running MYPROG
rm $1.out
rm $1.err

(echo .run myprog ; \
echo myprog, \'$1\' ; \
echo exit) | \
idl 1>>$1.out 2>>$1.err
---------------------------------

Make sure batch_myprog is set to have execute permission. (This example
is K shell, but C shell would be similar.)

In this case, MYPROG is an IDL procedure in the file myprog.pro. It takes
one argument (the name of file to be read by MYPROG in this case). The
script will print a message ("Running MYPROG"). Then it will remove files
called $1.out and $1.err, where $1 is the first argument to the script
batch_myprog when you run it. Then it will create an input stream telling
IDL to compile myprog and execute it with the value of $1 as the
argument. This input stream is piped to IDL.

To run the batch job use:

nohup batch_my_prog input_file_1 &

I use this where the argument $1 is a file name to be read by myprog.pro.
The output of the IDL job will be in input_file_1.out and
input_file_1.err. If you want to pass numeric arguments, you should
probably redirect IDL output to different files than $1.out and $1.err.

This is certainly not a generic solution, but for simple argument lists it
works fine. An alternative is to write the batch script arguments to a
file and then pipe that to IDL. This script avoids the intermediate file
by creating the input stream with 'echo'.

Regards, Ken Bowman

--
Kenneth P. Bowman, Assoc. Prof. 409-862-4060
Department of Meteorology 409-862-4132 fax
Texas A&M University bowmanATcsrp.tamu.edu
College Station, TX 77843-3150
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FFT transforms for images
Next Topic: How do you sort an array in IDL?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:15:04 PDT 2025

Total time taken to generate the page: 0.80090 seconds