Re: Library [message #36990 is a reply to message #34923] |
Sat, 08 November 2003 11:50  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Guillermo Fernandez <guillermo.fernandez@epfl.ch> writes:
>
> I've a bunch of procedures that I use all the time. In order to avoid spaguetti
> coding, I've decided to put them togheter in a library (well... library in C,
> module in Python, you get the idea I guess... the equivalent in IDL).
>
> I've been Googling in order to find how to create and use libraries and have
> been unable to find any documents (nor examples nor tutorials) that explain
> that subject.
>
> Could you please point me to a ressource, join an example or simply give me a
> starting point to get me out of this gap?
Command: Make me a library!
Response: Okay, you're a library.
Seriously, IDL libraries are more conceptual than technical.
Typically, one puts library routines into a single subdirectory in
one's IDL path. [ but that's not required. ]
Often, routines in the same library have names which begin with the
same prefix. [ but that's not required. And JD is not fond of that
technique. ]
Often, libraries are distributed as a single .zip or .tar.gz archive
file with several .pro files inside. [ but that's not required. ]
It is possible to package your library into a single IDL .sav file,
but I don't recommend that for several reasons. First, it's version
dependent. If you ever use a different version of IDL, you'll
probably have to re-make the .sav file. Second, you still need to
restore the .sav file, which is not straightforward to do
automatically.
In conclusion, just put your routines in their own subdirectory, call
them a library, and they will be one.
Yours,
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|