NOAA-ORR-ERD / PyGnome

The General NOAA Operational Modeling Environment
https://gnome.orr.noaa.gov/doc/pygnome/index.html
Other
52 stars 44 forks source link

Environment wind from ERA-5 #120

Open gab1092 opened 2 years ago

gab1092 commented 2 years ago

Hello! I'm testing some configurations with different data sources, I was able to load data for the environment wind object from GFS, but I'm not able to load the data from ERA-5. The error message is ValueError: No compatible variable names found! But when I used the same data for the wind movers, I could load the data without problem; any idea for loading the data as an environment variable? Here is the code which I used.

wind_obj = GridWind.from_netCDF('/home/GNOME/ERA5/2015_2016.nc') ValueError: No compatible variable names found!

for the movers, I could run without problems

file_wind='/home/GNOME/ERA5/2015_2016.nc' w_mover=GridWindMover(file_wind) model.movers += w_mover

Thank you!

jay-hennen commented 2 years ago

The compatible variable names error happens when an environment object can not find compatible variables to use. That is to say, it simply could not find them. Passing a varnames = ['u_name', 'v_name'] kwarg would be enough for it to work.

What are your imports? I'm guessing you are using the legacy GridWindMover object (a self-contained mover), when only the new PyWindMover would use the GridWind environment object. If the GridWindMover could do the job though, that's good enough I suppose.

gab1092 commented 2 years ago

Thank you! With your suggestion I could import the wind as environment object! However I need import as wind movers with GridWindMover because I can't use the wind_obj as a grid mover, but It's working.