Re: Newbie trying out IDL scripts [message #80482 is a reply to message #80481] |
Wed, 13 June 2012 19:18   |
John Yeukhon Wong
Messages: 5 Registered: February 2012
|
Junior Member |
|
|
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...
Thanks. I am using Ubuntu.
|
|
|