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

Home » Public Forums » archive » Re: Multi-Array comparison
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: Multi-Array comparison [message #71555 is a reply to message #71547] Sun, 27 June 2010 19:57 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Jun 27, 9:40 am, wlandsman <wlands...@gmail.com> wrote:
> Here's one way to do what I think you want.    (I am not sure what you
> mean by a "best server".)  If your 3 arrays are a,b, and c then
>
> arrmax = a > b > c    ;get the maximum value at each i,j
> Na = total(a EQ arrmax)   ;Number of times the maximum is found in the
> a array
> Nb = total(b EQ arrmax)
> Nc = total(c EQ arrmax)
>
> Then the maximum of Na, Nb, Nc will tell you which array has the most
> pixels at the maximum value.    (Note that Na + Nb + Nc may be more
> than the total number of pixels if there are equal values.)    --Wayne
>
> On Jun 27, 4:58 am, Giuseppe Papa <giuseppep...@gmail.com> wrote:
>
>
>
>> Hello everybody,
>
>> I have three fltarr(460,483) and I would like to compare them, finding
>> for each element i,j of the arrays which one among the three guarantee
>> the maximum value. However, since I just need to know a sort of "best
>> server" index, I'm looking for the percentage so finding the total
>> amount will be enough. I've found out the WHERE function, but in my
>> case (three or more arrays) should I make a loop? Any ideas?
>
>> Thanks,
>
>> Giuseppe

Or how about:

maxval = max([[[a]],[[b]],[[c]]], dimen=3, ind)
print, max(histogram(ind / n_elements(a)))

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Continuous colorbar
Next Topic: Gridding Wizard preview

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

Current Time: Thu Oct 09 20:47:41 PDT 2025

Total time taken to generate the page: 1.28474 seconds