Closed nordam closed 6 months ago
For the first error: You could open the list of files using xarray
manually and pass the ready Dataset to the Reader (https://github.com/OpenDrift/opendrift/blob/master/opendrift/readers/reader_netCDF_CF_generic.py#L70), but there could also be a good reason for the conflict (e.g. overlapping time coordinates).
Hi, Can you try to remove the overlapping part of the files, i.e. keep only first 23 hours from each daily file?
I am not sure whether the compat
argument could make it work even with overlapping files?
But as Gaute mentioned, it might be better in this case to open and provide an Xarray dataset directly to the Reader constructor.
@knutfrode has a good example of how to do that here: https://github.com/knutfrode/concepts/blob/main/Open_MFDataset_overlap.ipynb
Many thanks, very helpful example, this solved the first problem perfectly. But the second issue is still there: The particles do not move.
If you use loglevel=0
the log should tell why they are not moving. Perhaps out of coverage?
Variables names do not matter, OpenDrift scans only for attribute standard_name
, so current should be identified here.
Hei all,
I am having a similar issue that @nordam was (is?) facing. I used the example that @gauteh provided, and I am trying to open the concatenated dataset with reader_netCDF_CF_generic.Reader. I get the following error:
ValueError: did not find a match in any of xarray's currently installed IO backends ['netcdf4', 'scipy', 'cfgrib']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies, see:
https://docs.xarray.dev/en/stable/getting-started-guide/installing.html https://docs.xarray.dev/en/stable/user-guide/io.html
Though I do have the IO backends installed. Did you figure out the problem?
Hi Senhor vic1309!
I have seen your error message before, and I believe it is related to some problem/shortcoming with the installation, and (probably) not related the issue above. The example script above (Open_MFDataset_overlap.ipynb) works fine for me, does it work for you as is?
Did you install OpenDrift the "standard" way? https://opendrift.github.io/install.html
Hei herr knutfrode!
Yes, the script above worked like a charm! I noticed my OpenDrift version was out-of-date, it is working now.
Many thanks!
I'm trying to run a small test with OpenDrift and the Barents EPS with files from thredds, but I run into some problems.
The files are downloaded from here: https://thredds.met.no/thredds/catalog/fou-hi/barents_eps_eps/catalog.html
My example is:
The first issue is with creating the reader. I get the error message
I assume this is because these files contain partially overlapping times? I tried passing the suggested keyword argument to
Reader(filenames, compat='override')
, but that gives another error, so I assume thecompat
argument isn't passed on to the correct location in the code. I could perhaps try to submit a pull request for that.The second issue is that when I try again with only a single file, the simulation runs with no errors, but the particles don't move, they just remain in the same location. Could it be that OpenDrift isn't correctly identifying the u and v variables, since they are called
u_eastward
andv_northward
in this dataset?