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

Home » Public Forums » archive » Re: IDL, scripts and command line arguments?
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, scripts and command line arguments? [message #29999 is a reply to message #29997] Fri, 29 March 2002 07:29 Go to previous messageGo to previous message
T Bowers is currently offline  T Bowers
Messages: 56
Registered: May 1998
Member
Mike, if I understand you correctly...
If I have an IDL app that I want to be able to pass parameters to from
the command line, I:

1) write my parameters that i wanna pass to a params.txt file, 1
parameter per line. e.g, if my code takes 2 parameters, params.txt
will read:
./indata/file1.hdf
./outdata/outfile1.hdf
For what you want, passing from a command shell I think, this params
file is written to with a command script.

2) I write a wrapper routine (e.g. wrapper.pro) who's job is to read
in the params file then call my app with the appropriate params.

3) Open IDL with this wrapper.pro, compile it, resolve_all, save,
/routines, filename='whatever.sav'

Now, I can run from a command shell. Run the script that that'll write
your params to params.txt. In the script call idl runtime. On unix,
idl -rt=whatever.sav. On win, idlrt whatever.sav

Of course, if your parameters never change, or you just wanna change
them yourself with a text editor, you don't need to bother writing a
shell script. I keep mine general b/c many times i'm processing files
automatically at a certain time of day and i use a script to query an
input dir to see when new files arrive (script grabs by ftp) for
processing. When a new file arrives, regardless of it's name, the code
runs automagically.

Hope this helps,
todd

mmiller3@iupui.edu (Michael A. Miller) wrote in message news:<877knxzmvp.fsf@lumen.indyrad.iupui.edu>...
> Does anyone have any suggestions on ways to trick IDL into
> getting access to command line arguments (argv- and argc-like
> functionality)? The only trick I've come up with so far is to
> write a script in <scripting-language-of-choice> that writes an
> idl procedure with the parameters hard coded into it and then
> executes it. It's not very pretty though and I wonder if there
> are any other possibilities...
>
> Mike
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: idlde on mswin vs unix
Next Topic: map_grid and western longitudes

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

Current Time: Wed Dec 03 17:44:50 PST 2025

Total time taken to generate the page: 1.59232 seconds