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

Home » Public Forums » archive » RESOLVE_ROUTINE not finding MEDIAN function?
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
RESOLVE_ROUTINE not finding MEDIAN function? [message #81101] Fri, 17 August 2012 08:10 Go to next message
John Correira is currently offline  John Correira
Messages: 25
Registered: August 2011
Junior Member
Am I doing something wrong here? I want to use ROUTINE_INFO on median
(well it could be an arbitrary function name, but median is causing a
problem), so I use RESOLVE_ROUTINE first to make sure it is compiled,
but it is not finding median ??? Must be something obvious I'm missing.

Thanks,

John

%%%%%%%%%%%%%%%%%%%%%%%

IDL> resolve_routine, 'median', /EITHER, /COMPILE_FULL_FILE
% Attempt to call undefined procedure/function: 'MEDIAN'.
% Execution halted at: $MAIN$

IDL> print, median([1,2,3,4,5,6,7])
4.00000

IDL> resolve_routine, 'mean', /EITHER, /COMPILE_FULL_FILE
% Compiled module: MEAN.

IDL> resolve_routine, 'stddev', /EITHER, /COMPILE_FULL_FILE
% Compiled module: STDDEV.

IDL> resolve_routine, 'meanabsdev', /EITHER, /COMPILE_FULL_FILE
% Compiled module: MEANABSDEV.

IDL> resolve_routine, 'median', /EITHER, /COMPILE_FULL_FILE
% Attempt to call undefined procedure/function: 'MEDIAN'.
% Execution halted at: $MAIN$

IDL> help, !version, /STRUCTURES
** Structure !VERSION, 8 tags, length=104, data length=100:
ARCH STRING 'x86_64'
OS STRING 'linux'
OS_FAMILY STRING 'unix'
OS_NAME STRING 'linux'
RELEASE STRING '7.1'
BUILD_DATE STRING 'Apr 21 2009'
MEMORY_BITS INT 64
FILE_OFFSET_BITS
INT 64
Re: RESOLVE_ROUTINE not finding MEDIAN function? [message #81196 is a reply to message #81101] Fri, 17 August 2012 09:14 Go to previous message
John Correira is currently offline  John Correira
Messages: 25
Registered: August 2011
Junior Member
On 08/17/2012 11:59 AM, David Fanning wrote:
>
> For system routines, you really have only two choices.
> (1) Read the documentation and hardcode the information you
> need into your program, or (2) call the system routine and
> CATCH any program errors and handle it in whatever way is
> appropriate.
>
> Cheers,
>
> David
>
>
>

Thanks David.

John
Re: RESOLVE_ROUTINE not finding MEDIAN function? [message #81197 is a reply to message #81101] Fri, 17 August 2012 08:59 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
John Correira writes:

> So then I can't use ROUTINE_INFO on it?

Right. :-)

> IDL> info = ROUTINE_INFO('median',/FUNCTIONS,/PARAMETERS)
> % Attempt to call undefined procedure/function: 'MEDIAN'.
> % Execution halted at: $MAIN$
>
> I'm writing a procedure that you pass a function name to as a string
> parameter, and then that function is used later on in the procedure. I'm
> trying to include a check for cases where the caller includes keywords
> but the function does not accept keywords, most likely a user written
> function. The most obvious way seems to be ROUTINE_INFO, i.e.
>
> takeskeywords =
> ((ROUTINE_INFO(functname,/FUNCTIONS,/PARAMETERS)).NUM_KW_ARG S GT 0)
>
>
> but it seems as if that does not work for system routines. Any other
> suggestions?

For system routines, you really have only two choices.
(1) Read the documentation and hardcode the information you
need into your program, or (2) call the system routine and
CATCH any program errors and handle it in whatever way is
appropriate.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: RESOLVE_ROUTINE not finding MEDIAN function? [message #81199 is a reply to message #81101] Fri, 17 August 2012 08:39 Go to previous message
John Correira is currently offline  John Correira
Messages: 25
Registered: August 2011
Junior Member
On 08/17/2012 11:19 AM, David Fanning wrote:
> John Correira writes:
>
>> Am I doing something wrong here? I want to use ROUTINE_INFO on median
>> (well it could be an arbitrary function name, but median is causing a
>> problem), so I use RESOLVE_ROUTINE first to make sure it is compiled,
>> but it is not finding median ??? Must be something obvious I'm missing.
>
> MEDIAN is a system routine. It doesn't need to be compiled. :-)
>
> Cheers,
>
> David
>
>
>

So then I can't use ROUTINE_INFO on it?

IDL> info = ROUTINE_INFO('median',/FUNCTIONS,/PARAMETERS)
% Attempt to call undefined procedure/function: 'MEDIAN'.
% Execution halted at: $MAIN$

I'm writing a procedure that you pass a function name to as a string
parameter, and then that function is used later on in the procedure. I'm
trying to include a check for cases where the caller includes keywords
but the function does not accept keywords, most likely a user written
function. The most obvious way seems to be ROUTINE_INFO, i.e.

takeskeywords =
((ROUTINE_INFO(functname,/FUNCTIONS,/PARAMETERS)).NUM_KW_ARG S GT 0)


but it seems as if that does not work for system routines. Any other
suggestions?

Thanks,

John
Re: RESOLVE_ROUTINE not finding MEDIAN function? [message #81200 is a reply to message #81101] Fri, 17 August 2012 08:19 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
John Correira writes:

> Am I doing something wrong here? I want to use ROUTINE_INFO on median
> (well it could be an arbitrary function name, but median is causing a
> problem), so I use RESOLVE_ROUTINE first to make sure it is compiled,
> but it is not finding median ??? Must be something obvious I'm missing.

MEDIAN is a system routine. It doesn't need to be compiled. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: fft and least sqaues problem
Next Topic: Copying a hash

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

Current Time: Wed Oct 08 15:26:42 PDT 2025

Total time taken to generate the page: 0.00670 seconds