UW-Hydro/MetSim

Bug: Error when domain = 1 grid cell

Closed this issue · 1 comments

tbohn commented

I supplied MetSim with forcings, domain, state files, all in netcdf format, covering a domain that is 1 grid cell in extent (the 'lat' and 'lon' dimensions each have length 1).

I got the following error:
Traceback (most recent call last):
File "/home/tjbohn/anaconda3/lib/python3.5/site-packages/metsim-1.0.0-py3.5.egg/metsim/metsim.py", line 157, in init
File "/home/tjbohn/anaconda3/lib/python3.5/site-packages/metsim-1.0.0-py3.5.egg/metsim/io.py", line 46, in read_met_data
"BufferedReader", "BufferedWriter", "BufferedRWPair",
File "/home/tjbohn/anaconda3/lib/python3.5/site-packages/metsim-1.0.0-py3.5.egg/metsim/io.py", line 83, in process_nc

File "/home/tjbohn/anaconda3/lib/python3.5/site-packages/metsim-1.0.0-py3.5.egg/metsim/io.py", line 159, in read_netcdf
File "/home/tjbohn/anaconda3/lib/python3.5/site-packages/xarray/core/dataset.py", line 1182, in sel
self, indexers, method=method, tolerance=tolerance
File "/home/tjbohn/anaconda3/lib/python3.5/site-packages/xarray/core/indexing.py", line 275, in remap_label_indexers
dim_indexers = get_dim_indexers(data_obj, indexers)
File "/home/tjbohn/anaconda3/lib/python3.5/site-packages/xarray/core/indexing.py", line 258, in get_dim_indexers
"with an indexer for dimension %s" % dim)
ValueError: cannot combine multi-index level indexers with an indexer for dimension lat

tbohn commented

It appears that the problem was on my end: a typo in a dimension name when constructing the forcing file. It works now.