Re: removal of missing value

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 28 Apr 2006 08:24:06 -0600 (MDT)

> I have one data set in 3d say prec(:,:,:) ,
> now it contains missing value. I want to remove the
> missing value from the data set. Now if I use ind,
> and ismissing function , I can remove the data, but
> for ind I have to get the value to one dimension by
> ndtooned. But in that case I loss all the meta data,
> I want to retain the meta data. Is there any suggestion?

replace or remove/eliminate?


     p1 = ndtooned( prec )
     i = ind(ismissing(p1)) ; all missing values
     if (.not.all(ismissing(i))) then
         p1(i) = ...
         prec = onedtond(p1, dimsizes(prec)) ; original array
     end if
     delete( i)

remove: this means to eliminate one value from the 3D array? to what array?

     p1 = ndtooned( prec )
     i = ind(.not.ismissing(p1)) ; all non-missing values
     if (.not.all(ismissing(i))) then
         pNew = p1(i) ; pNew is 1D
         copy_VarAtts (prec, pNew) ; copy attributes
         print("No missing values")
     end if

     You can not have the same coordinate variables because
     you have eliminated a value ....

I am sure I have misunderstood what you want.

ncl-talk mailing list
Received on Fri Apr 28 2006 - 08:24:06 MDT

This archive was generated by hypermail 2.2.0 : Fri Apr 28 2006 - 08:53:40 MDT