Commit d2ea8289 authored by Gagik Vardanyan's avatar Gagik Vardanyan
Browse files

amend ill sans loader for the real d11b new data format

parent 253b7127
......@@ -155,7 +155,7 @@ void LoadILLSANS::exec() {
// we move the parent "detector" component, but since it is at (0,0,0), we
// need to find the distance it has to move and move it to this position
double finalDistance =
firstEntry.getFloat(instrumentPath + "/detector/det_calc") / 1000.;
firstEntry.getFloat(instrumentPath + "/Detector 1/det_calc");
V3D pos = getComponentPosition("detector_center");
double currentDistance = pos.Z();
......@@ -185,7 +185,7 @@ void LoadILLSANS::exec() {
// mm to meter
offset = firstEntry.getFloat(instrumentPath + "/Detector 1/dtr1_actual");
moveDetectorHorizontal(-offset / 1000, "detector_front");
moveDetectorHorizontal(-offset / 1000, "detector_front"); // mm to meter
double angle =
firstEntry.getFloat(instrumentPath + "/Detector 1/dan1_actual");
rotateInstrument(-angle, "detector_front");
......@@ -324,11 +324,11 @@ void LoadILLSANS::initWorkSpaceD11B(NeXus::NXEntry &firstEntry,
NXInt dataCenter = data1.openIntData();
dataCenter.load();
NXData data2 = firstEntry.openNXData("data2");
NXInt dataRight = data2.openIntData();
dataRight.load();
NXData data3 = firstEntry.openNXData("data3");
NXInt dataLeft = data3.openIntData();
NXInt dataLeft = data2.openIntData();
dataLeft.load();
NXData data3 = firstEntry.openNXData("data3");
NXInt dataRight = data3.openIntData();
dataRight.load();
size_t numberOfHistograms =
static_cast<size_t>(dataCenter.dim0() * dataCenter.dim1() +
......
......@@ -105,7 +105,7 @@ public:
LoadILLSANS alg;
alg.setChild(true);
alg.initialize();
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("Filename", "027194.nxs"))
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("Filename", "000410.nxs"))
TS_ASSERT_THROWS_NOTHING(
alg.setPropertyValue("OutputWorkspace", "__unused_for_child"))
TS_ASSERT_THROWS_NOTHING(alg.execute())
......@@ -120,28 +120,32 @@ public:
TS_ASSERT(outputWS->isHistogramData())
TS_ASSERT(!outputWS->isDistribution())
const auto &instrument = outputWS->getInstrument();
const auto &run = outputWS->run();
TS_ASSERT(run.hasProperty("Detector 1.det_calc"));
TS_ASSERT(run.hasProperty("L2"));
const double detCalc = run.getPropertyAsSingleValue("Detector 1.det_calc");
const double l2 = run.getPropertyAsSingleValue("L2");
TS_ASSERT_EQUALS(detCalc, l2);
const double panelOffset = 0.105;
IComponent_const_sptr component =
instrument->getComponentByName("detector_center");
V3D pos = component->getPos();
TS_ASSERT_DELTA(pos.Z(), 8.9274824298, 1E-3)
TS_ASSERT_DELTA(pos.Z(), l2, 1E-5)
component = instrument->getComponentByName("detector_left");
pos = component->getPos();
TS_ASSERT_DELTA(pos.Z(), 8.82248, 1E-5)
TS_ASSERT_DELTA(pos.Z(), l2 - panelOffset, 1E-5)
component = instrument->getComponentByName("detector_right");
pos = component->getPos();
TS_ASSERT_DELTA(pos.Z(), 8.82248, 1E-5)
TS_ASSERT_DELTA(pos.Z(), l2 - panelOffset, 1E-5)
const auto &xAxis = outputWS->x(0).rawData();
const auto &spec = outputWS->y(3630).rawData();
const auto &err = outputWS->e(3630).rawData();
TS_ASSERT_EQUALS(outputWS->blocksize(), 1);
TS_ASSERT_EQUALS(xAxis.size(), 2)
TS_ASSERT_DELTA(xAxis[0], 6.685, 1E-5)
TS_ASSERT_DELTA(xAxis[1], 7.315, 1E-5)
TS_ASSERT_EQUALS(spec[0], 246)
TS_ASSERT_DELTA(err[0], sqrt(246), 1E-5)
TS_ASSERT_DELTA(xAxis[0], 5.73, 1E-5)
TS_ASSERT_DELTA(xAxis[1], 6.27, 1E-5)
const auto unit = outputWS->getAxis(0)->unit()->unitID();
TS_ASSERT_EQUALS(unit, "Wavelength");
checkTimeFormat(outputWS);
......
5fb62f75d0c65124475d7a8127bf5692
Markdown is supported
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