I have a code which uses the weights resulting from calls to binAverage, and I can see that the edges end up getting points outside of the bins. The code uses the "whichBin" function but does not verify that the result is within the closest bin. This appears to be the case for both the 1-D and 2-D averages.
See https://github.com/autoplot/dev/blob/master/demos/2021/20210512/scatterBinAverage1D.jy and https://github.com/autoplot/dev/blob/master/demos/2021/20210512/scatterBinAverage2D.jy
See https://github.com/das-developers/das2java/issues/180
The 2D issue is that truncate was used to find the bin number, so -0.99 would have resulted in an extra count in bin 0. This is fixed.
1D is fixed now, getting the cadence and then requiring the data be within 1/2 of the cadence of the extent of the data.
Last edit: Jeremy Faden 7 hours ago