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

Home » Public Forums » archive » Re: efficient comparing 1D and 3D arrays
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: efficient comparing 1D and 3D arrays [message #60684 is a reply to message #60683] Wed, 11 June 2008 08:09 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Jelle <post@bio-vision.nl> writes:

> Hi All,
>
> At the moment I am trying to find pixels that fall within a certain
> value range for each pixel, as part of a recursive image exploration
> routine.
>
> Say I have the following data:
>
> imgdata = fltarr(NB, NS, NL)
> MinVals = fltarr(NB)
> MaxVals = fltarr(NB)
>
> Now I would like to efficiently find out
> where( (imgdata GT MinVals) and (imgdata LT MaxVals) )
>

There are two possibilities. One is to REFORM/REBIN your MinVals and
MaxVals arrays so they are the same dimension as imgdata, then you can
do your comparison directly.

The other possibility is to make a FOR loop. If NS*NL is large, then
the overhead of the loop should be irrelevant since you are doing many
vector comparisons at each loop step.

Good luck!
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to add tie point information for ENVI in IDL?
Next Topic: Re: Filling a contour

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

Current Time: Fri Oct 10 16:59:41 PDT 2025

Total time taken to generate the page: 0.80005 seconds