Re: Writing on X without X device (!) [message #14549 is a reply to message #14538] |
Tue, 09 March 1999 00:00   |
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
|
|
|