[R] netcdf data precision or least significant digit
Ismail SEZEN
sezenismail at gmail.com
Thu Jul 7 09:50:54 CEST 2016
Hello,
I use ncdf4 and ncdf4.helpers packages to get wind data from ncep/ncar reanalysis ncetcdf files. But data is in the form of (9.199998, 8.799998, 7.999998, 3.099998, -6.8000018, …). I’m aware of precision and least_significant_digit attributes of ncdf4 object [1]. For uwnd data, precision = 2 and least_significant_digits = 1. My doubt is that should I round data to 2 decimal places or 1 decimal place after decimal point?
Same issue is valid for some header info.
Output of ncdf4 object:
Output of ncdump on terminal:
for instance, ncdump's scale factor is 0.01f but ncdf4 object’s scale_factor is 0.00999999977648258. You can notice same issue for actual_range and add_offset. Also a similar issue exist for the data. How can I truncate those extra unsignificant decimal places or round the numbers to significant decimal places?
1 - http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml <http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml>
More information about the R-help
mailing list