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

Home » Public Forums » archive » How to find second minimum and maximum in 3D array?
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: How to find second minimum and maximum in 3D array? [message #90355 is a reply to message #90353] Wed, 25 February 2015 13:25 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Wednesday, February 25, 2015 at 3:01:53 PM UTC-5, hf...@ssl.berkeley.edu wrote:
> I have a time series of ~200 images with dimensions [X,Y]=[400,250]. My data is a UINTARR[200,400,250]. It is very easy to get the minimum and maximum for each pixel X,Y in my time series using
>
> res=min(array,dimension=1,max=max_val)
> IDL> help,res,max_val
> RES FLOAT = Array[400, 250]
> MAX_VAL FLOAT = Array[400, 250]
>
> However, several pixels have 0 value or 65535 value and I want the second minimum and second maximum which are not 0 or 65535. I can do this in a for-loop, but is there a more clever and faster way?

You could use WHERE() once to find the pixels that are 0 or 65535, and then set those to NAN. Then you can use min() or max() directly with the /NAN keyword to ignore NAN values.

Craig
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: normal, relative and ellipse
Next Topic: Using Slither with Anaconda

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

Current Time: Wed Oct 08 17:45:27 PDT 2025

Total time taken to generate the page: 0.00497 seconds