issues: 477081946
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
477081946 | MDU6SXNzdWU0NzcwODE5NDY= | 3185 | open_rasterio does not read coordinates from netCDF file properly with netCDF4>=1.4.2 | 23487320 | closed | 0 | 12 | 2019-08-05T22:16:20Z | 2021-03-15T18:38:58Z | 2021-03-15T18:38:58Z | CONTRIBUTOR | MCVE Code SampleAdapted from the test_serialization unit test at here. ```python import xarray as xr from xarray.tests.test_backends import assert_identical, create_tmp_geotiff, create_tmp_file with create_tmp_geotiff(additional_attrs={}) as (tmp_file, expected): # write it to a netcdf and read again (roundtrip) using open_rasterio with xr.open_rasterio(tmp_file) as rioda: with create_tmp_file(suffix='.nc') as tmp_nc_file: # Write geotiff to netcdf file rioda.to_netcdf(tmp_nc_file)
``` Actual Output (using netCDF4>=1.4.2)```python-traceback AssertionError: Left and right DataArray objects are not identical Differing coordinates: L * x (x) float64 5.5e+03 6.5e+03 7.5e+03 8.5e+03 R * x (x) float64 0.5 1.5 2.5 3.5 L * y (y) float64 7.9e+04 7.7e+04 7.5e+04 R * y (y) float64 0.5 1.5 2.5 Differing attributes: L transform: (1000.0, 0.0, 5000.0, 0.0, -2000.0, 80000.0) R transform: (1.0, 0.0, 0.0, 0.0, 1.0, 0.0) L res: (1000.0, 2000.0) R res: (1.0, -1.0) Attributes only on the left object: crs: +init=epsg:32618 ``` Expected Output (using netCDF4==1.4.1)```python-traceback AssertionError: Left and right DataArray objects are not identical Differing attributes: L nodatavals: (nan, nan, nan) R nodatavals: (nan, nan, nan) Attributes only on the left object: crs: +init=epsg:32618 ``` Problem DescriptionI have a script which takes in either NetCDF or GeoTIFF files as an input and I've been using My hunch is that it has something to do with different NetCDF4 formats (e.g. ‘NETCDF4’, 'NETCDF4_CLASSIC’, ‘NETCDF3_64BIT’) but looking at the Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3185/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |