Skip to content

Commit 10fa42a

Browse files
committed
allow peaks in the non-linear regime to be found
1 parent 7e0bd4b commit 10fa42a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

gempy/library/peak_finding.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,9 @@ def find_wavelet_peaks(data, widths=None, mask=None, variance=None, min_snr=1, m
640640
-------
641641
2D array: peak pixels and SNRs (sorted by pixel coordinate)
642642
"""
643-
mask = mask.astype(bool) if mask is not None else np.zeros_like(data, dtype=bool)
643+
# Non-linear peaks are OK but saturated ones are not
644+
mask = ((mask & (DQ.max ^ DQ.saturated)).astype(bool) if mask is not None
645+
else np.zeros_like(data, dtype=bool))
644646

645647
max_width = max(widths)
646648
window_size = 4 * max_width + 1

0 commit comments

Comments
 (0)