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

Home » Public Forums » archive » 2 arrays, average, missing data
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
2 arrays, average, missing data [message #45418] Thu, 08 September 2005 07:18
kimberlite is currently offline  kimberlite
Messages: 3
Registered: January 2005
Junior Member
HI All,
IDL newbie here, I would appreciate any help. (Have been pouring over
Gumley and Fanning books for a day now, can't get this simple
calculation done.)

I have 2 arrays. Each array has float values and missing
data(value=0). I want to create a third array that has the average of
the two arrays if there are two good values. Otherwise, I want the
third array to take the value of the array that has data.


If my arrays are A and B, and the new array C, I know I can use:

C = (A+B)/2

to get the third array with averaged values. The only problem, is
that missing data values are averaged in with good values also. (ie:
275 averaged w/ 0 -- when I want to just take the 275 value).

Have tried If statements, -- but I realize these are all for scalar
values, not array.

My basic idea is:

If A = 0, C = B
If B = 0, C = A
If A and B EQ 0, C = 0
If A and B NE 0, C = (A+B)/2




Any help appreciated!
Thanks.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: rotate a large data volume
Next Topic: Re: Ordered index array

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

Current Time: Wed Oct 08 17:09:44 PDT 2025

Total time taken to generate the page: 0.00629 seconds