File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -625,11 +625,12 @@ def update_graph(
625625
626626 # If calibrated peak
627627 suffix = " keV" if cal_switch else " "
628+
628629 if cal_switch :
629630 peak_value = round (np .polyval (np .poly1d (coefficients_1 ), peak_index ), 2 )
630631 prefixx = " "
631632 else :
632- prefixx = "bin:"
633+ prefixx = "bin:"
633634
634635 # Adjust for log scale
635636 if log_switch :
@@ -643,6 +644,12 @@ def update_graph(
643644 else :
644645 annotation_text = f"{ prefixx } { peak_value } { suffix } |cts:{ bin_counts } ({ resolution :.1f} %)"
645646
647+ # Show energy per bin
648+ if epb_switch and cal_switch :
649+ # Display the product of energy and counts
650+ formatted_value = f"{ int (peak_value * bin_counts ):,} "
651+ annotation_text = f"{ formatted_value } keV*cts"
652+
646653 # Add annotation
647654 annotations .append (dict (
648655 x = peak_value ,
You can’t perform that action at this time.
0 commit comments