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

Home » Public Forums » archive » REBIN Question
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: rebin question [message #29887 is a reply to message #29822] Sun, 24 March 2002 22:50 Go to previous messageGo to previous message
Mark Fardal is currently offline  Mark Fardal
Messages: 51
Registered: October 1995
Member
hradilv.nospam@yahoo.com (Vince) writes:


> Maybe you could write a function. Which leads me to a new question:
>
> Is it possible to define a function or procedure in IDL that can take
> an arbitrary number of arguments, e.g.:
>
> function my_rebin, a, arg1, arg2, ...
>
> return, round( rebin( float(a), arg1, arg2, ... ) )
> end

Sure. Something like this:

function my_rebin, a, $
arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
;continue to heart's content

narg = n_params()-1
command = 'result = round( rebin( float(a)'
for i = 0, narg-1 do begin
command = command + string(', arg',i,format='(a,i0)')
endfor
command = command + ') )'
junk = execute(command)
return, result
end

I imagine there are limits placed on this technique by the maximum
number of arguments to an IDL procedure, or the maximum length of a
string EXECUTE can handle.

Mark Fardal
University of Victoria
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: A little handy date function
Next Topic: Want to get Array(48) instead of Array(1,48)

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

Current Time: Wed Oct 08 18:44:32 PDT 2025

Total time taken to generate the page: 0.00606 seconds