Commit 9e95288d authored by Gagik Vardanyan's avatar Gagik Vardanyan Committed by mantid-builder
Browse files

add a wrapper detector to D22B, remove from facilities.xml

parent 4b59758f
......@@ -28,7 +28,8 @@
#include <Poco/Path.h>
#include <cmath>
#include <limits>
#include <numeric> // std::accumulate
#include <numeric>
#include <boost/algorithm/string/predicate.hpp>
namespace Mantid {
namespace DataHandling {
......@@ -171,24 +172,24 @@ void LoadILLSANS::exec() {
// first we move the central detector
double distance =
firstEntry.getFloat(instrumentPath + "/Detector 2/det2_calc");
moveDetectorDistance(distance, "detector");
moveDetectorDistance(distance, "detector_back");
API::Run &runDetails = m_localWorkspace->mutableRun();
runDetails.addProperty<double>("L2", distance, true);
double offset =
firstEntry.getFloat(instrumentPath + "/Detector 2/dtr2_actual");
moveDetectorHorizontal(-offset / 1000, "detector"); // mm to meter
moveDetectorHorizontal(-offset / 1000, "detector_back"); // mm to meter
// then the right one
distance = firstEntry.getFloat(instrumentPath + "/Detector 1/det1_calc");
moveDetectorDistance(distance, "detector_right");
moveDetectorDistance(distance, "detector_front");
// mm to meter
offset = firstEntry.getFloat(instrumentPath + "/Detector 1/dtr1_actual");
moveDetectorHorizontal(-offset / 1000, "detector_right");
moveDetectorHorizontal(-offset / 1000, "detector_front");
double angle =
firstEntry.getFloat(instrumentPath + "/Detector 1/dan1_actual");
rotateInstrument(-angle, "detector_right");
rotateInstrument(-angle, "detector_front");
} else {
// D11 and D22
......@@ -619,6 +620,7 @@ LoadILLSANS::getInstrumentFilePath(const std::string &instName) const {
return fullPath.toString();
}
/**
* Loads the instrument from the IDF
*/
......@@ -626,8 +628,10 @@ void LoadILLSANS::runLoadInstrument() {
IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrument");
if (m_resMode == "nominal") {
loadInst->setPropertyValue("InstrumentName", m_instrumentName);
loadInst->setPropertyValue("Filename",
getInstrumentFilePath(m_instrumentName));
} else if (m_resMode == "low") {
// low resolution mode we have only defined for the old D11 and D22
loadInst->setPropertyValue("Filename",
getInstrumentFilePath(m_instrumentName + "lr"));
}
......
......@@ -204,7 +204,8 @@ public:
const auto &instrument = outputWS->getInstrument();
const auto &run = outputWS->run();
IComponent_const_sptr comp = instrument->getComponentByName("detector");
IComponent_const_sptr comp =
instrument->getComponentByName("detector_back");
V3D pos = comp->getPos();
TS_ASSERT(run.hasProperty("Detector 2.det2_calc"))
double det2_calc = run.getLogAsSingleValue("Detector 2.det2_calc");
......@@ -216,7 +217,7 @@ public:
double l2 = run.getLogAsSingleValue("L2");
TS_ASSERT_DELTA(l2, det2_calc, 1E-6)
comp = instrument->getComponentByName("detector_right");
comp = instrument->getComponentByName("detector_front");
pos = comp->getPos();
TS_ASSERT(run.hasProperty("Detector 1.det1_calc"))
double det1_calc = run.getLogAsSingleValue("Detector 1.det1_calc");
......
......@@ -181,12 +181,9 @@ class SANSILLIntegration(PythonAlgorithm):
XMax=self._lambda_range[1])
self._input_ws = cut_input_ws
# re-calculate the Q-range after lambda cut
CalculateDynamicRange(Workspace=self._input_ws,
ComponentNames=['back_detector',
'front_detector_right',
'front_detector_left',
'front_detector_top',
'front_detector_bottom'])
# TOF is only D33 which has panels
panel_names = mtd[self._input_ws].getInstrument().getStringParameter('detector_panels')[0].split(',')
CalculateDynamicRange(Workspace=self._input_ws, ComponentNames=panel_names)
self._integrate(self._input_ws, self._output_ws)
self.setProperty('OutputWorkspace', self._output_ws)
panels_out_ws = self.getPropertyValue('PanelOutputWorkspaces')
......
<?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="D11B" valid-from="2020-12-01 00:00:00" valid-to="2100-01-31 23:59:59" last-modified="2020-12-18 13:20:29.148515" 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="D11B" valid-from="2020-12-01 00:00:00" valid-to="2100-01-31 23:59:59" last-modified="2021-02-05 11:11:33.671604" 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 D11B SANS instrument at the ILL.
Generated file, PLEASE DO NOT EDIT THIS FILE!
This file was automatically generated by mantidgeometry/ILL/IDF/d11b_generateIDF.py
......
<?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="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">
<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-02-05 11:11:38.500792" 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!
......@@ -86,14 +86,19 @@
<id val="100001"/>
</idlist>
<!--DETECTOR-->
<component type="detector" idstart="0" idfillbyfirst="y" idstepbyrow="256">
<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"/>
<component type="detector_right" idstart="32768" idfillbyfirst="y" idstepbyrow="256">
<location x="-0.896" y="0.0" z="12.8"/>
<component type="detector">
<location x="0.0" y="0.0" z="0.0"/>
</component>
<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"/>
<type name="detector">
<component type="detector_back" idstart="0" idfillbyfirst="y" idstepbyrow="256">
<location x="0.0" y="0.0" z="12.8"/>
</component>
<component type="detector_front" idstart="32768" idfillbyfirst="y" idstepbyrow="256">
<location x="-0.896" y="0.0" z="12.8"/>
</component>
</type>
<type xstart="0.508" xstep="-0.008" xpixels="128" ystart="-0.51" ystep="0.004" ypixels="256" name="detector_back" is="rectangular_detector" type="pixel"/>
<type xstart="0.38" xstep="-0.008" xpixels="96" ystart="-0.51" ystep="0.004" ypixels="256" name="detector_front" is="rectangular_detector" type="pixel"/>
<!--PIXEL, EACH PIXEL IS A DETECTOR-->
<type name="pixel" is="detector">
<cuboid id="pixel-shape">
......
......@@ -4,7 +4,7 @@
<component-link name="D22B">
<!-- The name of the panels for separate I(Q) calculations, the names are from the IDF -->
<parameter name="detector_panels" type="string">
<value val="detector,detector_right"/>
<value val="detector_back,detector_front"/>
</parameter>
<!-- Tau coefficient for DeadTimeCorrection, to be applied tube by tube -->
<parameter name="tau" type="number">
......@@ -29,7 +29,7 @@
</parameter>
</component-link>
<!-- These parameters are used in ParallaxCorrection algorithm -->
<component-link name="detector">
<component-link name="detector_back">
<parameter name="parallax" type="string">
<value val="1+0.14*exp(-4*ln(2.)*((t-0.588)/0.414)^2)"/>
</parameter>
......@@ -37,7 +37,7 @@
<value val="y"/>
</parameter>
</component-link>
<component-link name="detector_right">
<component-link name="detector_front">
<parameter name="parallax" type="string">
<value val="1+0.14*exp(-4*ln(2.)*((t-0.588)/0.414)^2)"/>
</parameter>
......
......@@ -684,10 +684,6 @@
<technique>SANS</technique>
</instrument>
<instrument name="D11B">
<technique>SANS</technique>
</instrument>
<instrument name="D16">
<technique>SANS</technique>
</instrument>
......@@ -696,10 +692,6 @@
<technique>SANS</technique>
</instrument>
<instrument name="D22B">
<technique>SANS</technique>
</instrument>
<instrument name="D33">
<technique>SANS</technique>
</instrument>
......
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