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

Home » Public Forums » archive » Re: Extract Array positions for a set of Values
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: Extract Array positions for a set of Values [message #75435 is a reply to message #75434] Wed, 09 March 2011 03:08 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
You might try match2.pro from http://idlastro.gsfc.nasa.gov/ftp/pro/misc/match2.pro though it is a bit of overkill.

(You first have to REFORM to a 1-d array)


IDL> match2,reform(a,21),b,suba,subb

IDL> print,reform(suba,7,3)
0 0 0 0 -1 -1 -1
0 0 0 0 -1 -1 1
-1 -1 -1 -1 2 -1 1

The output is set to -1 where there is no match in the vector B.

IDL> a[where(suba ge 0)] = 99
IDL> print,a
99 99 99 99 0 0 0
99 99 99 99 0 0 99
0 0 0 0 99 0 99
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: LOADCT is not working
Next Topic: new COYOTE Graphics together with map_set

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

Current Time: Wed Oct 08 19:29:44 PDT 2025

Total time taken to generate the page: 0.00469 seconds