Commit 5ab3a512 authored by Gagik Vardanyan's avatar Gagik Vardanyan
Browse files

adjusted the loader to adapt to real D22B new data

parent 2b27c26d
......@@ -160,9 +160,6 @@ void LoadILLSANS::exec() {
double currentDistance = pos.Z();
moveDetectorDistance(finalDistance - currentDistance, "detector");
// L2 was put at "finalDistance - currentDistance", so we update it to the
// correct value
API::Run &runDetails = m_localWorkspace->mutableRun();
runDetails.addProperty<double>("L2", finalDistance, true);
......@@ -173,30 +170,35 @@ void LoadILLSANS::exec() {
// first we move the central detector
double distance =
firstEntry.getFloat(instrumentPath + "/Detector/det_calc");
firstEntry.getFloat(instrumentPath + "/Detector 2/det2_calc");
moveDetectorDistance(distance, "detector");
API::Run &runDetails = m_localWorkspace->mutableRun();
runDetails.addProperty<double>("L2", distance, true);
double offset =
firstEntry.getFloat(instrumentPath + "/Detector/dtr_actual");
// TODO : check sign on actual data
firstEntry.getFloat(instrumentPath + "/Detector 2/dtr2_actual");
moveDetectorHorizontal(-offset / 1000, "detector"); // mm to meter
// then the right one
distance = firstEntry.getFloat(instrumentPath + "/RightDetector/det_calc");
distance = firstEntry.getFloat(instrumentPath + "/Detector 1/det1_calc");
moveDetectorDistance(distance, "detector_right");
offset = firstEntry.getFloat(instrumentPath + "/RightDetector/dtr_actual");
moveDetectorHorizontal(-offset / 1000, "detector"); // mm to meter
// mm to meter
offset = firstEntry.getFloat(instrumentPath + "/Detector 1/dtr1_actual");
const double initialOffset = getComponentPosition("detector_right").X();
moveDetectorHorizontal(-offset / 1000, "detector_right");
} else {
// D11 and D22
initWorkSpace(firstEntry, instrumentPath);
progress.report("Loading the instrument " + m_instrumentName);
runLoadInstrument();
double distance = m_loadHelper.getDoubleFromNexusPath(
firstEntry, instrumentPath + "/detector/det_calc");
progress.report("Moving detectors");
moveDetectorDistance(distance, "detector");
API::Run &runDetails = m_localWorkspace->mutableRun();
runDetails.addProperty<double>("L2", distance, true);
if (m_instrumentName == "D22") {
double offset = m_loadHelper.getDoubleFromNexusPath(
firstEntry, instrumentPath + "/detector/dtr_actual");
......@@ -211,7 +213,7 @@ void LoadILLSANS::exec() {
progress.report("Setting sample logs");
setFinalProperties(filename);
setProperty("OutputWorkspace", m_localWorkspace);
} // namespace DataHandling
}
/**
* Set member variable with the instrument name
......@@ -356,11 +358,11 @@ void LoadILLSANS::initWorkSpaceD22B(NeXus::NXEntry &firstEntry,
const std::string &instrumentPath) {
g_log.debug("Fetching data...");
NXData data1 = firstEntry.openNXData("data1");
NXInt dataCenter = data1.openIntData();
dataCenter.load();
NXData data2 = firstEntry.openNXData("data2");
NXInt dataSide = data2.openIntData();
NXInt dataCenter = data2.openIntData();
dataCenter.load();
NXData data1 = firstEntry.openNXData("data1");
NXInt dataSide = data1.openIntData();
dataSide.load();
size_t numberOfHistograms =
......@@ -681,8 +683,6 @@ void LoadILLSANS::moveDetectorDistance(double distance,
g_log.debug() << "Moving component '" << componentName
<< "' to Z = " << distance << '\n';
API::Run &runDetails = m_localWorkspace->mutableRun();
runDetails.addProperty<double>("L2", distance, true);
}
/**
......
<?xml version='1.0' encoding='ASCII'?>
<instrument xmlns="http://www.mantidproject.org/IDF/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="D22B" valid-from="2020-12-01 00:00:00" valid-to="2100-01-31 23:59:59" last-modified="2020-12-21 13:51:02.484331" xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd">
<instrument xmlns="http://www.mantidproject.org/IDF/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="D22B" valid-from="2020-12-01 00:00:00" valid-to="2100-01-31 23:59:59" last-modified="2021-01-29 07:34:14.273668" xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd">
<!-- This is the instrument definition file of the D22B Large dynamic range small-angle diffractometer
at the ILL.
Generated file, PLEASE DO NOT EDIT THIS FILE!
......@@ -87,17 +87,13 @@
</idlist>
<!--DETECTOR-->
<component type="detector" idstart="0" idfillbyfirst="y" idstepbyrow="256">
<location x="0.0" y="0.0" z="12.8">
<rot val="180.0" axis-x="0" axis-y="1" axis-z="0"/>
</location>
<location x="0.0" y="0.0" z="12.8"/>
</component>
<type xstart="-0.508" xstep="0.008" xpixels="128" ystart="-0.51" ystep="0.004" ypixels="256" name="detector" is="rectangular_detector" type="pixel"/>
<type xstart="0.508" xstep="-0.008" xpixels="128" ystart="-0.51" ystep="0.004" ypixels="256" name="detector" is="rectangular_detector" type="pixel"/>
<component type="detector_right" idstart="32768" idfillbyfirst="y" idstepbyrow="256">
<location x="0.0" y="0.0" z="12.8">
<rot val="180.0" axis-x="0" axis-y="1" axis-z="0"/>
</location>
<location x="-0.896" y="0.0" z="12.8"/>
</component>
<type xstart="0.508" xstep="0.008" xpixels="96" ystart="-0.51" ystep="0.004" ypixels="256" name="detector_right" is="rectangular_detector" type="pixel"/>
<type xstart="0.38" xstep="-0.008" xpixels="96" ystart="-0.51" ystep="0.004" ypixels="256" name="detector_right" is="rectangular_detector" type="pixel"/>
<!--PIXEL, EACH PIXEL IS A DETECTOR-->
<type name="pixel" is="detector">
<cuboid id="pixel-shape">
......
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