Re: Newbie trying out IDL scripts [message #80485 is a reply to message #80484] |
Wed, 13 June 2012 14:09   |
John Yeukhon Wong
Messages: 5 Registered: February 2012
|
Junior Member |
|
|
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
|
|
|