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

Method update_userpeak

pyxrf/gui_support/gpc_class.py:1582–1602  ·  view source on GitHub ↗

Update parameters of the user defined peak. Exception may be raised in case of an error. Note, that if energy is changed, FWHM will change to adjust for the variation of peak width. Parameters ---------- eline: str name of the userpeak (e

(self, eline, energy, maxv, fwhm)

Source from the content-addressed store, hash-verified

1580 raise RuntimeError(str(ex))
1581
1582 def update_userpeak(self, eline, energy, maxv, fwhm):
1583 """
1584 Update parameters of the user defined peak. Exception may be raised in
1585 case of an error. Note, that if energy is changed, FWHM will change to
1586 adjust for the variation of peak width.
1587
1588 Parameters
1589 ----------
1590 eline: str
1591 name of the userpeak (e.g. 'Userpeak2')
1592 energy: float
1593 new position of the peak center, keV
1594 maxv: float
1595 new value of the amplitude
1596 fwhm: float
1597 new value of FWHM of the peak.
1598 """
1599 self.select_eline(eline)
1600 self.param_model.modify_userpeak_params(maxv, fwhm, energy)
1601 self.apply_to_fit()
1602 self.fitting_parameters_changed()
1603
1604 def update_eline_peak_height(self, eline, maxv):
1605 self.select_eline(eline)

Callers 1

pb_user_peaks_clickedMethod · 0.80

Calls 4

select_elineMethod · 0.95
apply_to_fitMethod · 0.95

Tested by

no test coverage detected