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

Home » Public Forums » archive » MAX function in IDL8.0
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
MAX function in IDL8.0 [message #72777] Fri, 08 October 2010 06:25
Anne Martel is currently offline  Anne Martel
Messages: 10
Registered: May 1995
Junior Member
I was happy to see that the new version of IDL includes a DIMENSION
keyword for the max function but I don't understand why the
max_subscript feature returns indices relative to the whole array,
rather than the index in the dimension specified. A simple example to
illustrate this:

If I create a 2D array q:

q=[[1,4,3,2,7,0],[2,4,1,3,4,1]]

and run

IDL> print,q
1 4 3 2 7 0
2 4 1 3 4 1

IDL> marr = max(q,ind,dim=2)

The returned max array is as expected:
IDL> print,marr
2 4 3 3 7 1

The max_subscripts are
IDL> print,ind
6 1 2 9 4 11

but what i would prefer is the subscripts in the 2nd dimension
IDL> print,ind/6
1 0 0 1 0 1

In this example it is trivial to convert to what I want but if, for
example I want to generate a time to peak map from a dynamic sequence of
images , or return the most likely class from a stack of probability
maps, then I still have to write a procedure to do this.
Can anyone think of some example where the way max_subscript is
implemented is superior or should I just campaign for a modification in
some future release?

Anne
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ITT VIS Website
Next Topic: Re: MAX function in IDL8.0

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

Current Time: Wed Oct 08 19:56:44 PDT 2025

Total time taken to generate the page: 0.00711 seconds