inf2img combine=by_coords error
Afshinshafei opened this issue · 0 comments
hello every one. i get this error after running the code:
"start_time: 2017-08-01 00:00:00, end_time: 2017-08-05 18:00:00, pred_num: 19 Traceback (most recent call last): File "/content/drive/Shareddrives/Me/OpenCastKit/infer2img.py", line 187, in real_data, sample, scaler = get_data(start_time, end_time) File "/content/drive/Shareddrives/Me/OpenCastKit/infer2img.py", line 158, in get_data tmp = xr.open_mfdataset(f'./ERA5_rawdata/*.nc', combine='by_coords').sel(time=times) File "/usr/local/lib/python3.10/dist-packages/xarray/backends/api.py", line 936, in open_mfdataset combined = combine_by_coords( File "/usr/local/lib/python3.10/dist-packages/xarray/core/combine.py", line 975, in combine_by_coords concatenated = _combine_single_variable_hypercube( File "/usr/local/lib/python3.10/dist-packages/xarray/core/combine.py", line 626, in _combine_single_variable_hypercube combined_ids, concat_dims = _infer_concat_order_from_coords(list(datasets)) File "/usr/local/lib/python3.10/dist-packages/xarray/core/combine.py", line 144, in _infer_concat_order_from_coords raise ValueError( ValueError: Could not find any dimension coordinates to use to order the datasets for concatenation"
does anyone know any solution? I tried to change by_coords to "nested" and got another error:
start_time: 2017-08-01 00:00:00, end_time: 2017-08-05 18:00:00, pred_num: 19
Traceback (most recent call last):
File "/content/drive/Shareddrives/Me/OpenCastKit/infer2img.py", line 187, in
real_data, sample, scaler = get_data(start_time, end_time)
File "/content/drive/Shareddrives/Me/OpenCastKit/infer2img.py", line 158, in get_data
tmp = xr.open_mfdataset(f'./ERA5_rawdata/*.nc', combine='nested').sel(time=times)
File "/usr/local/lib/python3.10/dist-packages/xarray/backends/api.py", line 963, in open_mfdataset
combined = _nested_combine(
File "/usr/local/lib/python3.10/dist-packages/xarray/core/combine.py", line 324, in _nested_combine
combined = _combine_nd(
File "/usr/local/lib/python3.10/dist-packages/xarray/core/combine.py", line 198, in _combine_nd
combined_ids = _combine_all_along_first_dim(
File "/usr/local/lib/python3.10/dist-packages/xarray/core/combine.py", line 234, in _combine_all_along_first_dim
new_combined_ids[new_id] = _combine_1d(
File "/usr/local/lib/python3.10/dist-packages/xarray/core/combine.py", line 279, in _combine_1d
combined = merge(
File "/usr/local/lib/python3.10/dist-packages/xarray/core/merge.py", line 857, in merge
merge_result = merge_core(
File "/usr/local/lib/python3.10/dist-packages/xarray/core/merge.py", line 597, in merge_core
variables, out_indexes = merge_collected(collected, prioritized, compat=compat)
File "/usr/local/lib/python3.10/dist-packages/xarray/core/merge.py", line 229, in merge_collected
merged_vars[name] = unique_variable(name, variables, compat)
File "/usr/local/lib/python3.10/dist-packages/xarray/core/merge.py", line 141, in unique_variable
raise MergeError(
xarray.core.merge.MergeError: conflicting values for variable 'z' on objects to be combined. You can skip this check by specifying compat='override'.