Skip to content

Commit

Permalink
Refs #10246 fixed DataHandlingTest_LoadVulcanCalFileTest
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsteve committed Oct 2, 2014
1 parent 586bba5 commit eb87541
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
32 changes: 19 additions & 13 deletions Code/Mantid/Framework/DataHandling/src/LoadVulcanCalFile.cpp
Expand Up @@ -15,6 +15,7 @@
#include <sstream>
#include <fstream>

#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/split.hpp>


Expand Down Expand Up @@ -279,6 +280,7 @@ namespace DataHandling
*/
void LoadVulcanCalFile::setupMaskWorkspace()
{

// Skip if bad pixel file is not given
if (m_badPixFilename.size() == 0) return;

Expand All @@ -293,21 +295,24 @@ namespace DataHandling
string line;
while (std::getline(maskss, line))
{
// Get the bad pixel's detector ID. One per line
stringstream liness(line);

try
boost::algorithm::trim(line);
if (!line.empty())
{
int pixelid;
liness >> pixelid;
// Get the bad pixel's detector ID. One per line
stringstream liness(line);
try
{
int pixelid;
liness >> pixelid;

// Set mask
m_maskWS->setValue(pixelid, 1.0);
}
catch (const std::invalid_argument& e)
{
g_log.debug() << "Unable to parse line " << line << ". Error message: " << e.what() << "\n";
continue;
// Set mask
m_maskWS->setValue(pixelid, 1.0);
}
catch (const std::invalid_argument& e)
{
g_log.debug() << "Unable to parse line " << line << ". Error message: " << e.what() << "\n";
continue;
}
}
}
maskss.close();
Expand All @@ -322,6 +327,7 @@ namespace DataHandling
m_maskWS->dataY(i)[0] = 1.0;
msg << "Spectrum " << i << " is masked. DataY = " << m_maskWS->readY(i)[0] << "\n";
}

}
g_log.information(msg.str());

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Kernel/src/Memory.cpp
Expand Up @@ -12,7 +12,7 @@
#ifdef __linux__
#include <unistd.h>
#include <fstream>
#include<malloc.h>
#include <malloc.h>
#endif
#ifdef __APPLE__
#include <malloc/malloc.h>
Expand Down

0 comments on commit eb87541

Please sign in to comment.