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

Home » Public Forums » archive » Re: Writing on X without X device (!)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Writing on X without X device (!) [message #14538] Tue, 09 March 1999 00:00
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Liam Gumley wrote:
>
> [...]
> To create IDL graphics on a Unix box without being logged in, you need
> two things.
>
> The first is a Unix shell script (which is run in batch mode) which
> invokes IDL. It should look like this:
> [...]>
> The second is an IDL script which does the processing. Note that this is
> a *NOT* a procedure or a function; it has no PRO, FUNCTION, or END
> statements. Here's an example:
>
... but you can call your pros and funs as usual (as long as you make
sure to have the !PATH variable set correctly). Here's an example shell
script that I use to iterate model results:

(1) shell script:
#!/bin/csh

# shell script for remote IDL calls
# called as ridl <programname>
# program must be "main", i.e. no pro or function statement
echo shell script for remote IDL calls

# set environment variables
setenv IDL_DIR /usr/local/lib/rsi/idl_5.1
setenv IDL_PATH \+$IDL_DIR/lib:\+$IDL_DIR/examples
setenv IDL_DEVICE null
setenv IDL_STARTUP ~mgs/IDL/idl_startup.pro
alias idl $IDL_DIR/bin/idl
alias idltool $IDL_DIR/bin/idltool
alias idlhelp $IDL_DIR/bin/idlhelp
alias idldemo $IDL_DIR/bin/idldemo


# call IDL with all parameters
cd IDL/chem1d
echo starting IDL ...
idl $*

--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------
Re: Writing on X without X device (!) [message #14549 is a reply to message #14538] Tue, 09 March 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Andr� L. Bel�m wrote:
> I'm writing a procedure to process satellite images on a map projection.
> I extract the image information from a jpeg file, and then I make some
> transformations and write the result on GIF.
> But I would like to run all in batch mode because this take time and
> must be run every night.
> The problem is: how to run IDl in batch mode and use all tv, tvlct,
> map_image, and others ??

To create IDL graphics on a Unix box without being logged in, you need
two things.

The first is a Unix shell script (which is run in batch mode) which
invokes IDL. It should look like this:

#---cut here---
#!/bin/ksh

# Move to the directory where the IDL script is located

cd $HOME/avhrr

# Run IDL setup script (add IDL_PATH modifications if needed)

. /usr/local/rsi/idl_5/bin/idl_setup.ksh

# Run IDL processing script

idl script.pro
#---cut here---

The second is an IDL script which does the processing. Note that this is
a *NOT* a procedure or a function; it has no PRO, FUNCTION, or END
statements. Here's an example:

;---cut here---
;- Example of an IDL script that runs in the background on Unix

;- Set up Z buffer in 2D mode

set_plot, 'Z'
device, z_buffer=0, set_colors=256, $
set_resolution=[512,512], set_character_size=[6,9]

;- Create graphic

ncolors = !d.table_size
loadct, 39
erase, ncolors/4
map_set, /ortho, /cont, /noerase
map_continents, /fill, color = ncolors/2
map_grid, /label

;- Save graphic to GIF

tvlct, r, g, b, /get
write_gif, 'test.gif', tvrd(), r, g, b

;- Exit IDL

exit
;---cut here---

Note that instead of using an ordinary graphics window (which requires
you to be logged in), the IDL Z buffer is used for displaying graphics.

---
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
Re: Writing on X without X device (!) [message #14551 is a reply to message #14538] Tue, 09 March 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Andr� L. Bel�m (abelem@awi-bremerhaven.de) writes:

> I'm writing a procedure to process satellite images on a map projection.
> I extract the image information from a jpeg file, and then I make some
> transformations and write the result on GIF.
>
> But I would like to run all in batch mode because this take time and
> must be run every night.
> The problem is: how to run IDl in batch mode and use all tv, tvlct,
> map_image, and others ??

Z-Buffer. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155

[Note: This follow-up was e-mailed to the cited author.]
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: menu accelerators?
Next Topic: Re: Free IDL Software

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

Current Time: Wed Oct 08 19:24:40 PDT 2025

Total time taken to generate the page: 0.00746 seconds