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

Home » Public Forums » archive » Re: Array definition
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: Array definition [message #55271] Wed, 08 August 2007 10:53 Go to previous message
Bob[3] is currently offline  Bob[3]
Messages: 60
Registered: December 2006
Member
On Aug 8, 1:38 pm, Conor <cmanc...@gmail.com> wrote:
> On Aug 8, 1:18 pm, Yaswant Pradhan <Yaswant.Prad...@gmail.com> wrote:
>> avoid FOR loop, use WHERE
>> indices = where(array GT value, n_wh)
>
> specifically:
>
> array_size = size(array1, /dimensions)
> array2 = fltarr(array_size)
> w = where( array1 gt value, c )
> if c gt 0 then array2[w] = array1[w]

w will be an array of the indices, sized to the number of elements of
array1 gt value (given by c), which is what Melanie was looking for
afaict.
array2 will be the same size as array1, but will have masked out any
elements le value. (mask should be 0.0).
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mac OS x IDL font handling
Next Topic: byte offset in POINT_LUN

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

Current Time: Sat Oct 11 17:20:29 PDT 2025

Total time taken to generate the page: 0.00984 seconds