Pass along coordinates of UxDataArray when slicing from grid.
Pass self.coords to as coords argument in core/dataarray.py method _slice_from_grid
Otherwise, _slice_from_grid loses coordinate labels (the index values).
I figure if dims, name, and attrs arguments are passed, coords should be too.
I tested uxda.subset.bounding_box(lon_bounds, lat_bounds) on a UxDataArray with and without the pull request. The results are below. The number of Indexes changes from zero to three.
Without passing the coords argument in _slice_from_grid, the result has zero Indexes
Pass along coordinates of UxDataArray when slicing from grid.
Pass self.coords to as coords argument in core/dataarray.py method _slice_from_grid
Otherwise, _slice_from_grid loses coordinate labels (the index values).
I figure if dims, name, and attrs arguments are passed, coords should be too.
I tested uxda.subset.bounding_box(lon_bounds, lat_bounds) on a UxDataArray with and without the pull request. The results are below. The number of Indexes changes from zero to three.
Without passing the coords argument in _slice_from_grid, the result has zero Indexes
with coords passed, it has 3 indexes: