Open
Description
so far with xhistogram
, we can only create 1d category_edges
. however, sometimes we would want to make category_edges
multi-dimensional (dependent on lon and lat) when e.g. calculating wrt. climatological terciles.
inspired by #275 and used in #277
I found a way to bin datasets with multi-dim edges resulting in the same results as xhistogram.
e=[.1,.2,.4,.5,.7,.9]
edges = xr.DataArray(e, dims='edge')
(ds<edges).sum('member').diff('edge') == xs.core.utils.histogram(ds,bins=[np.array(e)],dim=['member']).rename({'var1_bin':'edge'})
sounds reasonable @dougiesquire ?