WHERE - problem [message #33783] |
Tue, 28 January 2003 02:22  |
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  |
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
|
|
|