11#include "MantidDataHandling/DllConfig.h"
16namespace DataHandling {
18class ChopperConfiguration;
28 const std::string
name()
const override {
return "SaveGSASInstrumentFile"; }
30 const std::string
summary()
const override {
31 return "Generate a GSAS instrument file from either a table workspace "
32 "containing profile parameters or a Fullprof's instrument "
33 "resolution file (.irf file). ";
37 int version()
const override {
return (1); }
38 const std::vector<std::string>
seeAlso()
const override {
return {
"LoadGSASInstrumentFile",
"SaveGSS"}; }
40 const std::string
category()
const override {
return "Diffraction\\DataHandling"; }
49 void processProperties();
52 void initConstants(
const std::map<
unsigned int, std::map<std::string, double>> &profmap);
55 std::shared_ptr<ChopperConfiguration>
56 setupInstrumentConstants(
const std::map<
unsigned int, std::map<std::string, double>> &profmap);
59 std::shared_ptr<ChopperConfiguration> setupPG3Constants(
int intfrequency);
61 std::shared_ptr<ChopperConfiguration> setupNOMConstants(
int intfrequency);
65 std::map<
unsigned int, std::map<std::string, double>> &profilemap);
68 void convertToGSAS(
const std::vector<unsigned int> &outputbankids,
const std::string &gsasinstrfilename,
69 const std::map<
unsigned int, std::map<std::string, double>> &bankprofilemap);
72 void buildGSASTabulatedProfile(
const std::map<
unsigned int, std::map<std::string, double>> &bankprofilemap,
76 void writePRMHeader(
const std::vector<unsigned int> &banks,
const std::string &prmfilename);
79 void writePRMSingleBank(
const std::map<
unsigned int, std::map<std::string, double>> &bankprofilemap,
80 unsigned int bankid,
const std::string &prmfilename);
83 double calL2FromDtt1(
double difc,
double L1,
double twotheta);
86 double calTOF(
double n,
double ep,
double eq,
double er,
double tp,
double tq,
double tr,
double dsp);
90 double aaba(
double n,
double ea1,
double ea2,
double ta1,
double ta2,
double dsp);
93 double getValueFromMap(
const std::map<std::string, double> &profilemap,
const std::string &parname);
96 double getProfileParameterValue(
const std::map<std::string, double> &profilemap,
const std::string ¶mname);
99 void loadFullprofResolutionFile(
const std::string &irffilename);
102 double calDspRange(
double dtt1,
double zero,
double tof);
105 double erfc(
double xx);
static std::unique_ptr< QThreadPool > tp
Base class from which all concrete algorithm classes should be derived.
SaveGSASInstrumentFile : Convert Fullprof"s instrument resolution file (.irf) to GSAS"s instrument f...
API::ITableWorkspace_sptr m_inpWS
Input workspace.
std::string m_sample
Sample.
int m_frequency
Frequency.
std::vector< double > m_gbeta
std::map< unsigned int, std::map< std::string, double > > m_profileMap
Profile parameter map.
std::string m_gsasFileName
Output file name.
std::shared_ptr< ChopperConfiguration > m_configuration
Chopper configuration.
const std::string summary() const override
Summary of algorithms purpose.
int version() const override
Algorithm's version.
std::map< unsigned int, double > m_bank_mndsp
std::vector< double > m_gdsp
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
std::map< unsigned int, double > m_bank_mxtof
const std::string name() const override
Algorithm's name.
std::vector< unsigned int > m_vecBankID2File
Banks IDs to process.
std::vector< double > m_galpha
const std::string category() const override
Algorithm's category for identification.
std::string m_id_line
User input ID line.
std::string m_instrument
Instrument.
std::vector< double > m_gdt
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
Helper class which provides the Collimation Length for SANS instruments.