Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
0cf351cb
Commit
0cf351cb
authored
8 years ago
by
Mathieu Doucet
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow for incident angles with same wavelength
parent
485a1d75
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/PythonInterface/plugins/algorithms/LRDirectBeamSort.py
+19
-9
19 additions, 9 deletions
...rk/PythonInterface/plugins/algorithms/LRDirectBeamSort.py
with
19 additions
and
9 deletions
Framework/PythonInterface/plugins/algorithms/LRDirectBeamSort.py
+
19
−
9
View file @
0cf351cb
...
@@ -22,14 +22,19 @@ class CompareTwoNXSDataForSFcalculator(object):
...
@@ -22,14 +22,19 @@ class CompareTwoNXSDataForSFcalculator(object):
self
.
nexusToCompareWithRun
=
nxsdataToCompareWith
.
getRun
()
self
.
nexusToCompareWithRun
=
nxsdataToCompareWith
.
getRun
()
self
.
nexusToPositionRun
=
nxsdataToPosition
.
getRun
()
self
.
nexusToPositionRun
=
nxsdataToPosition
.
getRun
()
compare
1
=
self
.
compareParameter
(
'
LambdaRequest
'
,
'
descending
'
)
compare
=
self
.
compareParameter
(
'
LambdaRequest
'
,
'
descending
'
)
if
compare
1
!=
0
:
if
compare
!=
0
:
self
.
resultComparison
=
compare
1
self
.
resultComparison
=
compare
return
return
compare2
=
self
.
compareParameter
(
'
vAtt
'
,
'
ascending
'
)
compare
=
self
.
compareParameter
(
'
thi
'
,
'
descending
'
)
if
compare2
!=
0
:
if
compare
!=
0
:
self
.
resultComparison
=
compare2
self
.
resultComparison
=
compare
return
compare
=
self
.
compareParameter
(
'
vAtt
'
,
'
ascending
'
)
if
compare
!=
0
:
self
.
resultComparison
=
compare
return
return
pcharge1
=
self
.
nexusToCompareWithRun
.
getProperty
(
'
gd_prtn_chrg
'
).
value
/
nxsdataToCompareWith
.
getNEvents
()
pcharge1
=
self
.
nexusToCompareWithRun
.
getProperty
(
'
gd_prtn_chrg
'
).
value
/
nxsdataToCompareWith
.
getNEvents
()
...
@@ -145,7 +150,9 @@ class LRDirectBeamSort(PythonAlgorithm):
...
@@ -145,7 +150,9 @@ class LRDirectBeamSort(PythonAlgorithm):
current_group
=
[]
current_group
=
[]
group_wl
=
None
group_wl
=
None
for
r
in
lr_data_sorted
:
for
r
in
lr_data_sorted
:
wl
=
r
.
getRun
().
getProperty
(
'
LambdaRequest
'
).
value
[
0
]
wl_
=
r
.
getRun
().
getProperty
(
'
LambdaRequest
'
).
value
[
0
]
thi
=
r
.
getRun
().
getProperty
(
'
thi
'
).
value
[
0
]
wl
=
"
%g%-5.2g
"
%
(
wl_
,
thi
)
if
not
group_wl
==
wl
:
if
not
group_wl
==
wl
:
# New group
# New group
...
@@ -200,6 +207,8 @@ class LRDirectBeamSort(PythonAlgorithm):
...
@@ -200,6 +207,8 @@ class LRDirectBeamSort(PythonAlgorithm):
low_res
=
[
0
,
number_of_pixels_x
]
low_res
=
[
0
,
number_of_pixels_x
]
att
=
run
.
getRun
().
getProperty
(
'
vAtt
'
).
value
[
0
]
-
1
att
=
run
.
getRun
().
getProperty
(
'
vAtt
'
).
value
[
0
]
-
1
wl
=
run
.
getRun
().
getProperty
(
'
LambdaRequest
'
).
value
[
0
]
thi
=
run
.
getRun
().
getProperty
(
'
thi
'
).
value
[
0
]
direct_beam_runs
.
append
(
run
.
getRunNumber
())
direct_beam_runs
.
append
(
run
.
getRunNumber
())
peak_ranges
.
append
(
int
(
peak
[
0
]))
peak_ranges
.
append
(
int
(
peak
[
0
]))
peak_ranges
.
append
(
int
(
peak
[
1
]))
peak_ranges
.
append
(
int
(
peak
[
1
]))
...
@@ -208,7 +217,8 @@ class LRDirectBeamSort(PythonAlgorithm):
...
@@ -208,7 +217,8 @@ class LRDirectBeamSort(PythonAlgorithm):
bck_ranges
.
append
(
int
(
peak
[
0
])
-
3
)
bck_ranges
.
append
(
int
(
peak
[
0
])
-
3
)
bck_ranges
.
append
(
int
(
peak
[
1
])
+
3
)
bck_ranges
.
append
(
int
(
peak
[
1
])
+
3
)
summary
+=
"
%10s %s %5s,%5s %5s,%5s
\n
"
%
(
run
.
getRunNumber
(),
att
,
peak
[
0
],
peak
[
1
],
low_res
[
0
],
low_res
[
1
])
summary
+=
"
%10s wl=%5s thi=%5s att=%s %5s,%5s %5s,%5s
\n
"
%
\
(
run
.
getRunNumber
(),
wl
,
thi
,
att
,
peak
[
0
],
peak
[
1
],
low_res
[
0
],
low_res
[
1
])
# Determine TOF range from first file
# Determine TOF range from first file
sample
=
g
[
0
].
getInstrument
().
getSample
()
sample
=
g
[
0
].
getInstrument
().
getSample
()
...
@@ -226,7 +236,7 @@ class LRDirectBeamSort(PythonAlgorithm):
...
@@ -226,7 +236,7 @@ class LRDirectBeamSort(PythonAlgorithm):
tof_max
=
source_detector_distance
/
h
*
m
*
(
wl
+
wl_offset
*
60.0
/
chopper_speed
+
1.7
*
60.0
/
chopper_speed
)
*
1e-4
tof_max
=
source_detector_distance
/
h
*
m
*
(
wl
+
wl_offset
*
60.0
/
chopper_speed
+
1.7
*
60.0
/
chopper_speed
)
*
1e-4
tof_range
=
[
tof_min
,
tof_max
]
tof_range
=
[
tof_min
,
tof_max
]
summary
+=
"
TOF: %s
\n\n
"
%
tof_range
summary
+=
"
TOF: %s
\n\n
"
%
tof_range
# Compute the scaling factors
# Compute the scaling factors
logger
.
notice
(
"
Computing scaling factors for %s
"
%
str
(
direct_beam_runs
))
logger
.
notice
(
"
Computing scaling factors for %s
"
%
str
(
direct_beam_runs
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment