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

Method compute_manual_peak_intensity

pyxrf/model/lineplot.py:1203–1229  ·  view source on GitHub ↗
(self, n_id=None)

Source from the content-addressed store, hash-verified

1201 return intensity
1202
1203 def compute_manual_peak_intensity(self, n_id=None):
1204 if n_id is None:
1205 n_id = self.element_id
1206
1207 # Check if the emission line is in the list of supported emission lines (e.g. Ca_K)
1208 if not self.is_element_line_id_valid(n_id):
1209 # This is not a supported emission line (n_id==0)
1210 # This means we are probably dealing with user defined peak.
1211 if self.is_line_in_selected_list(n_id):
1212 # Display intensity if the peak is in the list.
1213 name = self.get_element_line_name_by_id(n_id)
1214 intensity = self.param_model.EC.element_dict[name].maxv
1215 else:
1216 elist = self._fill_elist_userpeak()
1217 intensity = self._compute_intensity(elist)
1218 else:
1219 if self.is_line_in_selected_list(n_id):
1220 # Display intensity if the peak is in the list.
1221 name = self.get_element_line_name_by_id(n_id)
1222 intensity = self.param_model.EC.element_dict[name].maxv
1223 else:
1224 # This is a new peak
1225 elist = self._fill_elist()
1226 intensity = self._compute_intensity(elist)
1227
1228 # Round the intensity for nicer printing
1229 self.param_model.add_element_intensity = round(intensity, 2)
1230
1231 def plot_fit(self, fit_x, fit_y, fit_all, residual=None):
1232 """

Callers 7

set_elementMethod · 0.95
plot_current_elineMethod · 0.95
apply_to_fitMethod · 0.80

Calls 6

_fill_elist_userpeakMethod · 0.95
_compute_intensityMethod · 0.95
_fill_elistMethod · 0.95

Tested by

no test coverage detected