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

Allow slit resolution to be applied to 2D (anisotropic) data #2097

Open
butlerpd opened this issue Jun 17, 2022 · 1 comment
Open

Allow slit resolution to be applied to 2D (anisotropic) data #2097

butlerpd opened this issue Jun 17, 2022 · 1 comment
Labels
Enhancement Feature requests and/or general improvements

Comments

@butlerpd
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently both custom slit smear and custom pinhole smear options are available for 1D models. However, for 2D only the custom pinhole is available. User Garvey points out that folks sometimes collect USANS data from anisotropic scattering. It would be nice to be able to apply slit smearing to the 2D (oriented?) anisotropic data in order to compare with the USANS data?

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
It may make more sense, at least for this use case, to merge this with the ticket on model fitting of oriented 1D data (e.g. from sector averages of an anisotropic pattern of aligned rods etc.)

Additional context
The second screen shot is for a standard model (the 2D button is not checked on the fitpage), while the first screenshot of the second fitpage is for the same model after checking the 2D button

Screenshot 2022-06-17 12 45 23 PM
Screenshot 2022-06-17 12 38 21 PM

@pkienzle
Copy link
Contributor

I'm assuming this ticket is about 1D USANS data with an oriented sample. 2D data taken with slit geometry seems like a rare configuration best handled by the reduction software putting proper ΔQx and ΔQy in the datafile.

Fitting oriented USANS data is already possible in sasmodels. See SasView/sasmodels#269. Resolution code is in sasmodels/resolution2d.py, along with example/oriented_usans.py which uses data.oriented to select it. It wraps the underlying Iq call much like other resolution calculators.

Similar code is needed in sascalc/fit/qsmearing.py. A quick fix is to create a new smearing object which looks like the existing PySmear but with Slit2D. Unlike the 1D resolution functions it would ignore the iq_in values for the unsmeared Iq and use resolution.q_calc as the input to the theory calculator.

A better fix requires refactoring the sasview:sasmodels interface. In order to add the "unsmeared" Iq in the fit results, sasview computes the function at the measured Iq points then computes some margins at either end to cover the resolution window. This slows down function evaluation and adds a lot of code complexity. It also leads to incorrect results in some circumstances, such as when there are gaps in the sasview measurement (points on either side of the gap will not have sufficient calculated theory points to correctly apply resolution). Worse, this complexity is repeated both in the fit wrapper and in the GUI code. Ironically the code was written this way for efficiency but the net result is that it slows down fitting which does not need the unsmeared curve.

In the GUI the orientation parameters only appear for 2D datasets, but oriented USANS is a 1D dataset that requires orientation parameters. You will need a flag in the GUI much like the polydispersity flag to turn on oriented slit smearing and add the orientation parameters. 1D data already has custom pinhole and custom slit smear so no change required for that.


An alternative approach to fitting oriented USANS would be to convert the 1D data into a 2D strip with Qy=0 and define ΔQx and ΔQy appropriately for the slit geometry. This will work with the current program though the plots will not be very useful.

@lucas-wilkins lucas-wilkins added Enhancement Feature requests and/or general improvements and removed Feature Request labels Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Feature requests and/or general improvements
Projects
None yet
Development

No branches or pull requests

3 participants