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

Home » Public Forums » archive » where on indices based on a variable condition without many loops
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
where on indices based on a variable condition without many loops [message #88287] Mon, 07 April 2014 15:28 Go to previous message
havok2063 is currently offline  havok2063
Messages: 24
Registered: December 2012
Junior Member
I'm looking for a non-loop or single loop solution to the following problem. I need to select "good" indices of a 2d-array based on two conditions.

The original code was this

good = where(error NE 999 AND abs(diff) LT radius, ngood)

where error and diff are 2d-arrays of rough size 4000x700 and radius is a scalar = 2.0. this returned a reformed 1-d array of indices that satisfied the conditions of the where on the 2-d array.

Now I need to replace the scalar radius with an array of (not all) varying numbers, e.g. [2.0,2.0,3.0,2.0,4.0].
These new values reference certain subsets inside the row dimension [0:699] of the 2-d array, e.g. element 0 in radius applies to elements [*,0:31] in the 2-d array, element 1 applies to [*,32:60] , etc, etc. I do know what the indices are that mark these subsets.

I still need "good" to be a 1-d returned array of the correct indices in the full 2-d array satisfying the above conditions.

I've been testing various loop ideas that could work, but how do I remap the indices in the individual subsets returned in the loop iterations to the right indices in the full array?

I feel like the solution involves value_locate, histogram, and unique , but I haven't quite been able to converge.

Any ideas? Thanks.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL 8.3 crash on workspace switch
Next Topic: ENVI/IDL vegetation identification

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

Current Time: Wed Oct 08 14:07:32 PDT 2025

Total time taken to generate the page: 0.00197 seconds