Re: where can I find them [message #30573] |
Tue, 07 May 2002 20:34  |
Xiaoying Jin
Messages: 20 Registered: May 2002
|
Junior Member |
|
|
I suppose that 'which' function only works with .pro files.
As Kenneth Mankoff suggested, we can use "IDL> help, /source" to find them.
Regards,
Xiaoying Jin
"Marshall Perrin" <mperrin+news@arkham.berkeley.edu> wrote in message
news:aba18s$s70$1@agate.berkeley.edu...
> Xiaoying Jin <xje4e@mizzou.edu> wrote:
>> Hi, there,
>>
>> If I know the name of the function, such as "DILATE", how can I find
where
>> IDL implement it? Is there a command in IDL to find the .pro or .dll
files
>> related to it?
>
> I make frequent use of a procedure called "which" which does just this.
> I forget where I originally got the code from... Ah, OK. A web search
> finds it at
> http://www.astro.washington.edu/deutsch-bin/getpro/library02 .html?WHICH
>
> Actually, now that I look at that, that's *not* the same thing as the
> "which.pro" that I have. The output is basically the same, but the one
> I have is substantially faster. I've included the text of this below.
> If anyone has any idea where this code originally came from or who
> the author is, please let me know. I hope the unknown "JAV" responsible
for
> this code doesn't mind my posting it here, as it's really an exceptionally
> usefull little bit of software.
>
> - Marshall
>
>
> -----------------------------------------------------
> pro which,proname
> ;Prints full filenames in IDL !path search order for a particular routine.
> ; proname (input string) procedure name (.pro will be appended) to find
> ;24-Aug-92 JAV Create.
> ;10-Mar-93 JAV Fixed bug; last directory in !path ignored; pad with ': '
>
> if n_params() lt 1 then begin
> print,'syntax: which,proname(.pro assumed)'
> retall
> endif
>
> pathlist = '.:' + !path + ': ' ;build IDL path list
> fcount = 0 ;reset file counter
> il = strlen(pathlist) - 1 ;length of path string
> ib = 0 ;begining substring index
> ie = strpos(pathlist,':',ib) ;ending substring index
> repeat begin ;true: found path separator
> path = strmid(pathlist,ib,ie-ib) ;extract path element
> fullname = path + '/' + proname + '.pro' ;build full filename
> openr,unit,fullname,error=eno,/get_lun ;try to open file
> if eno eq 0 then begin ;true: found file
> fcount = fcount + 1 ;increment file counter
> if path eq '.' then begin ;true: in current directory
> spawn,'pwd',dot ;get current working directory
> dot = dot(0) ;convert to scalar
> print,fullname + ' (. = ' + dot + ')' ;print filename + current dir
> endif else begin ;else: not in current directory
> print,fullname ;print full name
> endelse
> free_lun,unit ;close file
> endif
> ib = ie + 1 ;point beyond separator
> ie = strpos(pathlist,':',ib) ;ending substring index
> if ie eq -1 then ie = il ;point at end of path string
> endrep until ie eq il ;until end of path reached
> if fcount eq 0 then begin ;true: routine not found
> print,'which: ' + proname + '.pro not found on IDL !path.'
> endif
> end
|
|
|
Re: where can I find them [message #30574 is a reply to message #30573] |
Tue, 07 May 2002 19:07   |
mperrin+news
Messages: 81 Registered: May 2001
|
Member |
|
|
Xiaoying Jin <xje4e@mizzou.edu> wrote:
> Hi, there,
>
> If I know the name of the function, such as "DILATE", how can I find where
> IDL implement it? Is there a command in IDL to find the .pro or .dll files
> related to it?
I make frequent use of a procedure called "which" which does just this.
I forget where I originally got the code from... Ah, OK. A web search
finds it at
http://www.astro.washington.edu/deutsch-bin/getpro/library02 .html?WHICH
Actually, now that I look at that, that's *not* the same thing as the
"which.pro" that I have. The output is basically the same, but the one
I have is substantially faster. I've included the text of this below.
If anyone has any idea where this code originally came from or who
the author is, please let me know. I hope the unknown "JAV" responsible for
this code doesn't mind my posting it here, as it's really an exceptionally
usefull little bit of software.
- Marshall
-----------------------------------------------------
pro which,proname
;Prints full filenames in IDL !path search order for a particular routine.
; proname (input string) procedure name (.pro will be appended) to find
;24-Aug-92 JAV Create.
;10-Mar-93 JAV Fixed bug; last directory in !path ignored; pad with ': '
if n_params() lt 1 then begin
print,'syntax: which,proname(.pro assumed)'
retall
endif
pathlist = '.:' + !path + ': ' ;build IDL path list
fcount = 0 ;reset file counter
il = strlen(pathlist) - 1 ;length of path string
ib = 0 ;begining substring index
ie = strpos(pathlist,':',ib) ;ending substring index
repeat begin ;true: found path separator
path = strmid(pathlist,ib,ie-ib) ;extract path element
fullname = path + '/' + proname + '.pro' ;build full filename
openr,unit,fullname,error=eno,/get_lun ;try to open file
if eno eq 0 then begin ;true: found file
fcount = fcount + 1 ;increment file counter
if path eq '.' then begin ;true: in current directory
spawn,'pwd',dot ;get current working directory
dot = dot(0) ;convert to scalar
print,fullname + ' (. = ' + dot + ')' ;print filename + current dir
endif else begin ;else: not in current directory
print,fullname ;print full name
endelse
free_lun,unit ;close file
endif
ib = ie + 1 ;point beyond separator
ie = strpos(pathlist,':',ib) ;ending substring index
if ie eq -1 then ie = il ;point at end of path string
endrep until ie eq il ;until end of path reached
if fcount eq 0 then begin ;true: routine not found
print,'which: ' + proname + '.pro not found on IDL !path.'
endif
end
|
|
|
Re: where can I find them [message #30577 is a reply to message #30574] |
Tue, 07 May 2002 17:17   |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
When using IDLDE "built-in" commands are highlighted in dark blue
(procedures are darker than functions) whilst functions and procedures
written in IDL are in light blue (again, procedures are darker than
functions). This is with the default settings in IDLDE for windows.
DILATE comes up dark blue, leading me to believe it is written in C as part
of IDL and the source is unavailable. Looking in print,!dir+'\lib' I don't
see dilate.pro which seems to confirm IDLDE's behaviour.
-Rick
"Xiaoying Jin" <xje4e@mizzou.edu> wrote in message
news:ab9mm1$ofc$1@dipsy.missouri.edu...
> "Kenneth Mankoff" <mankoff@snoe.colorado.edu> wrote in message
> news:afu1pjrfu0.fsf@snoe.colorado.edu...
>> David Fanning <david@dfanning.com> writes:
>>
>>> Xiaoying Jin (xje4e@mizzou.edu) writes:
>>>
>>>> If I know the name of the function, such as "DILATE", how can I find
> where
>>>> IDL implement it? Is there a command in IDL to find the .pro or .dll
> files
>>>> related to it?
>>>
>>> IDL> ? dilate
>
> I use this command. It links me to the IDL Online Help of "DILATE".
> It doesn't tell me the .pro or .dll files related to it.
>
>> or:
>> IDL> help, /source ; find where IDL stores the implementation
>>
>> resolve_routine OR resolve_all should help you find .pro files
>> related to a given procedure (or, read the source that you found
>> via the help,/source command.
> It seems to me that this command can only find the routine .pro witten in
> IDL.
> I can not find the "DILATE" with this command or any files named
> 'dilate.pro'.
> Maybe it is built in DLL and this command does not help?
> Can I have the possibility to find the source of it?
>
> Best regards,
>
> Xiaoying Jin
>
>
>
>
|
|
|
|
|
|
Re: where can I find them [message #30716 is a reply to message #30574] |
Wed, 08 May 2002 02:41  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Marshall Perrin wrote:
>
> Xiaoying Jin <xje4e@mizzou.edu> wrote:
>> Hi, there,
>>
>> If I know the name of the function, such as "DILATE", how can I find where
>> IDL implement it? Is there a command in IDL to find the .pro or .dll files
>> related to it?
>
> I make frequent use of a procedure called "which" which does just this.
> I forget where I originally got the code from... Ah, OK. A web search
> finds it at
> http://www.astro.washington.edu/deutsch-bin/getpro/library02 .html?WHICH
in idl 5.5 there is a file_which implemented
Reimar
>
> Actually, now that I look at that, that's *not* the same thing as the
> "which.pro" that I have. The output is basically the same, but the one
> I have is substantially faster. I've included the text of this below.
> If anyone has any idea where this code originally came from or who
> the author is, please let me know. I hope the unknown "JAV" responsible for
> this code doesn't mind my posting it here, as it's really an exceptionally
> usefull little bit of software.
>
> - Marshall
>
> -----------------------------------------------------
> pro which,proname
> ;Prints full filenames in IDL !path search order for a particular routine.
> ; proname (input string) procedure name (.pro will be appended) to find
> ;24-Aug-92 JAV Create.
> ;10-Mar-93 JAV Fixed bug; last directory in !path ignored; pad with ': '
>
> if n_params() lt 1 then begin
> print,'syntax: which,proname(.pro assumed)'
> retall
> endif
>
> pathlist = '.:' + !path + ': ' ;build IDL path list
> fcount = 0 ;reset file counter
> il = strlen(pathlist) - 1 ;length of path string
> ib = 0 ;begining substring index
> ie = strpos(pathlist,':',ib) ;ending substring index
> repeat begin ;true: found path separator
> path = strmid(pathlist,ib,ie-ib) ;extract path element
> fullname = path + '/' + proname + '.pro' ;build full filename
> openr,unit,fullname,error=eno,/get_lun ;try to open file
> if eno eq 0 then begin ;true: found file
> fcount = fcount + 1 ;increment file counter
> if path eq '.' then begin ;true: in current directory
> spawn,'pwd',dot ;get current working directory
> dot = dot(0) ;convert to scalar
> print,fullname + ' (. = ' + dot + ')' ;print filename + current dir
> endif else begin ;else: not in current directory
> print,fullname ;print full name
> endelse
> free_lun,unit ;close file
> endif
> ib = ie + 1 ;point beyond separator
> ie = strpos(pathlist,':',ib) ;ending substring index
> if ie eq -1 then ie = il ;point at end of path string
> endrep until ie eq il ;until end of path reached
> if fcount eq 0 then begin ;true: routine not found
> print,'which: ' + proname + '.pro not found on IDL !path.'
> endif
> end
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
|
|
|
Re: where can I find them [message #30717 is a reply to message #30584] |
Wed, 08 May 2002 02:36  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Kenneth Mankoff wrote:
>
> David Fanning <david@dfanning.com> writes:
>
>> Xiaoying Jin (xje4e@mizzou.edu) writes:
>>
>>> If I know the name of the function, such as "DILATE", how can I find where
>>> IDL implement it? Is there a command in IDL to find the .pro or .dll files
>>> related to it?
>>
>> IDL> ? dilate
>
> or:
> IDL> help, /source ; find where IDL stores the implementation
>
> resolve_routine OR resolve_all should help you find .pro files
> related to a given procedure (or, read the source that you found
> via the help,/source command.
I like more the file_which.
print,file_which('mean.pro')
% Compiled module: FILE_WHICH.
% Compiled module: PATH_SEP.
/usr/local/idl/idl/lib/mean.pro
Reimar
>
> -k.
> --
> ------------------------------------------------------------ ----------
> Ken Mankoff http://lasp.colorado.edu/snoe/
> http://lasp.colorado.edu/mars/
> http://lasp.colorado.edu/~mankoff/ http://lasp.colorado.edu/marsrobot/
> ------------------------------------------------------------ ----------
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
|
|
|
Re: where can I find them [message #30718 is a reply to message #30577] |
Wed, 08 May 2002 02:40  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Dear all
If you have a look at IDLDE Run - Profile and System Modules
you get a complete list of IDL Routines.
I believe this list comes from
Routine_Info with the System keyword.
SYSTEM
Set this keyword to return a string array listing all IDL built-in
internal procedures. Built-in internal procedures are part of the IDL
executable, and are not written in the IDL language. If the FUNCTIONS
keyword is also set, ROUTINE_INFO returns a list of all IDL built-in
internal functions.
regards
Reimar
Rick Towler wrote:
>
> When using IDLDE "built-in" commands are highlighted in dark blue
> (procedures are darker than functions) whilst functions and procedures
> written in IDL are in light blue (again, procedures are darker than
> functions). This is with the default settings in IDLDE for windows.
>
> DILATE comes up dark blue, leading me to believe it is written in C as part
> of IDL and the source is unavailable. Looking in print,!dir+'\lib' I don't
> see dilate.pro which seems to confirm IDLDE's behaviour.
>
> -Rick
>
> "Xiaoying Jin" <xje4e@mizzou.edu> wrote in message
> news:ab9mm1$ofc$1@dipsy.missouri.edu...
>> "Kenneth Mankoff" <mankoff@snoe.colorado.edu> wrote in message
>> news:afu1pjrfu0.fsf@snoe.colorado.edu...
>>> David Fanning <david@dfanning.com> writes:
>>>
>>>> Xiaoying Jin (xje4e@mizzou.edu) writes:
>>>>
>>>> > If I know the name of the function, such as "DILATE", how can I find
>> where
>>>> > IDL implement it? Is there a command in IDL to find the .pro or .dll
>> files
>>>> > related to it?
>>>>
>>>> IDL> ? dilate
>>
>> I use this command. It links me to the IDL Online Help of "DILATE".
>> It doesn't tell me the .pro or .dll files related to it.
>>
>>> or:
>>> IDL> help, /source ; find where IDL stores the implementation
>>>
>>> resolve_routine OR resolve_all should help you find .pro files
>>> related to a given procedure (or, read the source that you found
>>> via the help,/source command.
>> It seems to me that this command can only find the routine .pro witten in
>> IDL.
>> I can not find the "DILATE" with this command or any files named
>> 'dilate.pro'.
>> Maybe it is built in DLL and this command does not help?
>> Can I have the possibility to find the source of it?
>>
>> Best regards,
>>
>> Xiaoying Jin
>>
>>
>>
>>
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
|
|
|