Skip to content

Commit

Permalink
Re #11718. Replace infs with nans.
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed May 7, 2015
1 parent b02a1a0 commit 9a5a117
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Code/Mantid/Framework/DataObjects/src/MDHistoWorkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "MantidAPI/IMDIterator.h"
#include <boost/scoped_array.hpp>
#include <boost/make_shared.hpp>
#include <boost/math/special_functions/fpclassify.hpp>

using namespace Mantid::Kernel;
using namespace Mantid::Geometry;
Expand Down Expand Up @@ -600,7 +601,12 @@ void MDHistoWorkspace::getLinePlot(const Mantid::Kernel::VMD &start,
break;
}
// And add the normalized signal/error to the list too
y.push_back(this->getSignalAt(linearIndex) * normalizer);
auto signal = this->getSignalAt(linearIndex) * normalizer;
if (boost::math::isinf(signal)){
// The plotting library (qwt) doesn't like infs.
signal = std::numeric_limits<signal_t>::quiet_NaN();
}
y.push_back(signal);
e.push_back(this->getErrorAt(linearIndex) * normalizer);
// Save the position for next bin
lastPos = pos;
Expand Down

0 comments on commit 9a5a117

Please sign in to comment.