home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 863972083

This data as json

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
Powered by Datasette · Queries took 0.59ms · About: xarray-datasette