Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
d2ea8289
Commit
d2ea8289
authored
Feb 26, 2021
by
Gagik Vardanyan
Browse files
amend ill sans loader for the real d11b new data format
parent
253b7127
Changes
3
Hide whitespace changes
Inline
Side-by-side
Framework/DataHandling/src/LoadILLSANS.cpp
View file @
d2ea8289
...
...
@@ -155,7 +155,7 @@ void LoadILLSANS::exec() {
// we move the parent "detector" component, but since it is at (0,0,0), we
// need to find the distance it has to move and move it to this position
double
finalDistance
=
firstEntry
.
getFloat
(
instrumentPath
+
"/
d
etector/det_calc"
)
/
1000.
;
firstEntry
.
getFloat
(
instrumentPath
+
"/
D
etector
1
/det_calc"
);
V3D
pos
=
getComponentPosition
(
"detector_center"
);
double
currentDistance
=
pos
.
Z
();
...
...
@@ -185,7 +185,7 @@ void LoadILLSANS::exec() {
// mm to meter
offset
=
firstEntry
.
getFloat
(
instrumentPath
+
"/Detector 1/dtr1_actual"
);
moveDetectorHorizontal
(
-
offset
/
1000
,
"detector_front"
);
moveDetectorHorizontal
(
-
offset
/
1000
,
"detector_front"
);
// mm to meter
double
angle
=
firstEntry
.
getFloat
(
instrumentPath
+
"/Detector 1/dan1_actual"
);
rotateInstrument
(
-
angle
,
"detector_front"
);
...
...
@@ -324,11 +324,11 @@ void LoadILLSANS::initWorkSpaceD11B(NeXus::NXEntry &firstEntry,
NXInt
dataCenter
=
data1
.
openIntData
();
dataCenter
.
load
();
NXData
data2
=
firstEntry
.
openNXData
(
"data2"
);
NXInt
dataRight
=
data2
.
openIntData
();
dataRight
.
load
();
NXData
data3
=
firstEntry
.
openNXData
(
"data3"
);
NXInt
dataLeft
=
data3
.
openIntData
();
NXInt
dataLeft
=
data2
.
openIntData
();
dataLeft
.
load
();
NXData
data3
=
firstEntry
.
openNXData
(
"data3"
);
NXInt
dataRight
=
data3
.
openIntData
();
dataRight
.
load
();
size_t
numberOfHistograms
=
static_cast
<
size_t
>
(
dataCenter
.
dim0
()
*
dataCenter
.
dim1
()
+
...
...
Framework/DataHandling/test/LoadILLSANSTest.h
View file @
d2ea8289
...
...
@@ -105,7 +105,7 @@ public:
LoadILLSANS
alg
;
alg
.
setChild
(
true
);
alg
.
initialize
();
TS_ASSERT_THROWS_NOTHING
(
alg
.
setPropertyValue
(
"Filename"
,
"0
27194
.nxs"
))
TS_ASSERT_THROWS_NOTHING
(
alg
.
setPropertyValue
(
"Filename"
,
"0
00410
.nxs"
))
TS_ASSERT_THROWS_NOTHING
(
alg
.
setPropertyValue
(
"OutputWorkspace"
,
"__unused_for_child"
))
TS_ASSERT_THROWS_NOTHING
(
alg
.
execute
())
...
...
@@ -120,28 +120,32 @@ public:
TS_ASSERT
(
outputWS
->
isHistogramData
())
TS_ASSERT
(
!
outputWS
->
isDistribution
())
const
auto
&
instrument
=
outputWS
->
getInstrument
();
const
auto
&
run
=
outputWS
->
run
();
TS_ASSERT
(
run
.
hasProperty
(
"Detector 1.det_calc"
));
TS_ASSERT
(
run
.
hasProperty
(
"L2"
));
const
double
detCalc
=
run
.
getPropertyAsSingleValue
(
"Detector 1.det_calc"
);
const
double
l2
=
run
.
getPropertyAsSingleValue
(
"L2"
);
TS_ASSERT_EQUALS
(
detCalc
,
l2
);
const
double
panelOffset
=
0.105
;
IComponent_const_sptr
component
=
instrument
->
getComponentByName
(
"detector_center"
);
V3D
pos
=
component
->
getPos
();
TS_ASSERT_DELTA
(
pos
.
Z
(),
8.9274824298
,
1E-
3
)
TS_ASSERT_DELTA
(
pos
.
Z
(),
l2
,
1E-
5
)
component
=
instrument
->
getComponentByName
(
"detector_left"
);
pos
=
component
->
getPos
();
TS_ASSERT_DELTA
(
pos
.
Z
(),
8.82248
,
1E-5
)
TS_ASSERT_DELTA
(
pos
.
Z
(),
l2
-
panelOffset
,
1E-5
)
component
=
instrument
->
getComponentByName
(
"detector_right"
);
pos
=
component
->
getPos
();
TS_ASSERT_DELTA
(
pos
.
Z
(),
8.82248
,
1E-5
)
TS_ASSERT_DELTA
(
pos
.
Z
(),
l2
-
panelOffset
,
1E-5
)
const
auto
&
xAxis
=
outputWS
->
x
(
0
).
rawData
();
const
auto
&
spec
=
outputWS
->
y
(
3630
).
rawData
();
const
auto
&
err
=
outputWS
->
e
(
3630
).
rawData
();
TS_ASSERT_EQUALS
(
outputWS
->
blocksize
(),
1
);
TS_ASSERT_EQUALS
(
xAxis
.
size
(),
2
)
TS_ASSERT_DELTA
(
xAxis
[
0
],
6.685
,
1E-5
)
TS_ASSERT_DELTA
(
xAxis
[
1
],
7.315
,
1E-5
)
TS_ASSERT_EQUALS
(
spec
[
0
],
246
)
TS_ASSERT_DELTA
(
err
[
0
],
sqrt
(
246
),
1E-5
)
TS_ASSERT_DELTA
(
xAxis
[
0
],
5.73
,
1E-5
)
TS_ASSERT_DELTA
(
xAxis
[
1
],
6.27
,
1E-5
)
const
auto
unit
=
outputWS
->
getAxis
(
0
)
->
unit
()
->
unitID
();
TS_ASSERT_EQUALS
(
unit
,
"Wavelength"
);
checkTimeFormat
(
outputWS
);
...
...
Testing/Data/UnitTest/ILL/D11B/000410.nxs.md5
0 → 100644
View file @
d2ea8289
5fb62f75d0c65124475d7a8127bf5692
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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