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

Home » Public Forums » archive » Re: newbie: multiple subarrays in array
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
Re: newbie: multiple subarrays in array [message #31554] Mon, 15 July 2002 13:06
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Ken Mankoff wrote:
>
> On Mon, 15 Jul 2002, David Fanning wrote:
>
>> Ken Mankoff (mankoff@I.HATE.SPAM.cs.colorado.edu) writes:
>>
>>> You can access the sub-array like this:
>>>
>>> good = where( data NE -9999 )
>>> data = data[ good ]
>>
>> Ken is absolutely right, but because you are a newbie,
>> I feel an obligation to get you started in the right
>> direction. I would write the code like this:
>>
>> good = where( data NE -9999, count )
>> IF count GT 0 THEN data = data[ good ]
>>
>> That will save you a couple of headaches down the road. :-)
>
> Amen.

And don't forget to take care of the situation where count EQ 0 (i.e. all bad data) too.
Guaranteed it *will* occur when you show off the finished code to
coworkers/boss/client/etc.

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC Beer is good.
Ph: (301)763-8000 x7274 My wife.
Fax:(301)763-8545
Re: newbie: multiple subarrays in array [message #31555 is a reply to message #31554] Mon, 15 July 2002 12:05 Go to previous message
Ken Mankoff is currently offline  Ken Mankoff
Messages: 158
Registered: February 2000
Senior Member
On Mon, 15 Jul 2002, David Fanning wrote:

> Ken Mankoff (mankoff@I.HATE.SPAM.cs.colorado.edu) writes:
>
>> You can access the sub-array like this:
>>
>> good = where( data NE -9999 )
>> data = data[ good ]
>
> Ken is absolutely right, but because you are a newbie,
> I feel an obligation to get you started in the right
> direction. I would write the code like this:
>
> good = where( data NE -9999, count )
> IF count GT 0 THEN data = data[ good ]
>
> That will save you a couple of headaches down the road. :-)

Amen.
Re: newbie: multiple subarrays in array [message #31556 is a reply to message #31555] Mon, 15 July 2002 11:54 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ken Mankoff (mankoff@I.HATE.SPAM.cs.colorado.edu) writes:

> You can access the sub-array like this:
>
> good = where( data NE -9999 )
> data = data[ good ]

Ken is absolutely right, but because you are a newbie,
I feel an obligation to get you started in the right
direction. I would write the code like this:

good = where( data NE -9999, count )
IF count GT 0 THEN data = data[ good ]

That will save you a couple of headaches down the road. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: newbie: multiple subarrays in array [message #31557 is a reply to message #31556] Mon, 15 July 2002 11:12 Go to previous message
Ken Mankoff is currently offline  Ken Mankoff
Messages: 158
Registered: February 2000
Senior Member
Hi Nando,

You can access the sub-array like this:

good = where( data NE -9999 )
data = data[ good ]

-k.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: newbie: multiple subarrays in array
Next Topic: ctd synchronizing script

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

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

Total time taken to generate the page: 0.00681 seconds