Commit 6157037b authored by Danny Hindson's avatar Danny Hindson Committed by Zhang, Chen
Browse files

Two changes

Turn off caching in the SNSPowderRedux.PG3Analysis system test so the result of
the system test doesn't depend on the previous job that ran on Jenkins
Load the calibration in from a GSAS file in addition to the other instrument
geometry information so any subsequent unit conversions in Mantid work properly
parent 790d4dc6
......@@ -58,9 +58,13 @@ private:
double convertToDouble(std::string inputstring);
/// Create an instrument geometry.
void createInstrumentGeometry(const API::MatrixWorkspace_sptr &workspace, const std::string &instrumentname,
const double &primaryflightpath, const std::vector<int> &detectorids,
const std::vector<double> &totalflightpaths, const std::vector<double> &twothetas);
void createInstrumentGeometry(const API::MatrixWorkspace_sptr &workspace,
const std::string &instrumentname,
const double &primaryflightpath,
const std::vector<int> &detectorids,
const std::vector<double> &totalflightpaths,
const std::vector<double> &twothetas,
const std::vector<double> &difcs);
};
} // namespace DataHandling
} // namespace Mantid
......@@ -438,8 +438,8 @@ API::MatrixWorkspace_sptr LoadGSS::loadGSASFile(const std::string &filename, boo
}
// build instrument geometry
createInstrumentGeometry(outputWorkspace, instrumentname, primaryflightpath, detectorIDs, totalflightpaths,
twothetas);
createInstrumentGeometry(outputWorkspace, instrumentname, primaryflightpath,
detectorIDs, totalflightpaths, twothetas, difcs);
return outputWorkspace;
}
......@@ -467,10 +467,11 @@ double LoadGSS::convertToDouble(std::string inputstring) {
//----------------------------------------------------------------------------------------------
/** Create the instrument geometry with Instrument
*/
void LoadGSS::createInstrumentGeometry(const MatrixWorkspace_sptr &workspace, const std::string &instrumentname,
const double &primaryflightpath, const std::vector<int> &detectorids,
const std::vector<double> &totalflightpaths,
const std::vector<double> &twothetas) {
void LoadGSS::createInstrumentGeometry(
const MatrixWorkspace_sptr &workspace, const std::string &instrumentname,
const double &primaryflightpath, const std::vector<int> &detectorids,
const std::vector<double> &totalflightpaths,
const std::vector<double> &twothetas, const std::vector<double> &difcs) {
// Check Input
if (detectorids.size() != totalflightpaths.size() || totalflightpaths.size() != twothetas.size()) {
g_log.warning("Cannot create geometry, because the numbers of L2 and Polar "
......@@ -533,7 +534,13 @@ void LoadGSS::createInstrumentGeometry(const MatrixWorkspace_sptr &workspace, co
} // ENDFOR (i: spectrum)
workspace->setInstrument(instrument);
}
auto &paramMap = workspace->instrumentParameters();
for (size_t i = 0; i < workspace->getNumberHistograms(); i++) {
auto detector = workspace->getDetector(i);
paramMap.addDouble(detector->getComponentID(), "DIFC", difcs[i]);
}
}
} // namespace DataHandling
} // namespace Mantid
......@@ -96,6 +96,8 @@ public:
TS_ASSERT_DELTA(spectrumInfo.twoTheta(0) * 180. / M_PI, 58.308, 1e-4);
TS_ASSERT_DELTA(spectrumInfo.l2(1), 2.060, 1e-4);
TS_ASSERT_DELTA(spectrumInfo.twoTheta(1) * 180. / M_PI, 154.257, 1e-4);
auto diffConsts = spectrumInfo.diffractometerConstants(1);
TS_ASSERT_DELTA(diffConsts[Kernel::UnitParams::difc], 10398.8, 1e-4);
}
void test_load_gss_ExtendedHeader_gsa() {
......
......@@ -84,7 +84,8 @@ class PG3Analysis(systemtesting.MantidSystemTest):
LowResRef=15000, RemovePromptPulseWidth=50,
Binning=-0.0004, BinInDspace=True, FilterBadPulses=95,
SaveAs="gsas and fullprof and pdfgetn", OutputDirectory=savedir,
FinalDataUnits="dSpacing")
FinalDataUnits="dSpacing",
CleanCache=True)
# load output gsas file and the golden one
LoadGSS(Filename="PG3_4844.gsa", OutputWorkspace="PG3_4844")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment