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

Home » Public Forums » archive » basic IDL_IDLBridge question
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
basic IDL_IDLBridge question [message #89302] Thu, 14 August 2014 23:28 Go to next message
Ken G is currently offline  Ken G
Messages: 14
Registered: September 2006
Junior Member
An IDL_IDLBridge question, separate from all of the memory-leak headaches and whatnot. (I'm on Mac OSX 10.9.4, and IDL 8.3.2)

I'd like the bridge object to be able to run code from my own procedure libraries. But since it launches without a startup file, my path and other variable definitions are not set up initially within the Bridge.

So, what are the best ways that people handle this: i.e. to point an IDL_IDLBridge to my procedure libraries, in addition to the basic IDL functions?
Re: basic IDL_IDLBridge question [message #89303 is a reply to message #89302] Fri, 15 August 2014 00:25 Go to previous messageGo to next message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
Assume that you have put all your initialization in a startup file, and issued

pref_set, 'IDL_STARTUP', '/path/to/your/startup/file', /commit

Then you can in the main process set up your bridges like this:

bridgearr = objarr(N)
for ii=0, N-1 do begin
bridgeArr[ii] = obj_new('idl_idlbridge', callback='your_callback_fn', output='your_log_file')
bridgeArr[ii]->execute, '@'+pref_get('IDL_STARTUP')
endfor

It is of course possible to adapt this to work with a custom startup file for bridges instead of using the IDL_STARTUP preference for the main process.

On Friday, 15 August 2014 08:28:28 UTC+2, Ken G wrote:
> An IDL_IDLBridge question, separate from all of the memory-leak headaches and whatnot. (I'm on Mac OSX 10.9.4, and IDL 8.3.2)
>
>
>
> I'd like the bridge object to be able to run code from my own procedure libraries. But since it launches without a startup file, my path and other variable definitions are not set up initially within the Bridge.
>
>
>
> So, what are the best ways that people handle this: i.e. to point an IDL_IDLBridge to my procedure libraries, in addition to the basic IDL functions?
Re: basic IDL_IDLBridge question [message #89307 is a reply to message #89303] Fri, 15 August 2014 09:02 Go to previous messageGo to next message
Ken G is currently offline  Ken G
Messages: 14
Registered: September 2006
Junior Member
Thank you. I've been working with IDL for 21 years, and I admit that I had no idea about the pref_set commands!
Re: basic IDL_IDLBridge question [message #89308 is a reply to message #89307] Fri, 15 August 2014 10:02 Go to previous messageGo to next message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Friday, 15 August 2014 18:02:57 UTC+2, Ken G wrote:
> Thank you. I've been working with IDL for 21 years, and I admit that I had no idea about the pref_set commands!

According to docs, PREF_SET has been around only since IDL 6.2 (July 2005). At that time, we old timers already had ingrained startup script habits, I guess. Personally, I found and learned about PREF_SET when IDL_IDLBRIDGE was introduced in IDL 6.3 (April 2006), because it was the easiest solution i could find to exactly the same bridge problem as discussed in this thread!

--
Yngvar
Re: basic IDL_IDLBridge question [message #89310 is a reply to message #89302] Fri, 15 August 2014 11:22 Go to previous messageGo to next message
Russell Ryan is currently offline  Russell Ryan
Messages: 122
Registered: May 2012
Senior Member
On Friday, August 15, 2014 2:28:28 AM UTC-4, Ken G wrote:
> An IDL_IDLBridge question, separate from all of the memory-leak headaches and whatnot. (I'm on Mac OSX 10.9.4, and IDL 8.3.2)
>
>
>
> I'd like the bridge object to be able to run code from my own procedure libraries. But since it launches without a startup file, my path and other variable definitions are not set up initially within the Bridge.
>
>
>
> So, what are the best ways that people handle this: i.e. to point an IDL_IDLBridge to my procedure libraries, in addition to the basic IDL functions?

Yngvar's got the right voodoo. But you might also worry about the current working directory. I don't think that the IDL_IDLBridge "environment" knows the cwd (which you might want). So after I issue Yngvar's command (or something nearly similar), I then issue something lie

bridge->execute,'cd '+cwd

Just a tip,
Russell
Re: basic IDL_IDLBridge question [message #89311 is a reply to message #89310] Fri, 15 August 2014 14:23 Go to previous message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Friday, August 15, 2014 12:22:35 PM UTC-6, rr...@stsci.edu wrote:
> On Friday, August 15, 2014 2:28:28 AM UTC-4, Ken G wrote:
>
>> An IDL_IDLBridge question, separate from all of the memory-leak headaches and whatnot. (I'm on Mac OSX 10.9.4, and IDL 8.3.2)
>
>>
>
>>
>
>>
>
>> I'd like the bridge object to be able to run code from my own procedure libraries. But since it launches without a startup file, my path and other variable definitions are not set up initially within the Bridge.
>
>>
>
>>
>
>>
>
>> So, what are the best ways that people handle this: i.e. to point an IDL_IDLBridge to my procedure libraries, in addition to the basic IDL functions?
>
>
>
> Yngvar's got the right voodoo. But you might also worry about the current working directory. I don't think that the IDL_IDLBridge "environment" knows the cwd (which you might want). So after I issue Yngvar's command (or something nearly similar), I then issue something lie
>
>
>
> bridge->execute,'cd '+cwd
>
>
>
> Just a tip,
>
> Russell

Here's another tip... There's a limited buffer size in the Execute method, one that's smaller than that of the command line. If you set your !path not through preferences (I only use <IDL_DEFAULT>) but through setups associated with your projects, you might find that some directories go missing in your bridge process if you simply try to set bridge->execute, '!path = "' + !path + '"'.

You can work around this by building !path in the bridge process in chunks.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: error with struct expression
Next Topic: GPU implementation for Grey-Level-Co-occurance-Matrix & Haralick Matrix

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

Current Time: Wed Oct 08 11:27:40 PDT 2025

Total time taken to generate the page: 0.00502 seconds