MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / plot_current_eline

Method plot_current_eline

pyxrf/model/lineplot.py:1027–1061  ·  view source on GitHub ↗

Plots emission lines for the selected peak based on 'self.element_id` and provided `eline`.

(self, eline=None)

Source from the content-addressed store, hash-verified

1025 self.plot_current_eline()
1026
1027 def plot_current_eline(self, eline=None):
1028 """
1029 Plots emission lines for the selected peak based on 'self.element_id` and provided `eline`.
1030 """
1031 if eline is None:
1032 eline = self.param_model.e_name
1033
1034 incident_energy = self.incident_energy
1035
1036 # Name of the emission line (if emission line is selected)
1037 ename = self.get_element_line_name_by_id(self.element_id)
1038 # Check if pileup peak is selected
1039 is_pileup = self.param_model.get_eline_name_category(eline) == "pileup"
1040
1041 if (ename is not None) or is_pileup:
1042 logger.debug(
1043 "Plot emission line for element: "
1044 "{} with incident energy {}".format(self.element_id, incident_energy)
1045 )
1046
1047 if ename is not None:
1048 self.elist = self._fill_elist()
1049 elif is_pileup:
1050 self.elist = self._fill_elist_pileup(eline)
1051 else:
1052 self.elist = [] # Just in case
1053 self.plot_emission_line()
1054 self._update_canvas()
1055
1056 # Do it the second time, since the 'self.elist' has changed
1057 self.compute_manual_peak_intensity(n_id=self.element_id)
1058
1059 else:
1060 self._reset_eline_plot()
1061 logger.debug(f"Selected emission line with ID #{self.element_id} is not in the list.")
1062
1063 @observe("det_materials")
1064 def _update_det_materials(self, change):

Callers 2

set_elementMethod · 0.95
set_selected_elineMethod · 0.80

Calls 8

_fill_elistMethod · 0.95
_fill_elist_pileupMethod · 0.95
plot_emission_lineMethod · 0.95
_update_canvasMethod · 0.95
_reset_eline_plotMethod · 0.95

Tested by

no test coverage detected