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

Method _generate_param_keys

pyxrf/model/parameters.py:704–733  ·  view source on GitHub ↗

Returns prefix of the key from `param_new` dictionary based on emission line name If eline is actual emission line (like Ca_K), then the `key_dcenter` and `key_dsigma` point to 'a1' line (Ca_ka1). Function has to be extended if access to specific lines is required. F

(self, eline)

Source from the content-addressed store, hash-verified

702 self.EC.update_peak_ratio()
703
704 def _generate_param_keys(self, eline):
705 """
706 Returns prefix of the key from `param_new` dictionary based on emission line name
707 If eline is actual emission line (like Ca_K), then the `key_dcenter` and `key_dsigma`
708 point to 'a1' line (Ca_ka1). Function has to be extended if access to specific lines is
709 required. Function is primarily intended for use with user-defined peaks.
710 """
711
712 category = self.get_eline_name_category(eline)
713 if category == "pileup":
714 eline = eline.replace("-", "_")
715 key_area = "pileup_" + eline + "_area"
716 key_dcenter = "pileup_" + eline + "delta_center"
717 key_dsigma = "pileup_" + eline + "delta_sigma"
718 elif category == "eline":
719 eline = eline[:-1] + eline[-1].lower()
720 key_area = eline + "a1_area"
721 key_dcenter = eline + "a1_delta_center"
722 key_dsigma = eline + "a1_delta_sigma"
723 elif category == "userpeak":
724 key_area = eline + "_area"
725 key_dcenter = eline + "_delta_center"
726 key_dsigma = eline + "_delta_sigma"
727 elif eline == "compton":
728 key_area = eline + "_amplitude"
729 key_dcenter, key_dsigma = "", ""
730 else:
731 # No key exists (for "background", "escape", "elastic")
732 key_area, key_dcenter, key_dsigma = "", "", ""
733 return {"key_area": key_area, "key_dcenter": key_dcenter, "key_dsigma": key_dsigma}
734
735 def modify_peak_height(self, maxv_new):
736 """

Callers 3

modify_peak_heightMethod · 0.95

Calls 1

Tested by

no test coverage detected