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);
progress.report("Loading the instrument " + m_instrumentName);
runLoadInstrument();
} else if (m_instrumentName == "D22B") {
initWorkSpaceD22B(firstEntry, instrumentPath);
progress.report("Loading the instrument " + m_instrumentName);
runLoadInstrument();
} else {
initWorkSpace(firstEntry, instrumentPath);
progress.report("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();
dataCenter.load();
NXData data2 = firstEntry.openNXData("data2");
NXInt dataSide = data2.openIntData();
dataSide.load();
size_t numberOfHistograms =
static_cast<size_t>(dataCenter.dim0() * dataCenter.dim1() +
dataSide.dim0() * dataSide.dim1()) +
N_MONITORS;
createEmptyWorkspace(numberOfHistograms, 1);
loadMetaData(firstEntry, instrumentPath);
size_t nextIndex;
nextIndex =
loadDataIntoWorkspaceFromVerticalTubes(dataCenter, m_defaultBinning, 0);
nextIndex = loadDataIntoWorkspaceFromVerticalTubes(dataSide, m_defaultBinning,
nextIndex);
nextIndex = loadDataIntoWorkspaceFromMonitors(firstEntry, nextIndex);
}
/**
* Loads data for D33
*/
......
<?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 17:12:36.684021" 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!
This file was automatically generated by mantidgeometry/ILL/IDF/d22b_generateIDF.py
> python3 ./ILL/IDF/d22b_generateIDF.py
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
Collimation
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
Sample
Default sample dimension is 10 mm x 300 mm
Multi-detector:
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
https://www.ill.eu/instruments-support/instruments-groups/instruments/d22/characteristics/
-->
<defaults>
<length unit="metre"/>
<angle unit="degree"/>
<reference-frame>
<along-beam axis="z"/>
<pointing-up axis="y"/>
<handedness val="right"/>
</reference-frame>
<default-view view="3D" axis-view="z-"/>
</defaults>
<!--SOURCE-->
<component type="moderator">
<location x="0.0" y="0.0" z="-2.0"/>
</component>
<type name="moderator" is="Source"/>
<!--Sample position-->
<component type="sample_position">
<location x="0.0" y="0.0" z="0.0"/>
</component>
<type name="sample_position" is="SamplePos"/>
<!--MONITORS-->
<component type="monitors" idlist="monitors">
<location/>
</component>
<type name="monitors">
<component type="monitor">
<location z="-16.7" name="monitor1"/>
<location z="-1.2" name="monitor2"/>
</component>
</type>
<!--MONITOR SHAPE-->
<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"/>
</cylinder>
<algebra val="cyl-approx"/>
</type>
<!--MONITOR IDs-->
<idlist idname="monitors">
<id val="100000"/>
<id val="100001"/>
</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>
</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.0" y="0.0" z="12.8">
<rot val="180.0" axis-x="0" axis-y="1" axis-z="0"/>
</location>
</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"/>
<!--PIXEL, EACH PIXEL IS A DETECTOR-->
<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"/>
</cuboid>
<algebra val="pixel-shape"/>
</type>
</instrument>
......@@ -696,6 +696,10 @@
<technique>SANS</technique>
</instrument>
<instrument name="D22B">
<technique>SANS</technique>
</instrument>
<instrument name="D33">
<technique>SANS</technique>
</instrument>
......
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