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

Method update_norm

pyxrf/model/parameters.py:116–137  ·  view source on GitHub ↗

Calculate the normalized intensity for each element peak. Parameters ---------- threshv : float No value is shown when smaller than the threshold value

(self, threshv=0.0)

Source from the content-addressed store, hash-verified

114 self.update_norm()
115
116 def update_norm(self, threshv=0.0):
117 """
118 Calculate the normalized intensity for each element peak.
119
120 Parameters
121 ----------
122 threshv : float
123 No value is shown when smaller than the threshold value
124 """
125 # Do nothing if no elements are selected
126 if not self.element_dict:
127 return
128
129 max_dict = np.max([v.maxv for v in self.element_dict.values()])
130
131 for v in self.element_dict.values():
132 v.norm = v.maxv / max_dict * 100
133 v.lbd_stat = bool(v.norm > threshv)
134
135 # also delete smaller values
136 # there is some bugs in plotting when values < 0.0
137 self.delete_peaks_below_threshold(threshv=threshv)
138
139 def delete_all(self):
140 self.element_dict.clear()

Callers 3

delete_itemMethod · 0.95
add_to_dictMethod · 0.95
update_peak_ratioMethod · 0.95

Calls 2

valuesMethod · 0.80

Tested by

no test coverage detected