Skip to content

Commit

Permalink
Refs #10541 sum background for NoFit and add MANDI to MaskBTP
Browse files Browse the repository at this point in the history
  • Loading branch information
VickieLynch committed Nov 12, 2014
1 parent 6bb6db0 commit 4caeae0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
13 changes: 11 additions & 2 deletions Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
Expand Up @@ -432,7 +432,15 @@ namespace MDAlgorithms
}
}

if (profileFunction.compare("NoFit") != 0)
if (profileFunction.compare("NoFit") == 0)
{
for (size_t j = 0; j < numSteps; j++)
{
if (j < peakMin || j > peakMax)
background_total = background_total + wsProfile2D->dataY(i)[j];
}
}
else
{
API::IAlgorithm_sptr findpeaks = createChildAlgorithm("FindPeaks", -1, -1, false);
findpeaks->setProperty("InputWorkspace", wsProfile2D);
Expand Down Expand Up @@ -554,7 +562,8 @@ namespace MDAlgorithms

g_log.information() << "Peak " << i << " at " << pos << ": signal "
<< signal << " (sig^2 " << errorSquared << "), with background "
<< bgSignal << " (sig^2 " << bgErrorSquared << ") subtracted."
<< bgSignal + ratio * background_total << " (sig^2 "
<< bgErrorSquared+ ratio * ratio * std::fabs(background_total) << ") subtracted."
<< std::endl;

}
Expand Down
Expand Up @@ -24,8 +24,8 @@ def summary(self):

def PyInit(self):
self.declareProperty(mantid.api.WorkspaceProperty("Workspace", "",direction=mantid.kernel.Direction.InOut, optional = mantid.api.PropertyMode.Optional), "Input workspace (optional)")
allowedInstrumentList=mantid.kernel.StringListValidator(["","ARCS","CNCS","CORELLI","HYSPEC","NOMAD","POWGEN","SEQUOIA","SNAP","SXD","TOPAZ","WISH"])
self.declareProperty("Instrument","",validator=allowedInstrumentList,doc="One of the following instruments: ARCS, CNCS, CORELLI, HYSPEC, NOMAD, POWGEN, SNAP, SEQUOIA, SXD, TOPAZ, WISH")
allowedInstrumentList=mantid.kernel.StringListValidator(["","ARCS","CNCS","CORELLI","HYSPEC","MANDI","NOMAD","POWGEN","SEQUOIA","SNAP","SXD","TOPAZ","WISH"])
self.declareProperty("Instrument","",validator=allowedInstrumentList,doc="One of the following instruments: ARCS, CNCS, CORELLI, HYSPEC, MANDI, NOMAD, POWGEN, SNAP, SEQUOIA, SXD, TOPAZ, WISH")
self.declareProperty("Bank","",doc="Bank(s) to be masked. If empty, will apply to all banks")
self.declareProperty("Tube","",doc="Tube(s) to be masked. If empty, will apply to all tubes")
self.declareProperty("Pixel","",doc="Pixel(s) to be masked. If empty, will apply to all pixels")
Expand All @@ -47,13 +47,13 @@ def PyExec(self):
self.instrument = ws.getInstrument()
self.instname = self.instrument.getName()

instrumentList=["ARCS","CNCS","CORELLI","HYSPEC","NOMAD","POWGEN","SEQUOIA","SNAP","SXD","TOPAZ","WISH"]
self.bankmin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"NOMAD":1,"POWGEN":1,"SEQUOIA":38,"SNAP":1,"SXD":1,"TOPAZ":10,"WISH":1}
self.bankmax={"ARCS":115,"CNCS":50,"CORELLI":91,"HYSPEC":20,"NOMAD":99,"POWGEN":300,"SEQUOIA":150,"SNAP":18,"SXD":11,"TOPAZ":59,"WISH":10}
tubemin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"NOMAD":1,"POWGEN":0,"SEQUOIA":1,"SNAP":0,"SXD":0,"TOPAZ":0,"WISH":1}
tubemax={"ARCS":8,"CNCS":8,"CORELLI":16,"HYSPEC":8,"NOMAD":8,"POWGEN":153,"SEQUOIA":8,"SNAP":255,"SXD":63,"TOPAZ":255,"WISH":152}
pixmin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"NOMAD":1,"POWGEN":0,"SEQUOIA":1,"SNAP":0,"SXD":0,"TOPAZ":0,"WISH":1}
pixmax={"ARCS":128,"CNCS":128,"CORELLI":256,"HYSPEC":128,"NOMAD":128,"POWGEN":6,"SEQUOIA":128,"SNAP":255,"SXD":63,"TOPAZ":255,"WISH":512}
instrumentList=["ARCS","CNCS","CORELLI","HYSPEC","MANDI","NOMAD","POWGEN","SEQUOIA","SNAP","SXD","TOPAZ","WISH"]
self.bankmin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"MANDI":10,"NOMAD":1,"POWGEN":1,"SEQUOIA":38,"SNAP":1,"SXD":1,"TOPAZ":10,"WISH":1}
self.bankmax={"ARCS":115,"CNCS":50,"CORELLI":91,"HYSPEC":20,"MANDI":59,"NOMAD":99,"POWGEN":300,"SEQUOIA":150,"SNAP":18,"SXD":11,"TOPAZ":59,"WISH":10}
tubemin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"MANDI":0,"NOMAD":1,"POWGEN":0,"SEQUOIA":1,"SNAP":0,"SXD":0,"TOPAZ":0,"WISH":1}
tubemax={"ARCS":8,"CNCS":8,"CORELLI":16,"HYSPEC":8,"MANDI":255,"NOMAD":8,"POWGEN":153,"SEQUOIA":8,"SNAP":255,"SXD":63,"TOPAZ":255,"WISH":152}
pixmin={"ARCS":1,"CNCS":1,"CORELLI":1,"HYSPEC":1,"MANDI":0,"NOMAD":1,"POWGEN":0,"SEQUOIA":1,"SNAP":0,"SXD":0,"TOPAZ":0,"WISH":1}
pixmax={"ARCS":128,"CNCS":128,"CORELLI":256,"HYSPEC":128,"MANDI":255,"NOMAD":128,"POWGEN":6,"SEQUOIA":128,"SNAP":255,"SXD":63,"TOPAZ":255,"WISH":512}

try:
instrumentList.index(self.instname)
Expand Down

0 comments on commit 4caeae0

Please sign in to comment.