Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
5ab3a512
Commit
5ab3a512
authored
Jan 29, 2021
by
Gagik Vardanyan
Browse files
adjusted the loader to adapt to real D22B new data
parent
2b27c26d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Framework/DataHandling/src/LoadILLSANS.cpp
View file @
5ab3a512
...
...
@@ -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
/det
2
_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
+
"/
Right
Detector/det_calc"
);
distance
=
firstEntry
.
getFloat
(
instrumentPath
+
"/Detector
1
/det
1
_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
);
}
/**
...
...
instrument/D22B_Definition.xml
View file @
5ab3a512
<?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=
"202
0-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=
"202
1-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.
50
8"
xstep=
"0.008"
xpixels=
"96"
ystart=
"-0.51"
ystep=
"0.004"
ypixels=
"256"
name=
"detector_right"
is=
"rectangular_detector"
type=
"pixel"
/>
<type
xstart=
"0.
3
8"
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"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment