Skip to content
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

Error when reading multiple files of ROMS_native #1467

Open
MarianoTonini opened this issue Dec 27, 2024 · 1 comment
Open

Error when reading multiple files of ROMS_native #1467

MarianoTonini opened this issue Dec 27, 2024 · 1 comment

Comments

@MarianoTonini
Copy link

Hello everyone,
when I try to read several files with the ROMS_native.py reader from the same simulation (example: croco_avg_00*.nc), it fails to concatenate them. Apparently it does not find the correctly time dimension.
The files already have several records each, they are not single-record files.
I would appreciatte any help on this matter.

The output error is as follows:

Traceback (most recent call last):
File "/home/ubuntu/opendrift/opendrift/readers/reader_ROMS_native.py", line 160, in init
self.Dataset = xr.open_mfdataset(filename,
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/miniconda3/envs/opendrift/lib/python3.11/site-packages/xarray/backends/api.py", line 1607, in open_mfdataset
combined = combine_by_coords(
^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/miniconda3/envs/opendrift/lib/python3.11/site-packages/xarray/core/combine.py", line 973, in combine_by_coords
concatenated_grouped_by_data_vars = tuple(
^^^^^^
File "/home/ubuntu/miniconda3/envs/opendrift/lib/python3.11/site-packages/xarray/core/combine.py", line 974, in
_combine_single_variable_hypercube(
File "/home/ubuntu/miniconda3/envs/opendrift/lib/python3.11/site-packages/xarray/core/combine.py", line 634, in _combine_single_variable_hypercube
combined_ids, concat_dims = _infer_concat_order_from_coords(list(datasets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/miniconda3/envs/opendrift/lib/python3.11/site-packages/xarray/core/combine.py", line 159, in _infer_concat_order_from_coords
raise ValueError(
ValueError: Could not find any dimension coordinates to use to order the datasets for concatenation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/ubuntu/opendrift/examples/./CROCO_romsnative_drift03_hourly.py", line 27, in
croco_native = reader_ROMS_native.Reader('/media/ubuntu/SATA3/CROCO/croco_v121/GN_GSJOS_22/nest_avg_drift03hourly_opendrift*.nc');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/opendrift/opendrift/readers/reader_ROMS_native.py", line 168, in init
raise ValueError(e)
ValueError: Could not find any dimension coordinates to use to order the datasets for concatenation

@knutfrode
Copy link
Collaborator

knutfrode commented Dec 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants