Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neither fold=True nor fold=False is appropriate for WedgeSlicer #2593

Open
ehewins opened this issue Aug 23, 2023 · 0 comments
Open

Neither fold=True nor fold=False is appropriate for WedgeSlicer #2593

ehewins opened this issue Aug 23, 2023 · 0 comments

Comments

@ehewins
Copy link
Contributor

ehewins commented Aug 23, 2023

Describe the issue
The wedge slicer (specifically WedgeInteractorQ) is build on the same foundations as the sector slicer. With this comes "fold" functionality, which when enabled averages the data in the region of interest with the data on the opposite side of the origin. When fold is disabled, data on the opposite side of the origin to the main ROI is shown plotted against negative Q values. This is the current state of wedge slicer, but I had been unaware until recently that these negative Q values were present as the default graph scale is log-log, which obscures the negative Q values.
Neither of these fold behaviours are desired for the wedge slicer.

Expected behaviour
Only data enclosed within the main ROI should be plotted.

To reproduce

  1. In Sasview, Compute/Plot any 2D data from example_data/2d_data, using any model.
  2. Right click the plot and select 'Wedge Averaging in Q'.
  3. Change the scale of the output graph to linear, and observe that negative Q values are also plotted, corresponding to data outside the ROI.

Additional context
The proper fix (in my opinion) would be editing the _Sector class in sasdata/sasdata/data_util/manipulations.py to provide a third alternative to self.fold = True or self.fold = False, one which only processes the data within the specified region of interest. This could make the current version of _Sector even more confusing however, so I would rather work this into the manipulations.py rewrite and use a simpler fix in the meantime. This would involve adding some code to WedgeSlicer.py which looks for data associated with negative Q values in the Data1D object returned by _Sector, then discarding it before plotting.
If/When a method for handling this is added on the manipulations.py side, the commit fixing this issue can be kept or reverted with no ill effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant