[Thread Prev][Thread Next][Index]

Re: Average



On Thu, 14 Apr 2005, Joerg Franke wrote:
> I want to calculate an average of a whole region (like: list
> variable[x=@ave,y=@ave]) with missing values calculated as if they were
> "0" and not declared "/bad". My missing values are 9.e+36 now.

Hi Joerg,
	I think what you need is something like this

	let newvar = missing(oldvar,0)

which substitutes a value (zero in this case) everwhere the original
variable had a missing value.

! Demo: substitution of zero for missing value
region/i=1:8/j=1:8
let oldvar=if(mod(i+j,2) eq 1)then 1
shade oldvar               ! a chessboard with missing values
list oldvar[i=@ave,j=@ave]
!
let newvar=missing(oldvar,0)
shade newvar               ! now all squares have a value
list newvar[i=@ave,j=@ave]

|!!! Mick.Spillane@noaa.gov !!!|
|__Room 2070 Bldg#3 NOAA/PMEL__|
|____Phone_:_(206)526-6780_____|


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement