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

Home » Public Forums » archive » WHERE - problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
WHERE - problem [message #33783] Tue, 28 January 2003 02:22 Go to next message
Thomas Jordi is currently offline  Thomas Jordi
Messages: 5
Registered: August 2002
Junior Member
hi there
i'm not an IDL-guru, but i'm using it for some time. the WHERE function
is extremely handy and often of great use for me.
however, one problem i failed to solve.
lets state an array(500,500,10)
array=INDGEN(500,500,10)

so then, the find=WHERE(array[*,*,1] GT 252000) returns me all the
needed values.
but HOW do interact with these.

a=mean(array[find]) doesnt do it right

So I helped myself with
idiotway=array[*,*,1]
find=where(idiotway gt 252000)
so then the example a=mean(idiotway(find)) does it right.

However, somehow there must be a better way...


some help would be appreciated

tschordi
--
�`����,��,�`ï¿½ï ¿½ï¿½ï¿½,�
Thomas Jordi
Geographisches Institut
Universitaet Bern
Hallerstrasse 12
3012 Bern

tschordi@giub.unibe.ch
�`����,��,�`ï¿½ï ¿½ï¿½ï¿½
Re: WHERE - problem [message #33863 is a reply to message #33783] Thu, 30 January 2003 06:42 Go to previous message
Chad Bender is currently offline  Chad Bender
Messages: 21
Registered: July 2001
Junior Member
> thanks, it worked. however am I right, that the WHERE procedure is not
> able to handle the case, wehre you search values in a 3d array in one
> plane, and then want to acces with array[where] ?

David Fanning has a program (wheretomulti) on his website that will
convert WHERE output to 2 or 3d subscripts.

http://www.dfanning.com/tip_examples/wheretomulti.pro

If you need more than 3 dimensions, I have a similar routine that will
work on arbitrary dimensions. Let me know if you want it, and I'll put it
somewhere accessible.

Chad


--
#############################
Chad Bender
Dept of Physics and Astronomy
SUNY Stony Brook
cbender@mail.astro.sunysb.edu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL demo bug in 5.6 on MAC OS 10.2?
Next Topic: formatting array output?

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

Current Time: Wed Oct 08 15:39:45 PDT 2025

Total time taken to generate the page: 0.00460 seconds