27 const std::string
name()
const override {
return "SaveGSASInstrumentFile"; }
29 const std::string
summary()
const override {
30 return "Generate a GSAS instrument file from either a table workspace "
31 "containing profile parameters or a Fullprof's instrument "
32 "resolution file (.irf file). ";
36 int version()
const override {
return (1); }
37 const std::vector<std::string>
seeAlso()
const override {
return {
"LoadGSASInstrumentFile",
"SaveGSS"}; }
39 const std::string
category()
const override {
return "Diffraction\\DataHandling"; }
48 void processProperties();
51 void initConstants(
const std::map<
unsigned int, std::map<std::string, double>> &profmap);
54 std::shared_ptr<ChopperConfiguration>
55 setupInstrumentConstants(
const std::map<
unsigned int, std::map<std::string, double>> &profmap);
58 std::shared_ptr<ChopperConfiguration> setupPG3Constants(
int intfrequency);
60 std::shared_ptr<ChopperConfiguration> setupNOMConstants(
int intfrequency);
64 std::map<
unsigned int, std::map<std::string, double>> &profilemap);
67 void convertToGSAS(
const std::vector<unsigned int> &outputbankids,
const std::string &gsasinstrfilename,
68 const std::map<
unsigned int, std::map<std::string, double>> &bankprofilemap);
71 void buildGSASTabulatedProfile(
const std::map<
unsigned int, std::map<std::string, double>> &bankprofilemap,
75 void writePRMHeader(
const std::vector<unsigned int> &banks,
const std::string &prmfilename);
78 void writePRMSingleBank(
const std::map<
unsigned int, std::map<std::string, double>> &bankprofilemap,
79 unsigned int bankid,
const std::string &prmfilename);
82 double calL2FromDtt1(
double difc,
double L1,
double twotheta);
85 double calTOF(
double n,
double ep,
double eq,
double er,
double tp,
double tq,
double tr,
double dsp);
89 double aaba(
double n,
double ea1,
double ea2,
double ta1,
double ta2,
double dsp);
92 double getValueFromMap(
const std::map<std::string, double> &profilemap,
const std::string &parname);
95 double getProfileParameterValue(
const std::map<std::string, double> &profilemap,
const std::string ¶mname);
98 void loadFullprofResolutionFile(
const std::string &irffilename);
101 double calDspRange(
double dtt1,
double zero,
double tof);
104 double erfc(
double xx);