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

Home » Public Forums » archive » Re: Newbie trying out IDL scripts
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: Newbie trying out IDL scripts [message #80481] Wed, 13 June 2012 20:20 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Wednesday, June 13, 2012 10:18:06 PM UTC-4, gokop...@gmail.com wrote:
> On Wednesday, June 13, 2012 9:31:08 PM UTC-4, Craig Markwardt wrote:
>> On Wednesday, June 13, 2012 8:25:59 PM UTC-4, gokop...@gmail.com wrote:
>>> On Wednesday, June 13, 2012 5:09:48 PM UTC-4, gokop...@gmail.com wrote:
>>>> On Wednesday, June 13, 2012 5:06:18 PM UTC-4, Craig Markwardt wrote:
>>>> > On Wednesday, June 13, 2012 3:13:21 PM UTC-4, gokop...@gmail.com wrote:
>>>> > > Hey guys,
>>>> > >
>>>> > > I am an undergraduate student working on a scientific collaborative platform. One of the languages we supported is IDL.
>>>> > >
>>>> > > We don't have X Windows setup properly. We have trouble doing that, and in fact we don't want windows to popup because we are running CRON jobs. SO everything has to be done on the background, and our front-end needs to display the results...
>>>> > >
>>>> > > I found this script to do error catching, notify users that they their scripts are not compatible with our system...
>>>> > > http://www.idlcoyote.com/code_tips/hasdisplay.html
>>>> > >
>>>> > >
>>>> > > How do you use this to run a script called "plots.pro"? What should be put after the THEN? How should it be used?
>>>> > >
>>>> > > At the end, I need to put that command in a .sh shell script file...
>>>> > >
>>>> > > Example:
>>>> > > IDL> IF NOT CanConnect() THEN PRINT, "hello"
>>>> > > % WINDOW: Unable to connect to X Windows display: :0.0
>>>> > > hello
>>>> > >
>>>> > > Okay.. this looks okay....
>>>> > >
>>>> > > But, I don't need to run PRINT, I need to run a script....
>>>> > > I took my plots.pro and data file from here
>>>> > > http://math.arizona.edu/~swig/documentation/idl/
>>>> > >
>>>> > > TIps?
>>>> >
>>>> > You can't "run a script" the way that you want, if you mean ".RUN PLOTS"
>>>> > That kind of script-running is limited to the interactive command line (or an @-file).
>>>> >
>>>> > You would be better off turning plots.pro into a true procedure which you can call like any other procedure by typing its name. Then you can do,
>>>> > IF NOT CanConnect() THEN PLOTS
>>>> > (I would recommend a better name than PLOTS however)
>>>> >
>>>> > You make it confusing whether you want to disable graphics or enable them. If you want to truly disable X graphics for a cron job, then I recommend making sure that the DISPLAY shell variable is undefined *before* calling IDL. (tcsh="unsetenv DISPLAY" or bash="unset DISPLAY; export DISPLAY")
>>>> >
>>>> > IDL will not attempt to use X graphics if the Unix shell variable DISPLAY is undefined. You can also immediately run
>>>> > SET_PLOT, 'Z'
>>>> > withing IDL immediately after starting up, which will make doubly sure that graphics commands go to the Z-buffer.
>>>> >
>>>> > Craig
>>>>
>>>> Thanks for the suggestion.
>>>> Just wondering... suppose you supply some IDL scripts. Do I have to add something like "set_plot, 'z'" manually to every plot procedure?
>>>>
>>>> Is there a global effect? That's the issue we really have....
>>>>
>>>> I have a starter plot example which uses the Z buffer to output the image.
>>>> Thanks
>>>
>>> I just tried to unset the DISPLAY. But
>> ...
>>
>> How did you unset it?
>
> Hi Craig,
>
> I did this in the terminal
> unset DISPLAY
> I tried this as well
> unset DISPLAY
> export DISPLAY
>
> and your suggestion
> unset DISPLAY; export DISPLAY
> bash="unset DISPLAY; export DISPLAY"
>
>
> then immediately I fired up idl
> idl > .run plots
>
> It is still reading display=:0.0 as you can see from the error...

What shell are you using? I gave you two different sets of instructions depending on which shell you use.

If you are using bash,
unset DISPLAY; export DISPLAY
if you are using csh or tcsh
unsetenv DISPLAY

Then start IDL.
Then
set_plot, 'z'
Then run whatever you want.

Are you saying after that, it is still trying to connect to X?

Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Newbie trying out IDL scripts
Next Topic: Problem in PSM

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

Current Time: Fri Oct 10 12:43:32 PDT 2025

Total time taken to generate the page: 1.51834 seconds