You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The xarray open_mfdataset function dies with an error when trying to read more than one file created by GCHP using the new MAPL v1.0.0 (i.e. in GCHP 12.5.0 and later versions).
According to xarray issues:
pydata/xarray#3286pydata/xarray#1378
The open_mfdataset function has problems in creating a merged
dataset from multiple files in which variables have repeated
dimension names. The easiest thing to do in this case is to
prevent such variables from being read in.
We now have added the drop_variables keyword to avoid reading
in the "anchor" variable in all calls to open_dataset and
open_mfdataset in both benchmark.py and core.py. This variable is
only present in GCHP-created netCDF files using MAPL v1.0.0, which
is in GCHP 12.5.0 and later.
This commit should resolve GCPy issue #26:
#26
Signed-off-by: Bob Yantosca <[email protected]>
According to the xarray support team, xarray cannot gracefully handle merging files that contain variables with repeated dimension names (cf. pydata/xarray#3286 and pydata/xarray#1378).
The easiest solution is to exclude the offending variable (which in this case is the "anchor" variable from GCHP output using MAPL v1.0.0) in all calls to xr.open_dataset and xr.open_mfdataset. This is done by passing the "drop_variables" keyword argument to these functions.
I have pushed commit 5411f3d to master, which should resolve this issue.
Describe the bug
The xarray open_mfdataset function dies with an error when trying to read more than one file created by GCHP using the new MAPL v1.0.0 (i.e. in GCHP 12.5.0 and later versions).
To Reproduce
Expected behavior
The returned dataset should contain the merged data from e.g. file1.nc and file2.nc.
Screenshots
Instead, this error occurs:
Required information:
Additional context
The problem seems to be caused by a single variable called "anchor".
The text was updated successfully, but these errors were encountered: