If 'maxv' is modified, then the values of 'area' and 'spectrum' are adjusted accordingly: (1) maximum of spectrum is set equal to 'maxv'; (2) 'area' is scaled proportionally. It is important that only 'maxv' is changed before this function is called.
(self)
| 156 | return current_elements |
| 157 | |
| 158 | def update_peak_ratio(self): |
| 159 | """ |
| 160 | If 'maxv' is modified, then the values of 'area' and 'spectrum' are adjusted accordingly: |
| 161 | (1) maximum of spectrum is set equal to 'maxv'; (2) 'area' is scaled proportionally. |
| 162 | It is important that only 'maxv' is changed before this function is called. |
| 163 | """ |
| 164 | for v in self.element_dict.values(): |
| 165 | max_spectrum = np.max(v.spectrum) |
| 166 | if not math.isclose(max_spectrum, 0.0, abs_tol=1e-20): |
| 167 | factor = v.maxv / max_spectrum |
| 168 | else: |
| 169 | factor = 0.0 |
| 170 | v.spectrum *= factor |
| 171 | v.area *= factor |
| 172 | self.update_norm() |
| 173 | |
| 174 | def turn_on_all(self, option=True): |
| 175 | """ |
no test coverage detected