I see the issue. I generated 100,00 random numbers and was able
to get one value that failed.
In a nutshell,
x = -9.9995
shift = 100.
xTmp = x*shift ;===> xTmp = -999.05
iTmp = floattointeger(xTmp) ; iTmp = -999
-999 is the default missing value for "floattointeger"
Rick Brownrigg wrote:
> Hi Bridget,
>
> Are you by chance running an earlier version of NCL? I noticed a
> comment in the docs for "decimalPlaces" that
> this function does not work correctly for NCL v. 5.0.0 and earlier, if
> the data contain negative numbers. It does not spell out how "does
> not work" manifests.
>
> http://www.ncl.ucar.edu/Document/Functions/Contributed/decimalPlaces.shtml
>
> Rick
>
> On Nov 9, 2009, at 4:18 PM, Bridget Thrasher wrote:
>
>> I'm running a complete array (no missing values) through the
>> decimalPlaces function and am getting an output array that contains
>> missing values. Is this correct?
>>
>> data_all_f = doubletofloat(fdata->$var$)
>> printVarSummary(data_all_f)
>> print(num(ismissing(data_all_f)))
>> printMinMax(data_all_f,True)
>> data_all = decimalPlaces(data_all_f,2,True)
>> printVarSummary(data_all)
>> print(num(ismissing(data_all)))
>> printMinMax(data_all,True)
>>
>>
>> Variable: data_all_f
>> Type: float
>> Total Size: 116640000 bytes
>> 29160000 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [1800] x [90] x [180]
>> Coordinates:
>> Number Of Attributes: 1
>> _FillValue : 1e+20
>> (0) 0
>> (0)
>> (0) min=-73.7207 max=45.3083
>>
>>
>> Variable: data_all
>> Type: float
>> Total Size: 116640000 bytes
>> 29160000 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [1800] x [90] x [180]
>> Coordinates:
>> Number Of Attributes: 1
>> _FillValue : 1e+20
>> (0) 2147
>> (0)
>> (0) min=-73.72 max=45.31
>>
>>
>> --
>> Bridget Thrasher, PhD
>> Postdoctoral Researcher
>> Climate Central
>> www.climatecentral.org <http://www.climatecentral.org>
>>
>>
>> _______________________________________________
>> 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
>
-- ====================================================== Dennis J. Shea tel: 303-497-1361 | P.O. Box 3000 fax: 303-497-1333 | Climate Analysis Section | Climate & Global Dynamics Div. | National Center for Atmospheric Research | Boulder, CO 80307 | USA email: shea 'at' ucar.edu | ====================================================== _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Tue Nov 10 10:10:10 2009
This archive was generated by hypermail 2.1.8 : Wed Nov 11 2009 - 12:48:56 MST