---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-5-18be2f814549> in <module>()
1 bins = [('LONG',10),('LAT',10)]
----> 2 grid_coarse = grid_aggregate(ds_new,bins)
/Users/juliusbusecke/Work/CODE/PYTHON/xarrayutils/xarrayutils/build_grids.py in grid_aggregate(grid, bins)
73 temp = dict([])
74 for ff in ['XC','YC']:
---> 75 temp[ff] = xr.DataArray(da.from_array(grid[ff].data,chunks=grid[ff].shape),
76 coords=grid[ff].coords,dims=grid[ff].dims)
77
/Users/juliusbusecke/anaconda/lib/python2.7/site-packages/xarray/core/dataset.pyc in __getitem__(self, key)
696
697 if hashable(key):
--> 698 return self._construct_dataarray(key)
699 else:
700 return self._copy_listed(np.asarray(key))
/Users/juliusbusecke/anaconda/lib/python2.7/site-packages/xarray/core/dataset.pyc in _construct_dataarray(self, name)
640 except KeyError:
641 _, name, variable = _get_virtual_variable(
--> 642 self._variables, name, self._level_coords, self.dims)
643
644 coords = OrderedDict()
/Users/juliusbusecke/anaconda/lib/python2.7/site-packages/xarray/core/dataset.pyc in _get_virtual_variable(variables, key, level_vars, dim_sizes)
69 ref_var = dim_var.to_index_variable().get_level_variable(ref_name)
70 else:
---> 71 ref_var = variables[ref_name]
72
73 if var_name is None:
KeyError: 'XC'