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
Whitfield, Ross
wand
Commits
2b4f2115
Commit
2b4f2115
authored
Oct 24, 2018
by
Whitfield, Ross
Browse files
Update omega_scan/omega_scan_integration.py
parent
571d32fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
omega_scan/omega_scan_integration.py
View file @
2b4f2115
...
@@ -21,3 +21,23 @@ for p in range(peaks.getNumberPeaks()):
...
@@ -21,3 +21,23 @@ for p in range(peaks.getNumberPeaks()):
lines
=
np
.
array
(
lines
)
lines
=
np
.
array
(
lines
)
output
=
CreateWorkspace
(
DataY
=
lines
,
DataX
=
range
(
len
(
lines
[
0
])),
NSpec
=
len
(
lines
))
output
=
CreateWorkspace
(
DataY
=
lines
,
DataX
=
range
(
len
(
lines
[
0
])),
NSpec
=
len
(
lines
))
s1
=
np
.
array
(
mtd
[
'NaCl'
].
getExperimentInfo
(
0
).
run
().
getProperty
(
's1'
).
value
)
# FitPeak
for
p
in
range
(
peaks
.
getNumberPeaks
()):
peak
=
peaks
.
getPeak
(
p
)
g
=
peak
.
getGoniometerMatrix
()
s1_index
=
np
.
searchsorted
(
s1
,
np
.
mod
(
np
.
arctan
(
g
[
0
,
2
]
/
g
[
0
,
0
])
*
180
/
np
.
pi
,
-
180
))
FitPeak
(
InputWorkspace
=
output
,
OutputWorkspace
=
'peak_{}'
.
format
(
p
),
ParameterTableWorkspace
=
'param_{}'
.
format
(
p
),
WorkspaceIndex
=
p
,
PeakFunctionType
=
'Gaussian (Height, PeakCentre, Sigma)'
,
PeakParameterValues
=
'30000,{},10'
.
format
(
s1_index
),
BackgroundType
=
'Flat (A0)'
,
BackgroundParameterValues
=
'200'
,
FitWindow
=
'{},{}'
.
format
(
s1_index
-
20
,
s1_index
+
20
),
PeakRange
=
'{},{}'
.
format
(
s1_index
-
10
,
s1_index
+
10
))
height
=
mtd
[
'param_{}'
.
format
(
p
)].
cell
(
2
,
1
)
sigma
=
mtd
[
'param_{}'
.
format
(
p
)].
cell
(
3
,
1
)
peak
.
setIntensity
(
height
*
sigma
*
np
.
sqrt
(
2
*
np
.
pi
))
\ No newline at end of file
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