[ncl-talk] Missing value

Dennis Shea shea at ucar.edu
Mon Sep 29 09:53:44 MDT 2014


Like Alan wrote .... did you try it? That is the best way to learn a
language.

  A = 1e20
  A at _FillValue = 1e20
  B = 10
  C = 20

  X = A+B+C               ; A=A at _FillValue will return X=A@ _FillValue
  print(X)

  X = sum( (/A,B,C/) )
  print(X)                    ; X=30

  X = avg(/A,B,C/) )
  print(X)                   ; X=15

On Mon, Sep 29, 2014 at 9:04 AM, Alan Brammer <abrammer at albany.edu> wrote:

> Did you try it?
>
> I just quickly tested it and if any one variable is _Fillvalue then the
> return is a fillvalue.
>
> If that's not what you want and it's just addition you want you could
> build an array from a,b,c and use dim_sum which will ignore fillvalues I
> believe.
>
> Good luck,
> Alan.
> On 28 Sep 2014 17:20, "Xi Chang" <xi.chang01 at gmail.com> wrote:
>
>> Hallo,
>>
>> How does NCL treat the missing value in a simple arithmetic calculation,
>> e.g.;
>> *X= A + B +C*
>> if A is a missing value and B, and C is *non* missing value, so what's
>> the result of X?
>> is it missing value or is it equal to the value of B+C?
>>
>> Thanks
>>
>>
>> _______________________________________________
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140929/ba301e55/attachment.html 


More information about the ncl-talk mailing list