Re: How to call an IDL procedure from a DLM [message #47697 is a reply to message #47686] |
Fri, 24 February 2006 00:27   |
Maurizio Tomasi
Messages: 7 Registered: December 2005
|
Junior Member |
|
|
Karl Schultz wrote:
> On Thu, 23 Feb 2006 08:26:54 -0500, Haje Korth wrote:
>
>> Maurizio,
>> What you are trying to do is an interesting concecpt, but I don't think DLMs
>> are intended to work this way. At least I have never run across an example
>> for such use. Isn't the whole purpose of DLMs, call_external, etc. to call
>> code that is specifically NOT implemeneted in IDL? Why would you bother
>> writing a DLM if the functionality is already present in IDL?
>
> I'm thinking that he is doing part of his DLM processing in C, and then
> gets to a point where it would be Really Nice to call an IDL routine to
> finish it up because the IDL routine is at-hand and might be a pain to
> translate into C or whatever.
>
> It should be possible to refactor the code though to do some things in C
> and then return the intermediate results to IDL, where he can then call
> the IDL code. I can't speculate further without knowing more about the
> problem.
My IDL program implements a full graphical user interface using the IDL
widget library, and is getting quite large (~ 80,000 lines of code). It
must load a large number (~ 5000) of FITS files whose size sums up to 1
GB. We cannot alter these numbers. The first version of the program was
completely written in IDL, and was really slow when loading files. Se we
are developing a DLM with C and the CFITSIO library, in order to make
the loading process faster (our preliminary tests show a gain in time of
more than one order of magnitude).
The program has a "log window" which keeps track of what the program is
doing. The purpose of this window is to have a record of what it has
been done. It is very important that every message is recorded in a file
as well, and that the file is immediately flushed and closed after each
message, in order for the messages to be saved even if the system breaks
down during the loading process.
The log window is of course implemented using pure IDL. The problem is
that the DLM should write a message in the log window for each FITS file
that is loaded successfully. And in order to do this it should call a
"write_log_message" procedure, which is obviously written in IDL
(because it uses IDL widgets).
Thank you for your suggestions,
Maurizio.
|
|
|