Skip to content

Commit

Permalink
Enabled it to support fullprof profile 9. Refs #8096.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Oct 10, 2013
1 parent e0b2f58 commit b65f2fc
Showing 1 changed file with 5 additions and 49 deletions.
54 changes: 5 additions & 49 deletions Code/Mantid/Framework/DataHandling/src/LoadFullprofResolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ Load Fullprof resolution (.irf) file to TableWorkspace(s)

#include <fstream>

/**
CHANGE:
1. Understand profile 9
**/

using namespace Mantid;
using namespace Mantid::API;
using namespace Mantid::DataObjects;
Expand Down Expand Up @@ -313,24 +307,6 @@ namespace DataHandling
}
parammap["CWL"] = cwl;

// TODO - Implement this!
int profilenumber = searchProfile();

switch (profilenumber)
{
case 9:
parseProfile9();
break;

case 10:
parseProfile10();
break;

default:
throw runtime_error("Not implemented for this profile.");
break;
}

double tempdb;
for (int i = startlineindex+1; i <= endlineindex; ++i)
{
Expand All @@ -345,6 +321,7 @@ namespace DataHandling

if (boost::starts_with(line, "TOFRG"))
{
// TOFRG tof-min step tof-max
vector<string> terms;
boost::split(terms, line, boost::is_any_of(" "), boost::token_compress_on);
if (terms.size() != 4)
Expand All @@ -366,12 +343,13 @@ namespace DataHandling
}
else if (boost::starts_with(line, "D2TOF"))
{
// D2TOF Dtt1 Dtt2 Zero
vector<string> terms;
boost::split(terms, line, boost::is_any_of(" "), boost::token_compress_on);
if (terms.size() != 2 && terms.size() != 4)
{
stringstream errmsg;
errmsg << "Line TOFRG has " << terms.size() << " terms. Different from 2/4 terms in definition.";
errmsg << "Line D2TOF has " << terms.size() << " terms. Different from 2/4 terms in definition.";
g_log.error(errmsg.str());
throw runtime_error(errmsg.str());
}
Expand Down Expand Up @@ -400,7 +378,7 @@ namespace DataHandling
if (terms.size() != 3)
{
stringstream errmsg;
errmsg << "Line TOFRG has " << terms.size() << " terms. Different from 4 terms in definition.";
errmsg << "Line ZD2TOF has " << terms.size() << " terms. Different from 4 terms in definition.";
g_log.error(errmsg.str());
throw runtime_error(errmsg.str());
}
Expand Down Expand Up @@ -524,6 +502,7 @@ namespace DataHandling
} // "GAMMA"
else if (boost::starts_with(line, "ALFBE"))
{
// ALFBE alph0 beta0 alph1 beta1
vector<string> terms;
boost::split(terms, line, boost::is_any_of(" "), boost::token_compress_on);
if (terms.size() != 5)
Expand Down Expand Up @@ -726,29 +705,6 @@ namespace DataHandling
return tablews;
}

#if 0
// TODO - Implement this
int LoadFullprofResolution::searchProfile()
{

}

// TODO - Implement this
void LoadFullprofResolution::parseProfile9()
{


}

// TODO - Implement this
void LoadFullprofResolution::parseProfile10()
{



}
#endif

} // namespace DataHandling
} // namespace Mantid

Expand Down

0 comments on commit b65f2fc

Please sign in to comment.