Skip to content

Commit 2b5af6f

Browse files
author
Mat Doucet
authored
Merge pull request #143 from neutrons/theta_fix
Fix reported theta
2 parents 7999bbc + 8f492c9 commit 2b5af6f

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

RefRed/calculations/lr_data.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def __init__(
8989
self.S1H = mt_run.getProperty('S1VHeight').value[0]
9090
self.parent.current_ipts = mt_run.getProperty('experiment_identifier').value
9191
self.total_counts = workspace.getNumberEvents()
92+
self.theta_theta_mode = mt_run.getProperty('BL4B:CS:ExpPl:OperatingMode').value[0] == 'Free Liquid'
9293

9394
try:
9495
self.SiW = mt_run.getProperty('SiHWidth').value[0]
@@ -319,12 +320,16 @@ def calculate_lambda_range(self, tof_range=None):
319320

320321
def calculate_theta(self, with_offset=True):
321322
"""
322-
calculate theta
323+
Calculate theta
324+
If we are in free-liquid mode (theta-theta), return the incident angle.
325+
Otherwise, return the sample theta.
323326
"""
324-
tthd_value = self.tthd
325-
thi_value = self.thi
327+
if self.theta_theta_mode:
328+
theta = self.thi
329+
else:
330+
theta = self.ths
326331

327-
theta = math.fabs(tthd_value - thi_value) / 2.0
332+
theta = np.fabs(theta)
328333
if theta < 0.001:
329334
logging.debug("thi and tthd are equal: is this a direct beam?")
330335

RefRed/calculations/update_reduction_table_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def update(self):
1818

1919
q_range = lrdata.q_range
2020
lambda_range = lrdata.lambda_range
21-
incident_angle = lrdata.incident_angle
21+
incident_angle = lrdata.incident_angle / 2.0
2222
const_q = lrdata.const_q
2323

2424
[qmin, qmax] = q_range

RefRed/initialization/gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Gui(object):
1616
"Plotted",
1717
"Data Run #",
1818
"Norm. Run #",
19-
"2\u03b8 (\u00B0)",
19+
"\u03b8 (\u00B0)",
2020
"\u03bbmin (\u00c5)",
2121
"\u03bbmax (\u00c5)",
2222
"Qmin (1/\u00c5)",

0 commit comments

Comments
 (0)