Closed ehewins closed 1 year ago
I would argue that the problem is NOT the Binning.get_bin_index()
method, the problem is that it it the _avg
method in the _Sector
class (which inherits from the SectorPhi
class) that is sending the wrong information to binning ... for the reasons described (cyclic nature of angles) IMO.
Describe the bug The title describes how the bug appears to the user. The source of the problem is the method
Binning.get_bin_index()
insasdata/data_util/manipulations.py
. If used for angular coordinates, it is possible for the bin index it returns to be greater than the total number of bins, as the subtraction operation doesn't account for the cyclic nature of angles. An error is later thrown when this bad bin index is used, causing the "Wedge Averaging in Phi" slicer to break (this is the only slicer to use the SectorPhi class).To Reproduce Steps to reproduce the behavior:
example_data/2d_data
, using any model.Expected behavior The slicer should cease to move when the mouse button is released, and there should be no error thrown.