Skip to content

Commit

Permalink
Refs #3686 mask pixels with no counts
Browse files Browse the repository at this point in the history
  • Loading branch information
VickieLynch committed Jan 6, 2012
1 parent 92b7e41 commit d50356f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/GetDetectorOffsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,20 @@ namespace Mantid
for (int wi=0;wi<nspec;++wi)
{
PARALLEL_START_INTERUPT_REGION
// Fit the peak
double offset=fitSpectra(wi);
double offset = 0.0;
const int YLength = static_cast<int>(inputW->readY(wi).size());
const MantidVec& Y = inputW->readY(wi);
double sumY = 0.0;
for (int i = 0; i < YLength; i++) sumY += Y[i];
if (sumY < 1.e-30)
{
offset=1000.;
}
else
{
// Fit the peak
offset=fitSpectra(wi);
}
double mask=1.0;
if (std::abs(offset) > maxOffset)
{
Expand Down

0 comments on commit d50356f

Please sign in to comment.