html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/5490#issuecomment-863972083,https://api.github.com/repos/pydata/xarray/issues/5490,863972083,MDEyOklzc3VlQ29tbWVudDg2Mzk3MjA4Mw==,6574622,2021-06-18T11:32:38Z,2021-06-18T11:33:14Z,CONTRIBUTOR,"I've checked your example files. This is mostly related to the fact, that the original data is encoded as `short` and uses `scale_factor` and `add_offset`: ```python In [35]: ds_loc.q.encoding Out[35]: {'source': '/private/tmp/test_xarray/Minimal_test_data/2012_europe_9_130_131_132_133_135.nc', 'original_shape': (720, 26, 36, 41), 'dtype': dtype('int16'), 'missing_value': -32767, '_FillValue': -32767, 'scale_factor': 3.0672840096982675e-07, 'add_offset': 0.010050721147263318} ``` Probably the scaling and adding is carried out in `float64`, but then rounded down to `float32`. When storing the dataset back to netCDF, `xarray` re-uses the information from the `encoding` attribute and goes back to `int16`, possibly creating even more rounding errors. Reading the data back in is then not reproducible anymore. Possibly related issues are #4826 and #3020","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,924676925 https://github.com/pydata/xarray/issues/5490#issuecomment-863945975,https://api.github.com/repos/pydata/xarray/issues/5490,863945975,MDEyOklzc3VlQ29tbWVudDg2Mzk0NTk3NQ==,6574622,2021-06-18T10:44:38Z,2021-06-18T10:44:38Z,CONTRIBUTOR,"Are your input files on (exactly) the same grid? If not, combining the files might introduce `NaN` to fill up missmatching cells. Furthemore, if you are working with `NaN`s, are you aware of: ```python In [1]: import numpy as np In [2]: np.nan == np.nan Out[2]: False ``` Which is as it should be per [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754#Comparison_predicates). When writing out the files to netCDF, do you accidentally convert from 64bit float to 32bit float?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,924676925