Skip to content
Snippets Groups Projects
Commit adb532d3 authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #24333 add run number to filters

parent 32ed0b2c
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,10 @@ double QMOD(const Mantid::Geometry::IPeak &p) { ...@@ -34,6 +34,10 @@ double QMOD(const Mantid::Geometry::IPeak &p) {
double SN(const Mantid::Geometry::IPeak &p) { double SN(const Mantid::Geometry::IPeak &p) {
return p.getIntensity() / p.getSigmaIntensity(); return p.getIntensity() / p.getSigmaIntensity();
} }
double RUN(const Mantid::Geometry::IPeak &p) {
return p.getRunNumber();
}
} // namespace } // namespace
namespace Mantid { namespace Mantid {
...@@ -66,7 +70,7 @@ void FilterPeaks::init() { ...@@ -66,7 +70,7 @@ void FilterPeaks::init() {
std::vector<std::string> filters{"h+k+l", "h^2+k^2+l^2", "Intensity", std::vector<std::string> filters{"h+k+l", "h^2+k^2+l^2", "Intensity",
"Signal/Noise", "QMod", "Wavelength", "Signal/Noise", "QMod", "Wavelength",
"DSpacing", "TOF"}; "DSpacing", "TOF", "RunNumber"};
declareProperty("FilterVariable", "", declareProperty("FilterVariable", "",
boost::make_shared<StringListValidator>(filters), boost::make_shared<StringListValidator>(filters),
"The variable on which to filter the peaks"); "The variable on which to filter the peaks");
...@@ -150,6 +154,8 @@ FilterPeaks::FilterFunction FilterPeaks::getFilterVariableFunction( ...@@ -150,6 +154,8 @@ FilterPeaks::FilterFunction FilterPeaks::getFilterVariableFunction(
filterFunction = &SN; filterFunction = &SN;
else if (filterVariable == "QMod") else if (filterVariable == "QMod")
filterFunction = &QMOD; filterFunction = &QMOD;
else if (filterVariable == "RunNumber")
filterFunction = &RUN;
else else
throw std::invalid_argument("Unknown FilterVariable: " + filterVariable); throw std::invalid_argument("Unknown FilterVariable: " + filterVariable);
return filterFunction; return filterFunction;
......
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