def free_sub_xray_lines_weight(self, xray_lines='all', bound=0.01): """ Free the weight of a sub X-ray lines Remove the twin on the height of sub-Xray lines (non alpha) Parameters ---------- xray_lines: list of str or 'all' The Xray lines. If 'all', fit all lines bounds: float Bound the height of the peak to a fraction of its height """ def free_twin(component): component.A.twin = None component.A.free = True if component.A.value - bound * component.A.value <= 0: component.A.bmin = 1e-10 else: component.A.bmin = component.A.value - \ bound * component.A.value component.A.bmax = component.A.value + \ bound * component.A.value component.A.ext_force_positive = True xray_families = [ utils_eds._get_xray_lines_family(line) for line in xray_lines] for component in self: if component.isbackground is False: if xray_lines == 'all': free_twin(component) elif utils_eds._get_xray_lines_family( component.name) in xray_families: free_twin(component)