Update peak finding, still buggy

This commit is contained in:
linarphy 2023-05-25 16:57:37 +02:00
parent 216325ebf4
commit 0ef0b9079b
No known key found for this signature in database
GPG key ID: 3D4AAAC3AD16E79C

View file

@ -29,22 +29,20 @@ def get_extremities( signal , peaks ):
it. The same goes for the area at the end.
ONLY TRUE FOR THE CURRENT CALIBRATION (Hg)
"""
peaks_inside , i = [] , 0
peaks_inside , i = [ 0 , 0 ] , 0
argmin = len( signal ) // 2
while len( peaks_inside ) != 1:
if i > 50 or len( signal[ : argmin ] ) == 0:
raise Exception( 'unknown plage, cannot autocalibrate' )
argmin = np.argmin(
signal[ : argmin ]
argmin = np.argmin(
signal[ : argmin ]
)
argmax = np.argmax( signal[ : argmin ] )
peaks_inside = np.where(
np.logical_and(
argmax < peaks,
argmin > peaks,
)
argmax = np.argmax( signal[ : argmin ] )
peaks_inside = np.where(
np.logical_and(
argmax < peaks,
argmin > peaks,
)
)[0]
i += 1
)[0]
if len( peaks_inside ) == 0:
raise Exception( 'unknown plage, cannot autocalibrate' )
first_peak = peaks_inside[0]
"""