SasView / sasview

Code for the SasView application.
BSD 3-Clause "New" or "Revised" License
49 stars 41 forks source link

2D plotting enhancements #2494

Open wpotrzebowski opened 1 year ago

wpotrzebowski commented 1 year ago

Is your feature request related to a problem? Please describe. As requested at the Magnetic SANS workshop in Lund, 2023. More control over z scale. Symmetrical z log and hyperbolic arcsine. Different interpolation options.

Describe the solution you'd like This may be a part of advanced options for plotting. These advanced options may be enabled from the Preferences menu and then become available by "right-click".

Additional context GRASP provides similar functionality. Interpolation options in GRASP: Gaussian, Square pixel

ldschmitt commented 1 year ago

Here is the same data set plotted in Grasp (scale is different), exported image from data reduction software at ORNL and SASview upload. Grasp:

Grasp_view

drtSANS (ORNL reduction)

Aussie_1_1_q

SASview:

SASVIEW_scaling

butlerpd commented 1 year ago

@ldschmitt, isn't the difference between the GRASP plot and the SasView plot that GRASP is using zero as the bottom cuttoff and that it masks the high intensity over the beam? I believe both are currently available in SasView. Certainly setting the min to zero I do a lot and I find quite annoying I have to say 😄. But I've always worried about defaulting to zero for the z minimum?

Regarding interpolation, SasView is detector agnostic and thus does not know about pixels. I think (but would have to ask somebody who knows the code) that what it does is assume the pixel boundaries to be half way between nearest neighbor points?

Larger discussion which is always ongoing is how to handle the space between points. For reduced data, pixels do not exist as there should only be the intensity at the nominal q which includes intensity from qs around it as defined by the resolution distribution function. One could use the width of the Gaussian and leave the rest blank for sparse data, but for a normal detector the resolution at one pixel will overlap with others because of dlambda and other contributions to dtheta.... But this bit should be moved to a discussion item I suspect.

ldschmitt commented 1 year ago

Grasp is 0 at the bottom. I can try to reload that data to get it on the same scale as the SASview image so we have apples and apples. :)

I agree. The issue is that SASVIew will strip out NANs in the data file and then I think interpolate between missing q-values. This isn't necessarily wrong it is just something that users might want to handle differently for different data sets.

As for the larger conversation, I agree we should think about possibly convolving the resolution function to handle the missing data between the points.

astellhorn commented 1 year ago

Another bug in the current 2D plotting options: If parameters are changed in the FitPage, the colorbar is reset, which is very annoying, but this was for SasView 4.2.2, we are not sure if this is fixed now already?