Skip to content

Commit

Permalink
Called FixGSASInstrumentFile. Refs #7948.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Sep 23, 2013
1 parent cbe1519 commit d7573e9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Code/Mantid/Framework/Algorithms/src/SaveGSASInstrumentFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ There are 2 places in this algorithm that can set the value of <math>L_1</math>
*WIKI*/

#include "MantidAlgorithms/SaveGSASInstrumentFile.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/FileProperty.h"
#include "MantidKernel/ListValidator.h"
#include "MantidKernel/ArrayProperty.h"
Expand Down Expand Up @@ -429,6 +430,24 @@ ChopperConfiguration::ChopperConfiguration(const int freq, const std::string& ba
// Convert to GSAS
convertToGSAS(m_vecBankID2File, m_gsasFileName, bankprofileparammap);

// Fix?
Mantid::API::FrameworkManager::Instance();
IAlgorithm_sptr fit;
try
{
// Fitting the candidate peaks to a Gaussian
fit = createChildAlgorithm("FixGSASInstrumentFile", -1, -1, true);
fit->initialize();
fit->setProperty("InputFilename", m_gsasFileName);
fit->execute();
}
catch (Exception::NotFoundError &)
{
std::string errorstr("FindPeaks algorithm requires the CurveFitting library");
g_log.error(errorstr);
throw std::runtime_error(errorstr);
}

return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "MantidAlgorithms/SaveGSASInstrumentFile.h"
#include "MantidDataObjects/TableWorkspace.h"
#include "MantidAPI/TableRow.h"
#include "MantidAPI/FrameworkManager.h"

#include <fstream>
#include <Poco/File.h>
Expand All @@ -28,6 +29,8 @@ class SaveGSASInstrumentFileTest : public CxxTest::TestSuite

void test_SaveGSSInstrumentFile_1Bank()
{
Mantid::API::FrameworkManager::Instance();

// Load a (local) table workspace
loadProfileTable("PG3ProfileTable");
TableWorkspace_sptr profiletablews = boost::dynamic_pointer_cast<TableWorkspace>(
Expand Down

0 comments on commit d7573e9

Please sign in to comment.