mantidproject / mslice

Source code for Mantid MSlice
http://mantidproject.github.io/mslice
1 stars 2 forks source link

Fix incorrect integration of GDOS cuts #920

Closed mducle closed 1 year ago

mducle commented 1 year ago

Description of work:

As noted in the issue #919, the GDOS cuts computed by MSlice does not agree with that computed by the ComputeIncoherentDOS algorithm although they use in principle the same equations method. In particular there are two steps to the calculation:

  1. Compute a 2D slice GDOS(q,w) = S(q,w) * (E/Q^2) * bose as noted in the docs
  2. Integrate this 2D slice in either Q (only mode supported by ComputeIncoherentDOS) or in E.

The issue is with this second step. This is because the first step produces a RebinnedOutput type workspace which has a (hidden-from-Python) extra weight for each bin. To correctly compute the integration/rebin this weight must be taken into account, but the previous MSlice code simply sums the counts in each bin. Instead it should use the Mantid Rebin2D or Integration algorithms which take into account the fractional weight rather than just a simplistic sum.

To test:

Run the script in the issue and checks that the MSlice and ComputeIncoherentDOS outputs agree. Plot the slice and change intensity to GDOS and check that interactive plotting works as expected.

Fixes #919.