Re: newbie: multiple subarrays in array [message #31554] |
Mon, 15 July 2002 13:06 |
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  |
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  |
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
|
|
|
|