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

Home » Public Forums » archive » IDL-way to use WHERE result as subscripting indices without having to do IF count
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
IDL-way to use WHERE result as subscripting indices without having to do IF count [message #76188] Fri, 20 May 2011 06:06
Robin Wilson is currently offline  Robin Wilson
Messages: 40
Registered: August 2010
Member
Hi all,

I'm sure this has been discussed before, but I can't find the
discussion. I have a lot of code that looks like the following:

Array[WHERE(Input LT 5)] = 2
Array[WHERE(Input GT 7 AND OtherArray LT 9) = 6
etc...

I know I shouldn't be using WHERE like that without checking the count
of items returned, as it will crash if there are no values in Input less
than 5. My question is: is there an IDL-way to do this, without putting
in loads of IF count NE 0 statements above each of the assignemnts?
That'll make the code a lot longer, a lot messier etc.

Any ideas?

Cheers,

Robin

------------------
Robin Wilson
A PhD student studying complexity in remote sensing
www.rtwilson.com/academic
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Zoom in plot
Next Topic: H5F_OPEN/H5F_CLOSE apparent memory leak

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

Current Time: Wed Oct 08 15:12:49 PDT 2025

Total time taken to generate the page: 0.00448 seconds