Min, max functions and _FillValue

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Wed Feb 01 2012 - 17:50:19 MST

NCL team,

Would you please consider changing the min and max functions to
propagate the _FillValue attribute from input to output, in the
special case when the input is all missing values? Current and past
NCL behavior is to return the type default _FillValue rather than the
input _FillValue.

I did not find a requirement for this in the NCL manual. However,
this conforms with current behavior of many other NCL functions, as
well as documented behavior for propagation of missing values in
simple math expressions. See examples below.

My objective is to reduce confusion when using the min and max
functions for debugging. Statements such as print ("Max result = " +
max(x)) are used frequently. As it is now, the output from such
prints can be confounding when the input array is accidentally "all
missing".

mac56:~ 1> ncl
 NCAR Command Language Version 6.0.0
ncl 0> procedure printFillValue (x)
ncl 1> begin
ncl 2> print ("_FillValue = " + x@_FillValue)
ncl 3> end
ncl 4>
ncl 5> x = new (5, float, -99.)
ncl 6> printFillValue (x+9)
(0) _FillValue = -99
ncl 7> printFillValue (22*x)
(0) _FillValue = -99
ncl 8> printFillValue (sin(x))
(0) _FillValue = -99
ncl 9> printFillValue (sum(x))
(0) _FillValue = -99
ncl 10> printFillValue (dim_avg(x))
(0) _FillValue = -99
ncl 11> printFillValue (log(x))
(0) _FillValue = -99
ncl 12> printFillValue (round(x,0))
(0) _FillValue = -99
ncl 13> printFillValue (sqrt(x))
(0) _FillValue = -99
ncl 14> printFillValue (min(x))
(0) _FillValue = 9.96921e+36
ncl 15> printFillValue (max(x))
(0) _FillValue = 9.96921e+36

Thanks for considering this.

--Dave
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Feb 2 05:50:33 2012

This archive was generated by hypermail 2.1.8 : Thu Feb 02 2012 - 03:10:31 MST