Skip to content

Commit a10a15f

Browse files
authored
Merge pull request #1908 from HEXRD/wppf-amorphous-add-background
Add background intensity to WPPF amorphous plot
2 parents f9824a8 + 942ed9c commit a10a15f

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

hexrdgui/calibration/wppf_options_dialog.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ def __init__(self, parent=None):
8383
# Trigger logic for changing amorphous setting
8484
self.on_include_amorphous_toggled()
8585

86+
# Always default to the first tab
87+
self.ui.tab_widget.setCurrentIndex(0)
88+
8689
self.update_gui()
8790
self.setup_connections()
8891

hexrdgui/calibration/wppf_runner.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,16 @@ def rerender_wppf(self):
8888

8989
amorphous_lineout = []
9090
if obj.amorphous_model is not None:
91+
tth_list = obj.amorphous_model.tth_list
92+
intensity = obj.amorphous_model.amorphous_lineout
93+
if len(background) > 1:
94+
# background[1] is the background intensity.
95+
# We will automatically add the background, if present.
96+
intensity += background[1]
97+
9198
amorphous_lineout = [
92-
obj.amorphous_model.tth_list,
93-
obj.amorphous_model.amorphous_lineout,
99+
tth_list,
100+
intensity,
94101
]
95102

96103
HexrdConfig().wppf_amorphous_lineout = amorphous_lineout

hexrdgui/resources/ui/wppf_options_dialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@
412412
<item row="2" column="1">
413413
<widget class="QCheckBox" name="plot_amorphous">
414414
<property name="toolTip">
415-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Include plot of amorphous model (default: red line) in the lineout.&lt;/p&gt;&lt;p&gt;The style of the amorphous model plot can be edited by clicking &amp;quot;Edit Plot Style&amp;quot;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
415+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Include plot of amorphous model (default: red line) in the lineout. The background is added to the amorphous model automatically.&lt;/p&gt;&lt;p&gt;The style of the amorphous model plot can be edited by clicking &amp;quot;Edit Plot Style&amp;quot;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
416416
</property>
417417
<property name="text">
418418
<string>Plot amorphous model?</string>

0 commit comments

Comments
 (0)