From 085670502414248550420463bf5f538ddeb7f209 Mon Sep 17 00:00:00 2001 From: JakHolzer <53743814+JakHolzer@users.noreply.github.com> Date: Fri, 30 Oct 2020 11:30:37 +0100 Subject: [PATCH] Update ccl_findpeaks.py Added one more parameter "variable", so we can use the function also for other scans than omega, will be necessary in param study and should not influence the ccl integration hopefully. --- pyzebra/ccl_findpeaks.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyzebra/ccl_findpeaks.py b/pyzebra/ccl_findpeaks.py index 6e7d898..aecb85d 100644 --- a/pyzebra/ccl_findpeaks.py +++ b/pyzebra/ccl_findpeaks.py @@ -5,7 +5,13 @@ from scipy.signal import savgol_filter def ccl_findpeaks( - scan, int_threshold=0.8, prominence=50, smooth=False, window_size=7, poly_order=3 + scan, + int_threshold=0.8, + prominence=50, + smooth=False, + window_size=7, + poly_order=3, + variable="om", ): """function iterates through the dictionary created by load_cclv2 and locates peaks for each scan @@ -54,7 +60,7 @@ def ccl_findpeaks( prominence = 50 print("Invalid value for prominence, select positive number, new value set to:", prominence) - omega = scan["om"] + omega = scan[variable] counts = np.array(scan["Counts"]) if smooth: itp = interp1d(omega, counts, kind="linear")