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 #11502 is a reply to message #11496] Wed, 01 April 1998 00:00 Go to previous messageGo to previous message
nospam is currently offline  nospam
Messages: 21
Registered: November 1997
Junior Member
In article <mgs-3103981949020001@sc9-14-46.thegrid.net> mgs@sd.cybernex.net (Mike Schienle) writes:


> Here's a variation along those lines. You could set the environment
> variable IDL_STARTUP to point to different batch programs, then call IDL.
> This would start IDL and run the batch file pointed to by IDL_STARTUP.
> Similarly, you could keep IDL_STARTUP pointing to the same file, but
> create that file using your UNIX program (shell, perl, etc.). Get the help
> of your local UNIX shell programming fanatic and you might end up with
> something pretty entertaining. I was doing stuff like this a couple years
> back. I could dig up some ideas from those efforts if you're interested.
> ...

I think it is better to use perl (or sh) with IDL to do this. The
nicest way is like this:

#!/usr/local/bin/perl -w

open(IDL, "|/usr/local/bin/rsi/idl/bin/idl") ||
die "Can't open IDL: $!";
$\="\n";

print IDL "var1 = $ARGV[0]";
print IDL "var2 = $ARGV[1]";

print IDL "doit_procedure, var1, var2";

##etc. You can loop over filenames:

foreach $filename (glob(*)){
print IDL "process_file, '$filename'";
}

print IDL "exit";


I've also written perl scripts that create long IDL scripts that I can
then check over and run, for example to convert a bunch of BMP files
to several files of raw 3D data:

#!/usr/sbin/perl -w

$\ = "\n";
$outdir = "/data1/stuarts/calsim/spatial/surrogate1/";
$indir = "/data1/eo1/jam/";

print "get_lun, F";
foreach $suff (qw(1 b c d e f g h i j k l m n o p q r s t u)){

$outfilename = $outdir . "data" . $suff;
print "openw, F, '$outfilename'";

for ($x = 0; $x < 200; $x++){
$filename = $indir . "data" . $suff . $x . ".bmp";
if (-f $filename){
print "frame = read_bmp('$filename')";
print "writeu, F, frame";
} else {
die "$filename not found\n";
}
}
print "close, F";
}
print "free_lun, F";
print, "end";
--
Scott Stuart
stuart at ll mit edu
[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: Sat Oct 11 00:55:16 PDT 2025

Total time taken to generate the page: 0.24328 seconds