diff --git a/Framework/Crystal/inc/MantidCrystal/FindSXPeaksHelper.h b/Framework/Crystal/inc/MantidCrystal/FindSXPeaksHelper.h index 92bb2e8c2dac..3d8a1275d64f 100644 --- a/Framework/Crystal/inc/MantidCrystal/FindSXPeaksHelper.h +++ b/Framework/Crystal/inc/MantidCrystal/FindSXPeaksHelper.h @@ -70,6 +70,8 @@ struct MANTID_CRYSTAL_DLL SXPeak { detid_t getDetectorId() const; + const std::vector &getPeakSpectras() const; + private: /// TOF for the peak centre double m_tof; @@ -157,8 +159,11 @@ class MANTID_CRYSTAL_DLL PeakFindingStrategy { virtual ~PeakFindingStrategy() = default; PeakList findSXPeaks(const HistogramData::HistogramX &x, const HistogramData::HistogramY &y, const HistogramData::HistogramE &e, const int workspaceIndex) const; + void setMinNBinsPerPeak(int minBinsPerPeak); protected: + void filterPeaksForMinBins(std::vector> &inputPeakList) const; + BoundsIterator getBounds(const HistogramData::HistogramX &x) const; double calculatePhi(size_t workspaceIndex) const; double getXValue(const HistogramData::HistogramX &x, const size_t peakLocation) const; @@ -174,6 +179,7 @@ class MANTID_CRYSTAL_DLL PeakFindingStrategy { const double m_maxValue = EMPTY_DBL(); const API::SpectrumInfo &m_spectrumInfo; const XAxisUnit m_units; + int m_minNBinsPerPeak = EMPTY_INT(); }; class MANTID_CRYSTAL_DLL StrongestPeaksStrategy : public PeakFindingStrategy { @@ -263,14 +269,22 @@ class MANTID_CRYSTAL_DLL ReducePeakListStrategy { virtual std::vector reduce(const std::vector &peaks, Mantid::Kernel::ProgressBase &progress) const = 0; + void setMinNSpectraPerPeak(int minSpectrasForPeak); + void setMaxNSpectraPerPeak(int maxSpectrasForPeak); + protected: const CompareStrategy *m_compareStrategy; + int m_minNSpectraPerPeak = EMPTY_INT(); + int m_maxNSpectraPerPeak = EMPTY_INT(); }; class MANTID_CRYSTAL_DLL SimpleReduceStrategy : public ReducePeakListStrategy { public: SimpleReduceStrategy(const CompareStrategy *compareStrategy); std::vector reduce(const std::vector &peaks, Mantid::Kernel::ProgressBase &progress) const override; + +private: + void reducePeaksFromNumberOfSpectras(std::vector &inputPeaks) const; }; class MANTID_CRYSTAL_DLL FindMaxReduceStrategy : public ReducePeakListStrategy { diff --git a/Framework/Crystal/src/FindSXPeaks.cpp b/Framework/Crystal/src/FindSXPeaks.cpp index 9163a39700d5..6e68893e17b9 100644 --- a/Framework/Crystal/src/FindSXPeaks.cpp +++ b/Framework/Crystal/src/FindSXPeaks.cpp @@ -83,7 +83,8 @@ void FindSXPeaks::init() { "spectrum. This is slower than StrongestPeakOnly. Note that the " "recommended ResolutionStrategy in this mode is AbsoluteResolution.\n" "3. AllPeaksNSigma: This stratergy will look for peaks by bins that are" - " more than nsigma different in intensity."); + " more than nsigma different in intensity. Note that the " + "recommended ResolutionStrategy in this mode is AbsoluteResolution.\n"); // Declare declareProperty("SignalBackground", 10.0, mustBePositiveDouble, @@ -178,10 +179,6 @@ void FindSXPeaks::init() { "ResolutionStrategy", Mantid::Kernel::ePropertyCriterion::IS_EQUAL_TO, absoluteResolutionPeaksStrategy)); - declareProperty(std::make_unique>("OutputWorkspace", "", Direction::Output), - "The name of the PeaksWorkspace in which to store the list " - "of peaks found"); - // Group const std::string resolutionGroup = "Resolution Settings"; setPropertyGroup("ResolutionStrategy", resolutionGroup); @@ -190,6 +187,26 @@ void FindSXPeaks::init() { setPropertyGroup("PhiResolution", resolutionGroup); setPropertyGroup("TwoThetaResolution", resolutionGroup); + // Declare + declareProperty("MinNBinsPerPeak", EMPTY_INT(), mustBePositive, + "Minimum number of bins contributing to a peak in an individual spectrum"); + + declareProperty("MinNSpectraPerPeak", EMPTY_INT(), mustBePositive, + "Minimum number of spectra contributing to a peak after they are grouped"); + + declareProperty("MaxNSpectraPerPeak", EMPTY_INT(), mustBePositive, + "Maximum number of spectra contributing to a peak after they are grouped"); + + // Group + const std::string peakValidationGroup = "Peak Validation Settings"; + setPropertyGroup("MinNBinsPerPeak", peakValidationGroup); + setPropertyGroup("MinNSpectraPerPeak", peakValidationGroup); + setPropertyGroup("MaxNSpectraPerPeak", peakValidationGroup); + + declareProperty(std::make_unique>("OutputWorkspace", "", Direction::Output), + "The name of the PeaksWorkspace in which to store the list " + "of peaks found"); + // Create the output peaks workspace m_peaks.reset(new PeaksWorkspace); } @@ -211,6 +228,47 @@ std::map FindSXPeaks::validateInputs() { validationOutput["XResolution"] = "XResolution must be set to a value greater than 0"; } + const int minNSpectraPerPeak = getProperty("MinNSpectraPerPeak"); + const int maxNSpectraPerPeak = getProperty("MaxNSpectraPerPeak"); + if (!isEmpty(minNSpectraPerPeak) && !isEmpty(maxNSpectraPerPeak)) { + if (maxNSpectraPerPeak < minNSpectraPerPeak) { + validationOutput["MaxNSpectraPerPeak"] = "MaxNSpectraPerPeak must be greater than MinNSpectraPerPeak"; + validationOutput["MinNSpectraPerPeak"] = "MinNSpectraPerPeak must be lower than MaxNSpectraPerPeak"; + } + } + + MatrixWorkspace_const_sptr inputWorkspace = getProperty("InputWorkspace"); + if (inputWorkspace) { + const int minWsIndex = getProperty("StartWorkspaceIndex"); + const int maxWsIndex = getProperty("EndWorkspaceIndex"); + size_t numberOfSpectraToConsider = + !isEmpty(minWsIndex) ? (!isEmpty(maxWsIndex) ? (maxWsIndex - minWsIndex + 1) + : (inputWorkspace->getNumberHistograms() - minWsIndex)) + : (!isEmpty(maxWsIndex) ? (maxWsIndex + 1) : (inputWorkspace->getNumberHistograms())); + + if (!isEmpty(minNSpectraPerPeak)) { + if (numberOfSpectraToConsider < minNSpectraPerPeak) { + validationOutput["MinNSpectraPerPeak"] = + "MinNSpectraPerPeak must be less than the number of spectrums considered in InputWorkspace"; + } + } + + if (!isEmpty(maxNSpectraPerPeak)) { + if (numberOfSpectraToConsider < maxNSpectraPerPeak) { + validationOutput["MaxNSpectraPerPeak"] = + "MaxNSpectraPerPeak must be less than the number of spectrums considered in InputWorkspace"; + } + } + + const int minNBinsPerPeak = getProperty("MinNBinsPerPeak"); + if (!isEmpty(minNBinsPerPeak)) { + if (minNBinsPerPeak > inputWorkspace->getMaxNumberBins()) { + validationOutput["MinNBinsPerPeak"] = + "MinNBinsPerPeak must be less than the number of bins in the InputWorkspace"; + } + } + } + return validationOutput; } @@ -248,7 +306,7 @@ void FindSXPeaks::exec() { m_MaxWsIndex = numberOfSpectra - 1; if (m_MaxWsIndex > numberOfSpectra - 1 || m_MaxWsIndex < m_MinWsIndex) { g_log.warning("EndSpectrum out of range! Set to max detector number"); - m_MaxWsIndex = numberOfSpectra; + m_MaxWsIndex = numberOfSpectra - 1; } if (m_MinRange > m_MaxRange) { g_log.warning("Range_upper is less than Range_lower. Will integrate up to " @@ -269,6 +327,11 @@ void FindSXPeaks::exec() { auto peakFindingStrategy = getPeakFindingStrategy(backgroundStrategy.get(), spectrumInfo, m_MinRange, m_MaxRange, xUnit); + const int minNBinsPerPeak = getProperty("MinNBinsPerPeak"); + if (!isEmpty(minNBinsPerPeak)) { + peakFindingStrategy->setMinNBinsPerPeak(minNBinsPerPeak); + } + peakvector entries; entries.reserve(m_MaxWsIndex - m_MinWsIndex); // Count the peaks so that we can resize the peak vector at the end. @@ -318,6 +381,17 @@ void FindSXPeaks::reducePeakList(const peakvector &pcv, Progress &progress) { auto &goniometerMatrix = localworkspace->run().getGoniometer().getR(); auto compareStrategy = getCompareStrategy(); auto reductionStrategy = getReducePeakListStrategy(compareStrategy.get()); + + const int minNSpectraPerPeak = getProperty("MinNSpectraPerPeak"); + if (!isEmpty(minNSpectraPerPeak)) { + reductionStrategy->setMinNSpectraPerPeak(minNSpectraPerPeak); + } + + const int maxNSpectraPerPeak = getProperty("MaxNSpectraPerPeak"); + if (!isEmpty(maxNSpectraPerPeak)) { + reductionStrategy->setMaxNSpectraPerPeak(maxNSpectraPerPeak); + } + auto finalv = reductionStrategy->reduce(pcv, progress); for (auto &finalPeak : finalv) { diff --git a/Framework/Crystal/src/FindSXPeaksHelper.cpp b/Framework/Crystal/src/FindSXPeaksHelper.cpp index 1402f12e8d61..548e7982d2f9 100644 --- a/Framework/Crystal/src/FindSXPeaksHelper.cpp +++ b/Framework/Crystal/src/FindSXPeaksHelper.cpp @@ -201,6 +201,11 @@ Getter for the detector Id. */ detid_t SXPeak::getDetectorId() const { return m_detId; } +/** +Getter for spectrum indexes of a peak +*/ +const std::vector &SXPeak::getPeakSpectras() const { return m_spectra; } + PeakContainer::PeakContainer(const HistogramData::HistogramY &y) : m_y(y), m_startIndex(0), m_stopIndex(m_y.size() - 1), m_maxIndex(0) {} @@ -233,8 +238,10 @@ size_t PeakContainer::getNumberOfPointsInPeak() const { if (m_startIndex >= m_y.size()) { return 0; } - - return m_stopIndex - m_startIndex; + if (m_stopIndex >= m_startIndex) { + return m_stopIndex - m_startIndex + 1; + } + return 0; } yIt PeakContainer::getMaxIterator() const { return m_y.begin() + m_maxIndex; } @@ -296,6 +303,22 @@ PeakList PeakFindingStrategy::findSXPeaks(const HistogramData::HistogramX &x, co return dofindSXPeaks(x, y, e, lowit, highit, workspaceIndex); } +void PeakFindingStrategy::setMinNBinsPerPeak(int minNBinsPerPeak) { m_minNBinsPerPeak = minNBinsPerPeak; } + +void PeakFindingStrategy::filterPeaksForMinBins(std::vector> &inputPeakList) const { + if (m_minNBinsPerPeak == EMPTY_INT() || inputPeakList.empty()) { + return; + } + + for (auto inputIt = inputPeakList.begin(); inputIt != inputPeakList.end();) { + if ((*inputIt)->getNumberOfPointsInPeak() < m_minNBinsPerPeak) { + inputIt = inputPeakList.erase(inputIt); + } else { + ++inputIt; + } + } +} + BoundsIterator PeakFindingStrategy::getBounds(const HistogramData::HistogramX &x) const { // Find the range [min,max] auto lowit = (m_minValue == EMPTY_DBL()) ? x.begin() : std::lower_bound(x.begin(), x.end(), m_minValue); @@ -435,6 +458,9 @@ PeakList AllPeaksStrategy::dofindSXPeaks(const HistogramData::HistogramX &x, con // Get all peaks from the container auto foundPeaks = getAllPeaks(x, y, low, high, m_backgroundStrategy); + // Filter the found peaks having the mininum number of bins + filterPeaksForMinBins(foundPeaks); + // Convert the found peaks to SXPeaks auto peaks = convertToSXPeaks(x, y, foundPeaks, workspaceIndex); @@ -514,6 +540,10 @@ PeakList NSigmaPeaksStrategy::dofindSXPeaks(const HistogramData::HistogramX &x, const HistogramData::HistogramE &e, Bound low, Bound high, const int workspaceIndex) const { auto nsigmaPeaks = getAllNSigmaPeaks(x, y, e, low, high); + + // Filter the found peaks having the mininum number of bins + filterPeaksForMinBins(nsigmaPeaks); + auto sxPeaks = convertToSXPeaks(x, y, nsigmaPeaks, workspaceIndex); return sxPeaks; } @@ -596,6 +626,14 @@ std::vector> NSigmaPeaksStrategy::getAllNSigmaPea ReducePeakListStrategy::ReducePeakListStrategy(const CompareStrategy *compareStrategy) : m_compareStrategy(compareStrategy) {} +void ReducePeakListStrategy::setMinNSpectraPerPeak(int minNSpectraPerPeak) { + m_minNSpectraPerPeak = minNSpectraPerPeak; +} + +void ReducePeakListStrategy::setMaxNSpectraPerPeak(int maxSpectrasForPeak) { + m_maxNSpectraPerPeak = maxSpectrasForPeak; +} + SimpleReduceStrategy::SimpleReduceStrategy(const CompareStrategy *compareStrategy) : ReducePeakListStrategy(compareStrategy) {} @@ -621,9 +659,26 @@ std::vector SimpleReduceStrategy::reduce(const std::vector &peak } } + reducePeaksFromNumberOfSpectras(finalPeaks); + return finalPeaks; } +void SimpleReduceStrategy::reducePeaksFromNumberOfSpectras(std::vector &inputPeaks) const { + if (m_minNSpectraPerPeak == EMPTY_INT() && m_maxNSpectraPerPeak == EMPTY_INT()) { + return; + } + + for (auto peakIt = inputPeaks.begin(); peakIt != inputPeaks.end();) { + if (((m_minNSpectraPerPeak != EMPTY_INT()) && ((*peakIt).getPeakSpectras().size() < m_minNSpectraPerPeak)) || + ((m_maxNSpectraPerPeak != EMPTY_INT()) && ((*peakIt).getPeakSpectras().size() > m_maxNSpectraPerPeak))) { + peakIt = inputPeaks.erase(peakIt); + } else { + ++peakIt; + } + } +} + FindMaxReduceStrategy::FindMaxReduceStrategy(const CompareStrategy *compareStrategy) : ReducePeakListStrategy(compareStrategy) {} @@ -733,8 +788,17 @@ std::vector FindMaxReduceStrategy::getFinalPeaks(const std::vector m_maxNSpectraPerPeak)) { + continue; + } + SXPeak *maxPeak = nullptr; double maxIntensity = std::numeric_limits::min(); + for (auto *element : group) { if (element->getIntensity() > maxIntensity) { maxIntensity = element->getIntensity(); @@ -748,6 +812,7 @@ std::vector FindMaxReduceStrategy::getFinalPeaks(const std::vector backgroundStrategy, + int minBinWidth = Mantid::EMPTY_INT()) { + // GIVEN + // auto backgroundStrategy = std::make_unique(3.); + auto workspace = WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(2 /*nhist*/, 15 /*nbins*/); + const int workspaceIndex = 1; + auto &mutableY = workspace->mutableY(workspaceIndex); + doAddDoublePeakToData(mutableY); + + const auto &x = workspace->x(workspaceIndex); + const auto &y = workspace->y(workspaceIndex); + const auto &e = workspace->e(workspaceIndex); + const auto &spectrumInfo = workspace->spectrumInfo(); + + // WHEN + auto peakFindingStrategy = std::make_unique(backgroundStrategy.get(), spectrumInfo); + if (minBinWidth != Mantid::EMPTY_INT()) + peakFindingStrategy->setMinNBinsPerPeak(minBinWidth); + return peakFindingStrategy->findSXPeaks(x, y, e, workspaceIndex); + } + + void testWhenFindsAllPeaksWithMinimumBinWidthSpecified() { + auto peaks = runFindAllPeaksWithMinBinWidth(std::make_unique(3.0), 4); + + TSM_ASSERT("There should be only one peak found.", peaks.get().size() == 1); + TSM_ASSERT("The only peak should have a signal value of 7.", peaks.get()[0].getIntensity() == 7.); + } + + void testAllPeaksWithMinimumBinWidthSpecifiedFindsNoPeaks() { + auto peaks = runFindAllPeaksWithMinBinWidth(std::make_unique(3.0), 5); + + ETS_ASSERT_EQUALS(peaks.is_initialized(), false); + } + + void testThatFindAllPeaksNSigmaFindPeaks() { // GIVEN std::vector newYValues = {1.5, 2.0, 10.0, 11.0, 14.0, 9.0, 1.5, 1.5, 1.5, 6.0, 9.0, 19.0, 21.5, 1.5, 1.5}; std::vector newErrorValues = {1.5, 2.0, 2.0, 5.0, 7.0, 1.5, 1.5, 1.5, 1.5, 3.0, 4.0, 3.0, 2.5, 2.5, 1.5}; - auto peaks = AllPeaksNSigma(newYValues, newErrorValues, 3.0); + auto peaks = runAllPeaksNSigma(newYValues, newErrorValues, 3.0); // THEN TSM_ASSERT("There should be two peaks that are found.", peaks.get().size() == 2); @@ -155,27 +189,40 @@ class FindSXPeaksHelperTest : public CxxTest::TestSuite { TSM_ASSERT("The second peak should have a signal value of 21.5", peaks.get()[1].getIntensity() == 21.5); } - void testThatFindAllPeaksNSigmaFindPeaksAtEnd() { + void testThatFindAllPeaksNSigmaFindPeaksWithMinBinWidthRequired() { + // GIVEN + std::vector newYValues = {1.5, 2.0, 10.0, 11.0, 14.0, 11.0, 9.5, 1.5, + 1.5, 6.0, 9.0, 19.0, 21.5, 20.5, 19.5}; + std::vector newErrorValues = {1.5, 2.0, 2.0, 5.0, 7.0, 5.5, 6.5, 1.5, 1.5, 3.0, 4.0, 3.0, 12.5, 7.5, 8.5}; + + auto peaks = runAllPeaksNSigma(newYValues, newErrorValues, 3.0, 4); + + // THEN + TSM_ASSERT("There should be two peaks that are found.", peaks.get().size() == 1); + TSM_ASSERT("The first peak should have a signal value of 14.", peaks.get()[0].getIntensity() == 14.); + } + + void testThatFindAllPeaksNSigmaFindPeaksAtBoundary() { // GIVEN std::vector newYValues = {1.5, 2.0, 10.0, 11.0, 14.0, 9.0, 1.5, 1.5, 1.5, 6.0, 9.0, 19.0, 21.5, 22.5, 23.5}; std::vector newErrorValues = {1.5, 2.0, 5.0, 5.0, 7.0, 1.5, 1.5, 1.5, 1.5, 3.0, 4.0, 3.0, 2.5, 2.5, 1.5}; - auto peaks = AllPeaksNSigma(newYValues, newErrorValues, 3.0); + auto peaks = runAllPeaksNSigma(newYValues, newErrorValues, 3.0); // THEN TSM_ASSERT("There should be two peaks that are found.", peaks.get().size() == 1); TSM_ASSERT("The second peak should have a signal value of 21.5", peaks.get()[0].getIntensity() == 23.5); } - void testThatFindAllPeaksNSigmaFindNoPeaks() { + void testWhenAllPeaksNSigmaFindsNoPeaks() { std::vector newYValues = {1.5, 2.0, 10.0, 11.0, 14.0, 9.0, 1.5, 1.5, 1.5, 6.0, 9.0, 19.0, 21.5, 1.5, 1.5}; std::vector newErrorValues = {1.5, 2.0, 5.0, 5.0, 7.0, 1.5, 1.5, 1.5, 1.5, 3.0, 2.0, 4.0, 6.5, 2.5, 1.5}; - auto peaks = AllPeaksNSigma(newYValues, newErrorValues, 3.0); + auto peaks = runAllPeaksNSigma(newYValues, newErrorValues, 3.0); ETS_ASSERT_EQUALS(peaks.is_initialized(), false); } - PeakList AllPeaksNSigma(const std::vector &newYValues, const std::vector &newEValues, - const double nsigma) { + PeakList runAllPeaksNSigma(const std::vector &newYValues, const std::vector &newEValues, + const double nsigma, int minBinWidth = Mantid::EMPTY_INT()) { // GIVEN auto workspace = WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(2 /*nhist*/, 15 /*nbins*/); const int workspaceIndex = 1; @@ -191,6 +238,10 @@ class FindSXPeaksHelperTest : public CxxTest::TestSuite { // WHEN auto peakFindingStrategy = std::make_unique(spectrumInfo, nsigma); + if (minBinWidth != Mantid::EMPTY_INT()) { + peakFindingStrategy->setMinNBinsPerPeak(minBinWidth); + } + auto peaks = peakFindingStrategy->findSXPeaks(x, y, e, workspaceIndex); return peaks; } diff --git a/Framework/Crystal/test/FindSXPeaksTest.h b/Framework/Crystal/test/FindSXPeaksTest.h index a3fb11f6ee13..b0d7362eae36 100644 --- a/Framework/Crystal/test/FindSXPeaksTest.h +++ b/Framework/Crystal/test/FindSXPeaksTest.h @@ -172,6 +172,56 @@ class FindSXPeaksTest : public CxxTest::TestSuite { TSM_ASSERT_EQUALS("Wrong peak intensity matched on found peak", 60, results[2]); } + void testWhenMinSpectrasNotFound() { + // creates a workspace where all y-values are 2 + Workspace2D_sptr workspace = WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(10, 10); + // Stick three peaks in different histograms. + makeOnePeak(1, 40, 2, workspace); + makeOnePeak(2, 60, 2, workspace); + makeOnePeak(3, 45, 2, workspace); + + auto alg = createFindSXPeaks(workspace); + alg->setProperty("MinNSpectraPerPeak", 2); + alg->execute(); + TSM_ASSERT("FindSXPeak should have been executed.", alg->isExecuted()); + + IPeaksWorkspace_sptr result = std::dynamic_pointer_cast( + Mantid::API::AnalysisDataService::Instance().retrieve("found_peaks")); + TSM_ASSERT_EQUALS("Should have found no peaks!", 0, result->rowCount()); + } + + void testWhenMaxSpectraSpecified() { + // creates a workspace where all y-values are 2 + Workspace2D_sptr workspace = WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(10, 10); + // Stick three peaks in different histograms. + makeOnePeak(1, 40, 2, workspace); + makeOnePeak(2, 60, 2, workspace); + makeOnePeak(3, 45, 2, workspace); + + auto alg = createFindSXPeaks(workspace); + alg->setProperty("maxNSpectraPerPeak", 3); + alg->execute(); + TSM_ASSERT("FindSXPeak should have been executed.", alg->isExecuted()); + + IPeaksWorkspace_sptr result = std::dynamic_pointer_cast( + Mantid::API::AnalysisDataService::Instance().retrieve("found_peaks")); + TSM_ASSERT_EQUALS("Should have found three peaks!", 3, result->rowCount()); + } + + void updateYAndEData(Mantid::HistogramData::HistogramY &y, const std::vector &newYValues, + Mantid::HistogramData::HistogramE &e, const std::vector &newErrorValues) { + + if (y.size() != newYValues.size() || e.size() != newErrorValues.size()) { + throw std::runtime_error("The data sizes don't match. This is a test setup issue. " + "Make sure there is one fake data point per entry in the histogram."); + } + + for (size_t index = 0; index < y.size(); ++index) { + y[index] = newYValues[index]; + e[index] = newErrorValues[index]; + } + } + void testSpectrumWithoutUniqueDetectorsDoesNotThrow() { const int nHist = 10; Workspace2D_sptr workspace = WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(nHist, 10); diff --git a/buildconfig/CMake/CppCheck_Suppressions.txt.in b/buildconfig/CMake/CppCheck_Suppressions.txt.in index 1cb306a4ba2b..bea81fa287b8 100644 --- a/buildconfig/CMake/CppCheck_Suppressions.txt.in +++ b/buildconfig/CMake/CppCheck_Suppressions.txt.in @@ -442,7 +442,7 @@ constVariableReference:${CMAKE_SOURCE_DIR}/Framework/Crystal/src/CentroidPeaks.c unreadVariable:${CMAKE_SOURCE_DIR}/Framework/Crystal/src/GoniometerAnglesFromPhiRotation.cpp:306 passedByValue:${CMAKE_SOURCE_DIR}/Framework/Crystal/src/LoadIsawSpectrum.cpp:190 passedByValue:${CMAKE_SOURCE_DIR}/Framework/Crystal/src/LoadIsawSpectrum.cpp:191 -constVariablePointer:${CMAKE_SOURCE_DIR}/Framework/Crystal/src/FindSXPeaks.cpp:206 +constVariablePointer:${CMAKE_SOURCE_DIR}/Framework/Crystal/src/FindSXPeaks.cpp:223 constVariableReference:${CMAKE_SOURCE_DIR}/Framework/Crystal/src/SCDCalibratePanels2ObjFunc.cpp:286 nullPointerRedundantCheck:${CMAKE_SOURCE_DIR}/Framework/Crystal/src/PredictSatellitePeaks.cpp:95 passedByValue:${CMAKE_SOURCE_DIR}/Framework/Crystal/src/PredictSatellitePeaks.cpp:331 diff --git a/docs/source/release/v6.10.0/Framework/Algorithms/New_features/37107.rst b/docs/source/release/v6.10.0/Framework/Algorithms/New_features/37107.rst new file mode 100644 index 000000000000..52401aecc058 --- /dev/null +++ b/docs/source/release/v6.10.0/Framework/Algorithms/New_features/37107.rst @@ -0,0 +1,3 @@ +- Validation rules added to FindSXPeaks :ref:`FindSXPeaks ` algorithm to remove spurious peaks due to noise by allowing user to provide additional arguements as below +- `MinNBinsPerPeak`, the Minimum number of bins contributing to a peak in an individual spectrum +- `MinNSpectraPerPeak`, `MaxNSpectraPerPeak` Minimum & Maximum number of spectra contributing to a peak after they are grouped \ No newline at end of file