Commit 85fed10c authored by Anthony Lim's avatar Anthony Lim
Browse files

PSI BG warning fixes

parent 264344dc
......@@ -84,14 +84,14 @@ std::map<std::string, std::string> PSIBackgroundSubtraction::validateInputs() {
int firstGood = 0;
int lastGood = 0;
try {
firstGood = std::stod(
firstGood = std::stoi(
run.getProperty(FIRST_GOOD + std::to_string(index))->value());
} catch (Kernel::Exception::NotFoundError) {
errors["InputWorkspace"] =
"Input Workspace should should contain first food data. ";
}
try {
lastGood = std::stod(
lastGood = std::stoi(
run.getProperty(LAST_GOOD + std::to_string(index))->value());
} catch (Kernel::Exception::NotFoundError) {
errors["InputWorkspace"] +=
......@@ -105,7 +105,7 @@ std::map<std::string, std::string> PSIBackgroundSubtraction::validateInputs() {
errors["InputWorkspace"] +=
"\n Input Workspace should have first good data > 0. ";
}
if (lastGood > inputWS->readX(index).size()) {
if (lastGood > int(inputWS->readX(index).size())) {
errors["InputWorkspace"] +=
"\n Input Workspace should have last good data < number of bins. ";
}
......
......@@ -27,7 +27,7 @@ MatrixWorkspace_sptr createCountsTestWorkspace(const size_t numberOfHistograms,
numberOfHistograms, numberOfBins);
ws->setYUnit("Counts");
if (addLogs) {
for (int index = 0; index < numberOfHistograms; index++) {
for (size_t index = 0; index < numberOfHistograms; index++) {
ws->mutableRun().addProperty("First good spectra " +
std::to_string(index),
......@@ -72,6 +72,7 @@ private:
calculateBackgroundFromFit(IAlgorithm_sptr &,
const std::pair<double, double> &range,
const int &index) override {
(void) range,index;
return std::make_tuple(m_background, m_fitQuality);
}
double m_background{0.00};
......
......@@ -48,7 +48,7 @@ Usage
# Create workspaces
input_workspace = CreateWorkspace(time, counts)
input_workspace.setYUnit("Counts")
run = input_workspace.getRun()
run = input_workspace.getRun()
run.addProperty("First good spectra 0","0","None",True)
run.addProperty("Last good spectra 0","10","None",True)
workspace_copy = input_workspace.clone()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment