Re: delete missing values

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 03 2013 - 12:01:02 MST

Hi Hongyan,
In NCL whenever one of two values supplied to a binary operator such as '+', '-', '/', or '*' equals the _FillValue of the variable it belongs to, the _FillValue is propagated. If you want to treat the values that are equal to the _FillValue as 0 for the purposes of addition you can do something like the following.

v@_FillValue = 0 ; changes all values that equalled the old _FillValue to the new _FillValue, 0
delete(v@_FillValue) ; removes the _FillValue attribute

Now you can add the two variables together with no propagation of the _FillValue, effectively replacing the missing values with the value of the variable without missing values.
 -dave

 

On Jan 3, 2013, at 11:06 AM, H.Dang wrote:

> Hi dear all,
>
> I have two datasets, there are missing values "FillValue" in one of them, but there are not in the other one. When I added these two datasets together, the missing value should be replaced by the values of the other dataset. When I write the new data (addition) to a nc file, the "missing value" attribution is kept, which seems to make data at those locations not plotted. I just wonder how to delete the attribute of the missing value? Thank you so much.
>
> Best
> Hongyan
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jan 3 12:02:20 2013

This archive was generated by hypermail 2.1.8 : Fri Jan 04 2013 - 15:34:10 MST