home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 548029687

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
548029687 MDU6SXNzdWU1NDgwMjk2ODc= 3681 concat result not correct for particular dataset 7933853 closed 0     7 2020-01-10T11:34:06Z 2020-03-13T13:25:13Z 2020-03-13T13:25:13Z NONE      

MCVE Code Sample

data here: https://www.dropbox.com/sh/8eist9mmlf41mpc/AAB8yp6ERz-b4VYozL8tsj-ma?dl=0

``` import xarray as xr import numpy as np

print(xr.version) #

ds1 = xr.open_dataset('tas_Amon_NorESM1-ME_rcp26_r1i1p1_200601-206012.nc') ds2 = xr.open_dataset('tas_Amon_NorESM1-ME_rcp26_r1i1p1_206101-210112.nc')

print(np.allclose(ds1.lat , ds2.lat), np.allclose(ds1.lat_bnds , ds2.lat_bnds)) # True, True

ds3 = xr.concat((ds1,ds2), dim='time')

print(ds3.lat.shape == ds1.lat.shape) # False ```

Expected Output

0.14.1 True True True

since ds3.lat should be identical to ds1.lat

Problem Description

I've encountered a particular NetCDF dataset which is not handled correctly by the Xarray concat operation. It's a climate dataset with 96 latitude points which has been split into two time segments. After concatenation (dim = 'time') there are suddenly 142 latitude points even though the latitude arrays are completely identical AFAIK.

As a workaround, I've tried to reindex the result (ds3) as follows ds4 = ds3.reindex_like(ds1.drop_dims('time'))

but that yields an incomplete field after the year 2061. This can be seen by issuing: ds4.tas.isel(time=-1).plot() with white areas indicating missing data. There is no missing data in the source files.

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 13:42:17) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] python-bits: 64 OS: Darwin OS-release: 17.7.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: C LANG: None LOCALE: None.None libhdf5: 1.10.4 libnetcdf: 4.6.1 xarray: 0.14.1 pandas: 0.25.1 numpy: 1.16.4 scipy: 1.3.1 netCDF4: 1.4.2 pydap: None h5netcdf: None h5py: 2.9.0 Nio: None zarr: None cftime: 1.0.0b1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.2.1 dask: 2.3.0 distributed: 2.3.2 matplotlib: 3.0.2 cartopy: 0.17.0 seaborn: 0.9.0 numbagg: None setuptools: 41.0.1 pip: 19.2.2 conda: 4.8.1 pytest: 5.0.1 IPython: 7.7.0 sphinx: 2.1.2
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3681/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 7 rows from issue in issue_comments
Powered by Datasette · Queries took 0.657ms · About: xarray-datasette