Commit 73555163 authored by Kendrick, Coleman's avatar Kendrick, Coleman Committed by Peterson, Peter
Browse files

Added nan and inf check for signal

parent 58de552d
......@@ -275,7 +275,7 @@ void ConvertHFIRSCDtoMDE::exec() {
for (size_t m = 0; m < azimuthal.size(); m++) {
size_t idx = n * azimuthal.size() + m;
coord_t signal = static_cast<coord_t>(inputWS->getSignalAt(idx));
if (signal > 0.f) {
if (signal > 0.f && std::isfinite(signal)) {
Eigen::Vector3f q_sample = goniometer * q_lab_pre[m];
inserter.insertMDEvent(signal, signal, 0, 0, q_sample.data());
}
......
......@@ -84,8 +84,10 @@ class HB3AFindPeaksTest(unittest.TestCase):
Centering="F",
PeakDistanceThreshold=0.25,
Wavelength=1.008)
self.assertTrue(HasUB(peaks))
self.assertGreater(peaks.getNumberPeaks(), 0)
# Verify UB and peaks were found for each workspace
for ws in peaks:
self.assertTrue(HasUB(ws))
self.assertGreater(ws.getNumberPeaks(), 0)
if __name__ == '__main__':
......
Supports Markdown
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