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

Home » Public Forums » archive » Re: 2d min
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: 2d min [message #74371 is a reply to message #74370] Thu, 13 January 2011 04:26 Go to previous messageGo to previous message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On Jan 13, 2:18 am, chris <rog...@googlemail.com> wrote:
> On 12 Jan., 23:21, Gray <grayliketheco...@gmail.com> wrote:
>
>> Hi all,
>
>> I have a 3d array, NxNxM.  What I would like is to find the minimum of
>> each NxN slice, and note the index of the minimum in the slice.  I can
>> find my minimum by doing min(min(array,ind1,dim=1),dim=1,ind2), but
>> I'm not sure how to turn those two index arrays into the indices that
>> I need.  Help...?
>
>> Thanks!
>
>> --Gray
>
> Hi,
> maybe I missed something, but why don't you use something like this:
>
> IDL> a=randomn(seed,10,10,5)
> IDL> min=min(a,dimension=3,ind)
> IDL> help,min,ind
> MIN             FLOAT     = Array[10, 10]
> IND             LONG64    = Array[10, 10]
> IDL> ind2=array_indices(size(a,/dimensions),ind,/dimensions)
> IDL> help,ind2
> IND2            LONG64    = Array[3, 100]
>
> Is array_indices really to slow with the dimension keyword?
>
> Cheers
>
> CR

This gets me a NxN array of minima... I want a vector of minima of
length M (so the minimum in each plane).
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: r_correlate; get "loop limit expression too large" error with /Kendall
Next Topic: Efficient finding of locations where two 'on' pixels are next to one another

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

Current Time: Thu Oct 09 23:53:52 PDT 2025

Total time taken to generate the page: 0.32233 seconds