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

Use errorweighting when summing individual I(q, Lambda_i) curves during the inelastic compensation procedure independent of the useerrorweighting switch being True or False #36

Open
glass-ships opened this issue Dec 17, 2024 · 1 comment

Comments

@glass-ships
Copy link
Member

Problem Description:

Update request

  1. Use errorweighting when summing individual I(q, Lambda_i) curves during the inelastic compensation procedure independent of the useerrorweighting switch being True or False
    WHAT: make the use of errorweighting permanently when summing I(q) curves corresponding to different wavelengthbins

WHERE: The errorweighting is to be applied as a default operation during the second binning stage in the inelastic compensation subbranch.
image
image
..
..
..

Steps to Reproduce:

WHY: When using current code the choice for the use of errorweighted averaging is either applied throughout the data reduction or nowhere. Using errorweighting may be unfavorable when working with low statistics data. The challenge with using errorwheigting at its present form is demonstrated below. 5 measurements were performed on a stable buffer sample and the scattering curves of a selected wavelengthband were plotted as a function of using 1, 2, 3 or 5 data sets for the calculation (see Figure 1).
image
image

Figure 1 Influence of varying measurement statistics on an I(q) curve of a single wavelength band without (upper) and with (down) the useerrorweighting option during the data reduction.

Ideally the changing statistics should not influence the absolute intensity of the scattering data. The erroneous decrease in the scattering intensity with decreasing statistics presumably is due to the 0 counts on the detector which get a 1 error assigned. With the presence of these 0 counts, when an errorweighting is applied for raw data, we may distort the scattering data towards 0 absolute intensities. This explanation is to be tested, and a possible solution – if exists – should be provided for this issue, but is outside of the scope of the present update-request.
When the useerrorweighting option is set to False, at the moment this setting is applied throughout the data reduction protocol. The need for this option to be set differently in the inelastic compensation subbranch of the data reduction is demonstrated below. When I(Q) curves corresponding to different wavelengthbands are summed together, the low and high-Q limits of the individual curves are prone to low statistics and high errors. If the different I(Q) curves are summed up without errorweighting these errors deteriorate the quality of the summed scattering data at low and high-Q extremities of the final scattering curves (Figure 2).

image
image
Figure 2 Benefits of the Errorweighting when summing I(Q) curves corresponding to individual wavelength bands. The data quality of the errorweighted (orange) curves is superior. The right figure demonstrates why the presently available method is not suitable for solving this problem. Though the quality of the high-Q end of the errorweighted data is superior, the absolute intensity is different due to issues discussed above.

DETAIL: After Q and lambda binning the scattering data, the different curves are readjusted with a constant b factor and summed together. This summation is to be performed with the use of Errorweighting independently of the Errorweighting option specified in the json input for the data reduction.

Investigation/Analysis Results:

The error_weighted = weighted_errors, line is to be changed to error_weighted = True , only at this single location.

image
The result is demonstrated below.
image
image

Turning the referred line to True significantly reduces the errorbars at the high-Q limits of the final data and smoothens the curve.

@glass-ships
Copy link
Member Author

This issue was migrated from code.ornl.gov.

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

No branches or pull requests

1 participant