-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
multiple files - variable X not equal across datasets #443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you print two of the incompatible datasets? I'm not sure if there is a general pattern here (or not). |
So I don't know if this is what you're asking for (I only have one dataset with this problem) but here's how it looks like:
This is read in with |
Do you get the error message if you specify the full path to this file in open_mfdataset? |
I get this with
|
Marking this as a bug, I'll see if I can reproduce this with a similar dataset. |
Well, I'm not sure if it's a bug, I would say it's more like a missing feature... in my case, each netCDF file has a different |
Do you concatenate these files along one of the existing axes or a new axis? This might require new API but should probably be supported. Could you print two of these netCDF files that you want to automatically combine with |
I try concatenating on an existing axis, the |
OK, I understand now. One of these files looks like:
The problem is that the Another interesting aspect of this file, which relates to how I as hoping to fix #438, is that it includes a time coordinate with length 1, but none of the other dataset variables use that coordinate. This suggests to me that we need some sort of hook that can allow you to transform a single dataset before they are joined with def fix_my_data(ds):
return (ds.assign_coords(
agl=('mean_height_agl', range(ds.dims['mean_height_agl'])))
.swap_dims({'mean_height_agl': 'agl'})
.squeeze('time'))
ds = xray.open_mfdataset('*.nc', preprocess=fix_my_data) |
The other day I was playing with
xray.open_mfdataset
and I noticed you can get this error, when opening multiple files at the same time. I think there is a pretty easy solution to this:Of course, this is for a particular variable I was having trouble with, but the idea is to swap dimensions, that is create a dummy dimension with the same length as the troublesome variable and then swap the two. This can be done for any number of troublesome variables. I don't know how feasible this is though. Just thought to share my idea...
The text was updated successfully, but these errors were encountered: