Unable to open multiple .nc file using xarray.open_mfdataset() call !! because of no time dimension in individual files (only lat & lon dim in files) #5616
Answered
by
dcherian
HARSHBARDHANK94
asked this question in
Q&A
-
Hello all....herewith i have attached two snaps of error and file dimension |
Beta Was this translation helpful? Give feedback.
Answered by
dcherian
Jul 17, 2021
Replies: 2 comments 1 reply
-
Hello @HARSHBARDHANK94 You should try something like: def preprocess(ds):
# is time in ds.attrs ; if it's in the filename look at ds.encoding['source']
ds["time"] = ...
return ds
xr.open_mfdataset(..., concat_dim="time", preprocess=preprocess) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
max-sixty
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @HARSHBARDHANK94
You should try something like: