Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
Thank you very much Roy and Jeff for your help. I contacted dear David, the author of ncdf4 package, at first and he lead me here. Sorry for any inconvenience. I wish you success in your work. Regards, On Fri, Jul 8, 2016, 04:28 Roy Mendelssohn - NOAA Federal < roy.mendelss...@noaa.gov> wrote:

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Roy Mendelssohn - NOAA Federal
I have moved this over to the netcdf-group mail list, which I think is the more appropriate place at this point. You are copied, and hopefully someone from ESRL will see it and provide the proper response. HTH, -Roy > On Jul 7, 2016, at 6:02 PM, Ismail SEZEN wrote: > > Thank you Roy. If I u

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
Thank you Roy. If I use "round(uwind, digits = 2)”, all data will have 2 decimal places after decimal point. It’s ok. But How do you know you should round the number to 2 decimal digits? According to definitions of precision and least_significant_digit, should I round to 2 decimal digits or 1 de

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Roy Mendelssohn - NOAA Federal
After looking at the file, doing an extract say into the variable uwind, if I do: str(uwind) I see what I expect, but if I just do: uwind I see what you are seeing. Try: uwindnew <- round(uwind, digits = 2) and see if that gives you the results you would expect. HTH, -Roy > On Jul

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
Thank you Roy. I use NCEP/NCAR Reanalysis 2 data [1]. More precisely, u-wind data of the year 2015 [2]. I am also pretty sure that the variables like scale_factor or add_offset should be precise like 0.01 or 187.65 but somehow (I hope this is not an issue originated by me) they are not, includ

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Roy Mendelssohn - NOAA Federal
Hi Ismail: Can you point me to a particular netcdf file you are working with. I would like to play with it for awhile. I am pretty certain the scale factor is 0.01 and what you are seeing in rounding error (or mor precisely I should say problems with representations of floating point numbers)

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
Thank you very much Jeff. I think I’m too far to be able to explain myself. Perhaps, this is the wrong list for this question but I sent it in hope there is someone has deep understanding of netcdf data and use R. Let me tell the story simpler. Assume that you read a numeric vector of data from

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Jeff Newmiller
Correction: ?options (not par) -- Sent from my phone. Please excuse my brevity. On July 7, 2016 3:26:06 PM PDT, Jeff Newmiller wrote: >Same as with any floating point numeric computation environment... you >don't. There is always uncertainty in any floating point number... it >is just larger in

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Jeff Newmiller
Same as with any floating point numeric computation environment... you don't. There is always uncertainty in any floating point number... it is just larger in this data than you might be used to. Once you get to the stage where you want to output values, read up on ?round ?par (digits) and don

[R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
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.18, 8.78, 7.98, 3.08, -6.818, …). I’m aware of precision and least_significant_digit attributes of ncdf4 object [1]. For uwnd data, precisio