Merge pull request #193 from WillPastor/bitwise-fix

Replace deprecated boolean subtraction operator
This commit is contained in:
Will Drevo 2019-05-27 00:13:33 -07:00 committed by GitHub
commit 6fe89c577e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,8 +100,8 @@ def get_2D_peaks(arr2D, plot=False, amp_min=DEFAULT_AMP_MIN):
eroded_background = binary_erosion(background, structure=neighborhood, eroded_background = binary_erosion(background, structure=neighborhood,
border_value=1) border_value=1)
# Boolean mask of arr2D with True at peaks # Boolean mask of arr2D with True at peaks (Fixed deprecated boolean operator by changing '-' to '^')
detected_peaks = local_max - eroded_background detected_peaks = local_max ^ eroded_background
# extract peaks # extract peaks
amps = arr2D[detected_peaks] amps = arr2D[detected_peaks]