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

Home » Public Forums » archive » Re: One file for each procedure/function?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: One file for each procedure/function? [message #30335 is a reply to message #30329] Fri, 19 April 2002 07:28 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Pepijn Kenter wrote:
>
> Hi all.
>
> I'm currently writing analyses software (small programs plus routines) for
> an ozon measurement device and I'm new to IDL. A lot of the routines and
> programs have already been written and are ready for me to use. These
> routines have been grouped together in a few .pro files. These files are
> then compiled explicitly (by .compile statements) in the main programs. The
> programs are called from the command line.
>
> I'm under the strong impression that this is not the normal way of working
> and that you should create one file for each function or procedure, which is
> than compiled automaticly when it's needed. These files should be put in a
> directory that is included in the !path system variable.
>
> Still, I would like to keep functions that belong to each other grouped
> together; if not in one file, then at least in one directory. So I've
> devided the routines over a few directories and used the expand_path
> function to include these directories in the !path variable.
>
> Is this the best way of working?
> Or are there better way's of ordering your routines (like units in pascal)?
> I want to keep using the command line to start my programs (i.e. i don't
> want to be dependend on .prj files)
>
> I'm not happy with the 'one file for each function' concept but if this is
> the way IDL is designed I think I'd better stick to it, rather than using
> obscure tricks to circumvent it.

In my .bashrc file I have:

export IDL_PATH=${IDL_PATH}:+\${HOME}/idl

Note the +\${HOME}/idl

What this does is make everything in ${HOME}/idl, including nested subdirectories, "visible" to
IDL when you run it. My ${HOME}/idl directory looks like:

lnx:/home/paulv : dir idl
total 148
drwxr-xr-x 4 wd20pd wd4 4096 Oct 2 2001 AIRS/
drwxr-xr-x 6 wd20pd wd4 4096 Oct 2 2001 ATOVS/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 Ancillary/
drwxr-xr-x 2 wd20pd wd4 4096 Oct 2 2001 CVS/
drwxr-xr-x 3 wd20pd wd4 4096 Apr 18 14:04 Constants/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 Date_Time/
drwxr-xr-x 4 wd20pd wd4 4096 Oct 2 2001 Development/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 Emissivity/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 Error_Handling/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 F90_Documentation/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 GIFTS/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 General/
drwxr-xr-x 4 wd20pd wd4 4096 Oct 2 2001 Graphics/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 HIS/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 Interpolation/
drwxr-xr-x 3 wd20pd wd4 4096 Apr 18 12:49 LBLRTM/
drwxr-xr-x 3 wd20pd wd4 4096 Apr 19 09:10 Meteorology/
drwxr-xr-x 4 wd20pd wd4 4096 Oct 2 2001 NAST-I/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 NCDF/
drwxr-xr-x 3 wd20pd wd4 4096 Apr 3 17:04 NCEP_RTM/
drwxr-xr-x 3 wd20pd wd4 4096 Dec 18 09:34 PDdata/
drwxr-xr-x 4 wd20pd wd4 4096 Mar 22 19:04 Radiance/
drwxr-xr-x 3 wd20pd wd4 4096 Feb 4 13:20 Spectral/
drwxr-xr-x 3 wd20pd wd4 4096 Nov 14 15:06 Swap_Endian/
drwxr-xr-x 5 wd20pd wd4 4096 Apr 18 14:12 Transmittance/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 UARS/
drwxr-xr-x 2 wd20pd wd4 4096 Jan 22 15:27 Utility/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 WgtFnGUI/
-rw-r--r-- 1 wd20pd wd4 288 Apr 18 12:44 idl_startup.pro
-rw-r--r-- 1 wd20pd wd4 3349 Jan 30 2001 template.pro
drwxr-xr-x 8 wd20pd wd4 4096 Oct 2 2001 user_contrib/

where the directory name usually refers to the "CATEGORY" item in the documentation template
that comes with IDL. I group my code into the above directories according to their use. Some
directories have subirectories, e.g.:

lnx:/home/paulv/idl : dir ATOVS
total 16
drwxr-xr-x 2 wd20pd wd4 4096 Oct 2 2001 CVS/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 readers/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 scan_analysis/
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 visualisation/
lnx:/home/paulv/idl : dir user_contrib
total 24
drwxr-xr-x 3 wd20pd wd4 4096 Oct 2 2001 chris_sisko/
drwxr-xr-x 2 wd20pd wd4 4096 Oct 2 2001 dfanning/
drwxr-xr-x 4 wd20pd wd4 4096 Oct 2 2001 liam_gumley/
drwxr-xr-x 2 wd20pd wd4 4096 Oct 2 2001 markwardt/
drwxr-xr-x 2 wd20pd wd4 4096 Oct 2 2001 martin_schultz/
drwxr-xr-x 2 wd20pd wd4 4096 Oct 2 2001 mcraig/

I'm sure there's more logical ways to organise stuff, but this works for me.

paulv

--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Chain-Link Algorithm for Perimeter
Next Topic: Re: Chi-square decision trees

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

Current Time: Fri Oct 10 05:39:16 PDT 2025

Total time taken to generate the page: 0.55954 seconds