From 1bcb57fb4ff8bda9fcab9be48bceff5f91f5826b Mon Sep 17 00:00:00 2001 From: andreas128 Date: Sat, 23 Sep 2017 19:16:57 +0200 Subject: Change return to shoulderdiff, peak, shoulder --- dpd/src/Measure_Shoulders.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'dpd/src/Measure_Shoulders.py') diff --git a/dpd/src/Measure_Shoulders.py b/dpd/src/Measure_Shoulders.py index 6b1c7fe..7a165c4 100644 --- a/dpd/src/Measure_Shoulders.py +++ b/dpd/src/Measure_Shoulders.py @@ -52,13 +52,13 @@ def calc_shoulder(fft, c): peak = _calc_peak(fft, c)[0] shoulder = _calc_shoulder_hight(fft, c)[0] assert (peak >= shoulder), (peak, shoulder) - return peak - shoulder + return peak, shoulder def shoulder_from_sig_offset(arg): signal, offset, c = arg fft_db = calc_fft_db(signal, offset, c) - shoulder = calc_shoulder(fft_db, c) - return shoulder + peak, shoulder = calc_shoulder(fft_db, c) + return peak-shoulder, peak, shoulder class Measure_Shoulder: @@ -117,14 +117,13 @@ class Measure_Shoulder: ) pool = multiprocessing.Pool(self.c.MS_n_proc) - shoulders = pool.map(shoulder_from_sig_offset, args) - - shoulder = np.mean(shoulders) + res = pool.map(shoulder_from_sig_offset, args) + shoulders_diff, shoulders, peaks = zip(*res) if logging.getLogger().getEffectiveLevel() == logging.DEBUG and self.plot: self._plot(signal) - return shoulder + return np.mean(shoulders_diff), np.mean(shoulders), np.mean(peaks) # The MIT License (MIT) -- cgit v1.2.3