[ncl-talk] [request] type converters and fillvalues

Alan Brammer abrammer at albany.edu
Thu Apr 23 18:06:24 MDT 2015


Pretty minor request but possibly simple to implement.

When converting an array of floats to integer, missing values trigger the
warning
"there are 1 floats larger than INT_MAX, which has been flagged missing."
I realise the warning is correct as the default float fillvalue is greater
than the max integer, but as it is a fill value and the new array will have
a new fill value. I feel this should be dealt with silently, so valid data
warnings are not lost.

My view of this would be that fillvalues are converted to the new fillvalue
before that line is reached so as to not trigger that warning on missing
data.

This may occur on the other type converters, I'm not sure.

Simplistic code to exemplify my concern.

x = new( 10, float) ; both currently missing
x(0) = 2.5e10      ; one really big but valid number.

; 9 data points are missing, 1 is valid
xi = toint(x)
;warning:toint: there are 10 floats larger than INT_MAX, which has been
flagged missing.


 Really only 1 data point has been flagged missing though, the rest already
were missing.
If we have a case where we have a large number of data points with some
missing it's going to be quite difficult to know when data has actually
been lost in the conversion.


Thanks,
Alan.

p.s. Having seen a lot of these error message I also noticed the grammar in
the error message is questionable.  " there are ... which has ... "   just
to nitpick.
Thanks for all your work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150423/13fa6838/attachment.html 


More information about the ncl-talk mailing list