Skip to content
Snippets Groups Projects
Commit 2c06675e authored by Gemma Guest's avatar Gemma Guest
Browse files

Update system tests with transmission binning fix

This commit updates the reference files for tests where the transmission
workspace is output from ReflectometryReductionOne. The refactored code
in this PR has introduced a fix in this algorithm to output the
transmission workspace after it has been rebinned to detectors.
Previously it was output before the rebin step, hence the minor
differences in the output. Note however that the final results of the
reduction (IvsQ workspaces) are unchanged.

This commit also moves the code to set the output workspace to the
bottom of the function that does the transmission correction, to help
avoid a similar problem happening again.

Re #27633
parent 47e63ef3
No related branches found
No related tags found
No related merge requests found
...@@ -260,6 +260,7 @@ void ReflectometryReductionOne2::exec() { ...@@ -260,6 +260,7 @@ void ReflectometryReductionOne2::exec() {
// Convert to Q // Convert to Q
auto IvsQ = convertToQ(IvsLam); auto IvsQ = convertToQ(IvsLam);
// Set outputs
if (!isDefault("OutputWorkspaceWavelength") || isChild()) { if (!isDefault("OutputWorkspaceWavelength") || isChild()) {
setProperty("OutputWorkspaceWavelength", IvsLam); setProperty("OutputWorkspaceWavelength", IvsLam);
} }
...@@ -554,8 +555,6 @@ MatrixWorkspace_sptr ReflectometryReductionOne2::transmissionCorrection( ...@@ -554,8 +555,6 @@ MatrixWorkspace_sptr ReflectometryReductionOne2::transmissionCorrection(
rebinToWorkspaceAlg->setProperty("WorkspaceToRebin", transmissionWS); rebinToWorkspaceAlg->setProperty("WorkspaceToRebin", transmissionWS);
rebinToWorkspaceAlg->execute(); rebinToWorkspaceAlg->execute();
transmissionWS = rebinToWorkspaceAlg->getProperty("OutputWorkspace"); transmissionWS = rebinToWorkspaceAlg->getProperty("OutputWorkspace");
if (isDefault("OutputWorkspaceTransmission") && !transmissionWSName.empty())
setPropertyValue("OutputWorkspaceTransmission", transmissionWSName);
// If the detector workspace has been reduced then the spectrum maps // If the detector workspace has been reduced then the spectrum maps
// should match AFTER reducing the transmission workspace // should match AFTER reducing the transmission workspace
...@@ -564,6 +563,13 @@ MatrixWorkspace_sptr ReflectometryReductionOne2::transmissionCorrection( ...@@ -564,6 +563,13 @@ MatrixWorkspace_sptr ReflectometryReductionOne2::transmissionCorrection(
} }
MatrixWorkspace_sptr normalized = divide(detectorWS, transmissionWS); MatrixWorkspace_sptr normalized = divide(detectorWS, transmissionWS);
// Set output transmission workspace
if (isDefault("OutputWorkspaceTransmission") && !transmissionWSName.empty()) {
setPropertyValue("OutputWorkspaceTransmission", transmissionWSName);
}
setProperty("OutputWorkspaceTransmission", transmissionWS);
return normalized; return normalized;
} }
......
050d866089735a3107558c0effcfaae3 1c6babfa2dce0bede17fa6961a8849f8
6749ec6060b1e697e77ad29c9dc2ce4a d0b509de975d822199aff59d8c3f8599
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment