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

Method get_element_line_name_by_id

pyxrf/model/lineplot.py:864–892  ·  view source on GitHub ↗

Retrieves the name of the element emission line from its ID (the number in the list). The lines are numbered starting with 1. If the ID is invalid, the function returns None. Parameters ---------- n_id : int index of the element emission

(self, n_id)

Source from the content-addressed store, hash-verified

862 return True
863
864 def get_element_line_name_by_id(self, n_id):
865 """
866 Retrieves the name of the element emission line from its ID
867 (the number in the list). The lines are numbered starting with 1.
868 If the ID is invalid, the function returns None.
869
870 Parameters
871 ----------
872
873 n_id : int
874 index of the element emission line in the list
875 (often equal to 'self.element_id')
876
877 Returns the line name (str). If the name can not be retrieved, then
878 the function returns None.
879 """
880 if n_id < 1:
881 # Elements are numbered starting with 1. Element #0 does not exist.
882 # (Element #0 means that no element is selected)
883 return None
884
885 # This is the fixed list of element emission line names.
886 # The element with ID==1 is found in total_list[0]
887 total_list = self.param_model.get_user_peak_list()
888 try:
889 ename = total_list[n_id - 1]
890 except Exception:
891 ename = None
892 return ename
893
894 def _vertical_marker_set_inside_range(self, *, e_low=None, e_high=None):
895 """

Callers 5

_fill_elistMethod · 0.95
plot_current_elineMethod · 0.95

Calls 1

get_user_peak_listMethod · 0.80

Tested by

no test coverage detected