Commit 391d3fab authored by Mathieu Tillet's avatar Mathieu Tillet
Browse files

Add loader for D22B

parent dffdb1df
......@@ -60,6 +60,7 @@ private:
void initWorkSpace(NeXus::NXEntry &, const std::string &);
void initWorkSpaceD11B(NeXus::NXEntry &, const std::string &);
void initWorkSpaceD22B(NeXus::NXEntry &, const std::string &);
void initWorkSpaceD33(NeXus::NXEntry &, const std::string &);
void initWorkSpaceD16(NeXus::NXEntry &, const std::string &);
void createEmptyWorkspace(const size_t, const size_t);
......@@ -151,6 +151,12 @@ void LoadILLSANS::exec() {
initWorkSpaceD11B(firstEntry, instrumentPath);"Loading the instrument " + m_instrumentName);
} else if (m_instrumentName == "D22B") {
initWorkSpaceD22B(firstEntry, instrumentPath);"Loading the instrument " + m_instrumentName);
} else {
initWorkSpace(firstEntry, instrumentPath);"Loading the instrument " + m_instrumentName);
......@@ -192,8 +198,9 @@ void LoadILLSANS::setInstrumentName(const NeXus::NXEntry &firstEntry,
const auto inst = std::find(m_supportedInstruments.begin(),
m_supportedInstruments.end(), m_instrumentName);
if (m_instrumentName == "D11" && firstEntry.containsGroup("data1")) {
m_instrumentName = "D11B";
if ((m_instrumentName == "D11" || m_instrumentName == "D22") &&
firstEntry.containsGroup("data1")) {
m_instrumentName += "B";
if (inst == m_supportedInstruments.end()) {
......@@ -313,6 +320,38 @@ void LoadILLSANS::initWorkSpaceD11B(NeXus::NXEntry &firstEntry,
nextIndex = loadDataIntoWorkspaceFromMonitors(firstEntry, nextIndex);
* @brief LoadILLSANS::initWorkSpaceD22B Load D22B data
* @param firstEntry
* @param instrumentPath
void LoadILLSANS::initWorkSpaceD22B(NeXus::NXEntry &firstEntry,
const std::string &instrumentPath) {
g_log.debug("Fetching data...");
NXData data1 = firstEntry.openNXData("data1");
NXInt dataCenter = data1.openIntData();
NXData data2 = firstEntry.openNXData("data2");
NXInt dataSide = data2.openIntData();
size_t numberOfHistograms =
static_cast<size_t>(dataCenter.dim0() * dataCenter.dim1() +
dataSide.dim0() * dataSide.dim1()) +
createEmptyWorkspace(numberOfHistograms, 1);
loadMetaData(firstEntry, instrumentPath);
size_t nextIndex;
nextIndex =
loadDataIntoWorkspaceFromVerticalTubes(dataCenter, m_defaultBinning, 0);
nextIndex = loadDataIntoWorkspaceFromVerticalTubes(dataSide, m_defaultBinning,
nextIndex = loadDataIntoWorkspaceFromMonitors(firstEntry, nextIndex);
* Loads data for D33
<?xml version='1.0' encoding='ASCII'?>
<instrument xmlns="" xmlns:xsi="" name="D22B" valid-from="2020-12-01 00:00:00" valid-to="2100-01-31 23:59:59" last-modified="2020-12-21 17:12:36.684021" xsi:schemaLocation="">
<!-- This is the instrument definition file of the D22B Large dynamic range small-angle diffractometer
at the ILL.
This file was automatically generated by mantidgeometry/ILL/IDF/
> python3 ./ILL/IDF/
z axis defines the direction of the beam
y axis will be the axis used for rotation
coordinate system is right-handed
y axis rotation defined by theta
x axis rotation defined by phi
z axis rotation defined by chi
width x direction, height y direction
8 guide sections of 55 mm x 40 mm
Source-to-sample distances are 1.4 m; 2.0 m; 2.8 m; 4.0 m; 5.6 m; 8.0 m; 11.2 m; 14.4 m; 17.6 m
Variable apertures at 19.1 m
Default sample dimension is 10 mm x 300 mm
Size 1024 mm x 1024 mm
Nominal resolution:
128 x 256
Pixel size 8 x 4 mm2
Low resolution:
128 x 128
Pixel size 8 x 8 mm2
Right detector:
Same orientation of tubes, same size of pixels
Only 96 tubes instead of 128 tubes in the main detector
For more information, please visit
<length unit="metre"/>
<angle unit="degree"/>
<along-beam axis="z"/>
<pointing-up axis="y"/>
<handedness val="right"/>
<default-view view="3D" axis-view="z-"/>
<component type="moderator">
<location x="0.0" y="0.0" z="-2.0"/>
<type name="moderator" is="Source"/>
<!--Sample position-->
<component type="sample_position">
<location x="0.0" y="0.0" z="0.0"/>
<type name="sample_position" is="SamplePos"/>
<component type="monitors" idlist="monitors">
<type name="monitors">
<component type="monitor">
<location z="-16.7" name="monitor1"/>
<location z="-1.2" name="monitor2"/>
<type name="monitor" is="monitor">
<cylinder id="cyl-approx">
<centre-of-bottom-base p="0.0" r="0.0" t="0.0"/>
<axis x="0.0" y="0.0" z="1.0"/>
<radius val="0.01"/>
<height val="0.03"/>
<algebra val="cyl-approx"/>
<!--MONITOR IDs-->
<idlist idname="monitors">
<id val="100000"/>
<id val="100001"/>
<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"/>
<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"/>
<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 name="pixel" is="detector">
<cuboid id="pixel-shape">
<left-front-bottom-point x="-0.004" y="-0.002" z="5e-05"/>
<left-front-top-point x="-0.004" y="0.002" z="5e-05"/>
<left-back-bottom-point x="-0.004" y="-0.002" z="-5e-05"/>
<right-front-bottom-point x="0.004" y="-0.002" z="5e-05"/>
<algebra val="pixel-shape"/>
......@@ -696,6 +696,10 @@
<instrument name="D22B">
<instrument name="D33">
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