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

Mary Haley haley at ucar.edu
Mon Apr 27 12:02:00 MDT 2015


Hi Alan,

This looks like a reasonable suggestion, and I agree that the grammar needs
to be corrected. I've created a ticket for this, NCL-2203.

--Mary


On Thu, Apr 23, 2015 at 6:06 PM, Alan Brammer <abrammer at albany.edu> wrote:

> 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.
>
> _______________________________________________
> 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/20150427/021ea0bd/attachment.html 


More information about the ncl-talk mailing list