Fixes binning bug in implementation of sesans data #2331
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a binning bug for sesans data.
Sesans is in real space and the Hankel transform from q space to real space (spin echo length) was implemented as a resolution function. For other resolution functions, the qmin and qmax range is compared to data.x which are all in q space. This is then passed to the calculator to return the unsmeared Iq. However, for sesans data, qmin, qmax, and data.x are all in real space while the calculator is expecting q space data to return the unsmeared Iq (which will then get passed to the sesans "smearer" which uses the hankel transform to convert Iq to real space).
Due to the number of points in q_calc (in q space) being much greater than the number of points in q (spin echo length in real space) in the sesans transform (resolution function), this resulted in a small portion of the data being improperly calculated at the incorrect q values (spin echo length being passed as q to the calculator returning Iq) with a error on the order of 1e-10.
The q, Iq data being passed to the Hankel transform before and after the fix for a sphere form factor with scale = 0.005, background = 0, sld = 1, sld_solvent = 6, and radius = 10000:

After the Hankel transform for both q, Iq datasets and compared to the analytical model for the same system:

Error between the datasets in SESANS space:
