Commit 56324f77 authored by Mathieu Tillet's avatar Mathieu Tillet
Browse files

Update test for LoadILLDiffraction

parent ccdbddd8
......@@ -36,6 +36,7 @@ public:
LoadILLDiffractionTest() {
ConfigService::Instance().appendDataSearchSubDir("ILL/D20/");
ConfigService::Instance().appendDataSearchSubDir("ILL/D2B/");
ConfigService::Instance().appendDataSearchSubDir("ILL/D1B/");
}
void setUp() override {
......@@ -480,6 +481,33 @@ public:
TS_ASSERT_EQUALS(type->value(), "DetectorScan");
}
void test_D1B() {
const int NUMBER_OF_TUBES = 1280;
const int NUMBER_OF_MONITORS = 1;
LoadILLDiffraction alg;
alg.setChild(true);
alg.initialize();
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("Filename", "473432.nxs"))
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("2ThetaOffset", "0.0"))
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace", "__"))
TS_ASSERT_THROWS_NOTHING(alg.execute())
TS_ASSERT(alg.isExecuted())
MatrixWorkspace_sptr outputWS = alg.getProperty("OutputWorkspace");
TS_ASSERT(outputWS)
const auto run = outputWS->run();
const auto &detInfo = outputWS->detectorInfo();
TS_ASSERT_EQUALS(outputWS->getNumberHistograms(),
NUMBER_OF_TUBES + NUMBER_OF_MONITORS)
TS_ASSERT(!detInfo.isMonitor({0, 0}))
auto firstTube = detInfo.position({0, 0});
TS_ASSERT_DELTA(firstTube.angle(V3D(0, 0, -1)) * RAD_2_DEG, 0.0, 1e-6)
TS_ASSERT_EQUALS(outputWS->y(13)[0], 1394)
}
private:
const double RAD_2_DEG = 180.0 / M_PI;
std::string m_oldFacility;
......
a759bf5532082779e48ffb634b78c0b6
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