Stream: python-questions

Topic: xwrf


view this post on Zulip Rich Neale (Nov 05 2021 at 21:43):

Hi, I'm having issues with the xwrf example. I have tried to recreate it verbatim with my own conda environment and there seems to be an xarray backend problem - way beyond my expertise. I update xarray in my env. but it didn't help.Here's the error message after 'wrf_ds = xr.open_dataset(files[0])' in the example on https://ncar.github.io/esds/posts/2021/xarray-wrf-example/

ValueError Traceback (most recent call last)
/glade/scratch/rneale/ipykernel_116200/1424271191.py in <module>
1 print(files[0])
----> 2 wrf_ds = xr.open_dataset(files[0])
3 print(wrf_ds)

/glade/work/rneale/python/miniconda3/envs/neale_wrf/lib/python3.9/site-packages/xarray/backends/api.py in open_dataset(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, backend_kwargs, *args, **kwargs)
477
478 if engine is None:
--> 479 engine = plugins.guess_engine(filename_or_obj)
480
481 backend = plugins.get_backend(engine)

/glade/work/rneale/python/miniconda3/envs/neale_wrf/lib/python3.9/site-packages/xarray/backends/plugins.py in guess_engine(store_spec)
154 )
155
--> 156 raise ValueError(error_msg)
157
158

ValueError: found the following matches with the input file in xarray's IO backends: ['netcdf4', 'h5netcdf']. But their dependencies may not be installed, see:
http://xarray.pydata.org/en/stable/user-guide/io.html
http://xarray.pydata.org/en/stable/getting-started-guide/installing.html

view this post on Zulip Deepak Cherian (Nov 05 2021 at 21:44):

Sorry there was a regression in the most recent xarray release. I've pushed a bugfix release but it hasn't reached conda-forge yet. IDowngrading to xarray=0.19.0 should work.

view this post on Zulip Rich Neale (Nov 08 2021 at 21:46):

Sweet that worked. Thanks Deepak!

view this post on Zulip Rich Neale (Nov 20 2021 at 15:04):

I another question on xwrf. Can I control the range of the colorbar/contouring as arguments to the hvplot.quadmesh widget, because the range jumps around with each frame, which is not that useful. I couldn't find anything about counting range arguments. Thanks!

view this post on Zulip Deepak Cherian (Nov 20 2021 at 16:47):

I think its cmin and cmax to control range.

view this post on Zulip Max Grover (Nov 21 2021 at 22:28):

You can pass ‘clim = (min, max)’ into the arguements

view this post on Zulip Rich Neale (Nov 23 2021 at 00:14):

Thanks. Literally 10 seconds after I posted, I saw it used in an example!


Last updated: Jan 30 2022 at 12:01 UTC