You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Divide algorithm sets the output workspace distribution flag to True in the following cases:
If both workspaces are ragged
If both workspaces have the same units and the RHS workspace (i.e. the denominator workspace) has multiple bins
Some other Mantid algorithms (e.g. the Integration algorithm) assume that a workspace with the distribution flag set to True will have had it's counts divided by the bin width, so you get different results depending on what the flag is set to. In some scenarios a divide such as the one described in case 2 above will result in a distribution (e.g. if you divide a workspace by a vanadium measurement then you will have also accounted for the bin-width), however some will not (e.g. absorption corrections, which are just the attenuation at the bin-centre).
The way the Divide algorithm automatically sets the distribution flag can be missed/cause confusion and has had to be worked around in a few scenarios at ISIS (see #38466 as a recent example). Having discussed this with ORNL, their workflows are not currently affected by this, but they would be OK with us adding an extra property to the Divide algorithm to allow the default behaviour to be overridden when appropriate.
The suggestion from Pete is to add the additional property as an EnumeratedStringProperty with values of histogram, distribution, and auto (default).
It may also be good to add a description to the algorithm documentation to ensure users aren't caught out by this behaviour.
The text was updated successfully, but these errors were encountered:
The
Divide
algorithm sets the output workspace distribution flag toTrue
in the following cases:Some other Mantid algorithms (e.g. the
Integration
algorithm) assume that a workspace with the distribution flag set toTrue
will have had it's counts divided by the bin width, so you get different results depending on what the flag is set to. In some scenarios a divide such as the one described in case 2 above will result in a distribution (e.g. if you divide a workspace by a vanadium measurement then you will have also accounted for the bin-width), however some will not (e.g. absorption corrections, which are just the attenuation at the bin-centre).The way the
Divide
algorithm automatically sets the distribution flag can be missed/cause confusion and has had to be worked around in a few scenarios at ISIS (see #38466 as a recent example). Having discussed this with ORNL, their workflows are not currently affected by this, but they would be OK with us adding an extra property to theDivide
algorithm to allow the default behaviour to be overridden when appropriate.The suggestion from Pete is to add the additional property as an EnumeratedStringProperty with values of
histogram
,distribution
, andauto
(default).It may also be good to add a description to the algorithm documentation to ensure users aren't caught out by this behaviour.
The text was updated successfully, but these errors were encountered: