Skip to content

Commit

Permalink
Merge pull request #106 from rolfverberg/dev_rolf_edd
Browse files Browse the repository at this point in the history
fix: fixed prominence in auto peak finding Ecalib in EDD
  • Loading branch information
rolfverberg authored Feb 28, 2024
2 parents a52c6e1 + 9e545cd commit cccc1ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CHAP/edd/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,8 @@ def calibrate(self, calibration_config, detector, peak_energies,
axs[1].text(
0.98, 0.02,
'Calibrated Values:\n\n'
+ f'Slope:\n {slope:.5f}\n\n'
+ f'Intercept:\n {intercept:.5f} $keV$/channel',
+ f'Slope:\n {slope:.5f} $keV$/channel\n\n'
+ f'Intercept:\n {intercept:.5f} $keV$',
ha='right', va='bottom', ma='left',
transform=axs[1].transAxes,
bbox=dict(boxstyle='round',
Expand Down Expand Up @@ -1295,7 +1295,7 @@ def find_peaks():
yy = y[index_ranges[0][0]:index_ranges[-1][1]]
prominence = 0.01*yy.max()
indices = find_peaks_scipy(yy, prominence=prominence)[0]
while prominence < 0.5 and len(indices) > num_peak:
while prominence < 0.5*yy.max() and len(indices) > num_peak:
prominence *= 2
indices = find_peaks_scipy(yy, prominence=prominence)[0]
if len(indices) < 2:
Expand Down

0 comments on commit cccc1ed

Please sign in to comment.