Skip to content
Snippets Groups Projects
Commit e7532def authored by Doucet, Mathieu's avatar Doucet, Mathieu
Browse files

Re #11863 Fix system test

parent 0eaf69b0
No related branches found
No related tags found
No related merge requests found
...@@ -154,7 +154,6 @@ void EQSANSDarkCurrentSubtraction2::exec() { ...@@ -154,7 +154,6 @@ void EQSANSDarkCurrentSubtraction2::exec() {
<< "ERROR: Could not find proton charge or duration in sample logs" << "ERROR: Could not find proton charge or duration in sample logs"
<< std::endl; << std::endl;
}; };
// The scaling factor should account for the TOF cuts on each side of a frame // The scaling factor should account for the TOF cuts on each side of a frame
// The EQSANSLoad algorithm cuts the beginning and end of the TOF distribution // The EQSANSLoad algorithm cuts the beginning and end of the TOF distribution
// so we don't need to correct the scaling factor here. When using LoadEventNexus // so we don't need to correct the scaling factor here. When using LoadEventNexus
...@@ -193,16 +192,20 @@ void EQSANSDarkCurrentSubtraction2::exec() { ...@@ -193,16 +192,20 @@ void EQSANSDarkCurrentSubtraction2::exec() {
progress.report("Subtracting dark current"); progress.report("Subtracting dark current");
// Loop over all tubes and patch as necessary // Loop over all tubes and patch as necessary
for (int i = 0; i < numberOfSpectra; i++) { for (int i = 0; i < numberOfSpectra; i++) {
IDetector_const_sptr det = inputWS->getDetector(i);
// If this detector is a monitor, skip to the next one
if (det->isMasked())
continue;
const MantidVec &YDarkValues = scaledDarkWS->readY(i); const MantidVec &YDarkValues = scaledDarkWS->readY(i);
const MantidVec &YDarkErrors = scaledDarkWS->readE(i); const MantidVec &YDarkErrors = scaledDarkWS->readE(i);
const MantidVec &XValues = inputWS->readY(i); const MantidVec &XValues = inputWS->readX(i);
MantidVec &YValues = inputWS->dataY(i); MantidVec &YValues = inputWS->dataY(i);
MantidVec &YErrors = inputWS->dataE(i); MantidVec &YErrors = inputWS->dataE(i);
for (int j = 0; j < nBins; j++) { for (int j = 0; j < nBins; j++) {
double bin_scale = (XValues[j+1] - XValues[j]) / (XValues[nBins] - XValues[0]); double bin_scale = (XValues[j+1] - XValues[j]) / (XValues[nBins] - XValues[0]);
YValues[j] -= YDarkValues[0] * bin_scale; YValues[j] -= YDarkValues[0] * bin_scale;
YErrors[j] = sqrt(YErrors[j] * YErrors[j] + YDarkErrors[0] * YDarkErrors[0] * bin_scale * bin_scale); YErrors[j] = sqrt(YErrors[j] * YErrors[j] + YDarkErrors[0] * YDarkErrors[0] * bin_scale * bin_scale);
} }
} }
setProperty("OutputWorkspace", inputWS); setProperty("OutputWorkspace", inputWS);
......
...@@ -22,7 +22,8 @@ class EQSANSDarkCurrent(stresstesting.MantidStressTest): ...@@ -22,7 +22,8 @@ class EQSANSDarkCurrent(stresstesting.MantidStressTest):
def runTest(self): def runTest(self):
config = ConfigService.Instance() config = ConfigService.Instance()
config["facilityName"]='SNS' config["facilityName"]='SNS'
EQSANS(True) # The new version of dark current subtraction only works on histograms
EQSANS(False)
SolidAngle() SolidAngle()
SetBeamCenter(96.29, 126.15) SetBeamCenter(96.29, 126.15)
PerformFlightPathCorrection(False) PerformFlightPathCorrection(False)
......
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