You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The class _Sector in sasdata/data_util/manipulations.py runs into issues when called with values for the args phi_min and phi_max which are 2pi radians apart. This behaviour can be observed by following the steps below:
To Reproduce
In Sasview, Compute/Plot any 2D data from example_data/2d_data, using any model.
Right click the plot and select either 'Wedge Averaging in Q' or 'Wedge Averaging in Phi'.
Right click the plot again and select 'Edit Slicer Parameters', and set delta_phi [deg] to 180.
Try moving the central line around, and note the error in the terminal: ValueError: Average Error: No points inside sector of ROI to average...
Sometimes the bug doesn't occur immediately, but it will usually show itself after trying a few different phi values. If dragging the central line via the GUI, you'll notice that the slicer won't stay put when you release your mouse button.
Additional context
I believe the issue begins with lines 875 and 876 of manipulations.py. If self.phi_min and self.phi_max are 2pi radians apart, then after being passed through the flip_phi() function the new variables phi_min and phi_max have the same value. There are then a load of checks for each of the points in the dataset to see if they're in the region enclosed by phi_min and phi_max. Instead of examining a circular region for valid datapoints, the _avg method examines an infinitesimal region which finishes immediately after it starts. Hence the error message: ValueError: Average Error: No points inside sector of ROI to average....
The text was updated successfully, but these errors were encountered:
Describe the bug
The class
_Sector
insasdata/data_util/manipulations.py
runs into issues when called with values for the argsphi_min
andphi_max
which are 2pi radians apart. This behaviour can be observed by following the steps below:To Reproduce
example_data/2d_data
, using any model.delta_phi [deg]
to 180.ValueError: Average Error: No points inside sector of ROI to average...
Sometimes the bug doesn't occur immediately, but it will usually show itself after trying a few different
phi
values. If dragging the central line via the GUI, you'll notice that the slicer won't stay put when you release your mouse button.Additional context
I believe the issue begins with lines 875 and 876 of
manipulations.py
. Ifself.phi_min
andself.phi_max
are 2pi radians apart, then after being passed through theflip_phi()
function the new variablesphi_min
andphi_max
have the same value. There are then a load of checks for each of the points in the dataset to see if they're in the region enclosed byphi_min
andphi_max
. Instead of examining a circular region for valid datapoints, the_avg
method examines an infinitesimal region which finishes immediately after it starts. Hence the error message:ValueError: Average Error: No points inside sector of ROI to average...
.The text was updated successfully, but these errors were encountered: