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

Home » Public Forums » archive » Re: Why doesn't this return the correct value?
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: Why doesn't this return the correct value? [message #58771 is a reply to message #58672] Thu, 14 February 2008 03:25 Go to previous message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
> In terms of doing what you want to do, you should really look into
> using WHERE.
> IndexOfIndices = WHERE(Good_index GT 0, Number)
> Positive_Good_Index = Good_index[IndexOfIndices]
> Good_Indexed_Precip = Precip_Change[Positive_Good_Index]
>
> Take care,
> Chris

To avoid trying to subscript if you get an all negative array, protect
your code like this:

IndexOfIndices = WHERE(Good_index GT 0, Number)
IF Number GT 0 THEN BEGIN
Positive_Good_Index = Good_index[IndexOfIndices]
Good_Indexed_Precip = Precip_Change[Positive_Good_Index]
ENDIF
[Message index]
 
Read Message
Read Message
Previous Topic: Why doesn't this return the correct value?
Next Topic: Memory problem

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

Current Time: Fri Oct 10 04:15:14 PDT 2025

Total time taken to generate the page: 1.19858 seconds