Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Whitfield, Ross
wand
Commits
631038a0
Commit
631038a0
authored
Aug 03, 2020
by
Whitfield, Ross
Browse files
Update wand2_texture.py
parent
0a227d7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
wand2_texture.py
0 → 100644
View file @
631038a0
# import mantid algorithms, numpy and matplotlib
from
mantid.simpleapi
import
*
import
matplotlib.pyplot
as
plt
import
numpy
as
np
runs
=
[
225078
,
225095
]
vanadium
=
368221
start
=-
6
end
=
6
step
=
2
van
=
LoadWAND
(
'HB2C{}'
.
format
(
vanadium
))
for
run
in
runs
:
ws
=
LoadWAND
(
'HB2C{}'
.
format
(
run
),
OutputWorkspace
=
'HB2C_{}'
.
format
(
run
))
di
=
ws
.
detectorInfo
()
azimuthal
=
np
.
array
([
di
.
azimuthal
(
n
)
for
n
in
range
(
di
.
size
())])
ws_list
=
[]
for
phi_start
in
range
(
start
,
end
,
step
):
mask
=
np
.
where
(
np
.
logical_or
(
azimuthal
<
np
.
deg2rad
(
phi_start
),
azimuthal
>
np
.
deg2rad
(
phi_start
+
step
)))[
0
]
ws_name
=
'{}_from_{}_to_{}'
.
format
(
ws
,
phi_start
,
phi_start
+
step
)
ws_list
.
append
(
ws_name
)
CloneWorkspace
(
ws
,
OutputWorkspace
=
ws_name
)
MaskDetectors
(
ws_name
,
DetectorList
=
mask
)
ws_group
=
GroupWorkspaces
(
ws_list
,
OutputWorkspace
=
'{}_group'
.
format
(
ws
))
ws_powder
=
WANDPowderReduction
(
ws_group
,
CalibrationWorkspace
=
van
,
Target
=
'Theta'
,
NumberBins
=
1000
,
OutputWorkspace
=
'{}_powder'
.
format
(
ws
))
for
w
in
ws_powder
:
SaveFocusedXYE
(
w
,
SplitFiles
=
False
,
IncludeHeader
=
False
,
Filename
=
'{}.xye'
.
format
(
w
))
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