Update peak finding, still buggy
This commit is contained in:
parent
216325ebf4
commit
0ef0b9079b
1 changed files with 12 additions and 14 deletions
|
@ -29,11 +29,8 @@ def get_extremities( signal , peaks ):
|
||||||
it. The same goes for the area at the end.
|
it. The same goes for the area at the end.
|
||||||
ONLY TRUE FOR THE CURRENT CALIBRATION (Hg)
|
ONLY TRUE FOR THE CURRENT CALIBRATION (Hg)
|
||||||
"""
|
"""
|
||||||
peaks_inside , i = [] , 0
|
peaks_inside , i = [ 0 , 0 ] , 0
|
||||||
argmin = len( signal ) // 2
|
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(
|
argmin = np.argmin(
|
||||||
signal[ : argmin ]
|
signal[ : argmin ]
|
||||||
)
|
)
|
||||||
|
@ -44,7 +41,8 @@ def get_extremities( signal , peaks ):
|
||||||
argmin > peaks,
|
argmin > peaks,
|
||||||
)
|
)
|
||||||
)[0]
|
)[0]
|
||||||
i += 1
|
if len( peaks_inside ) == 0:
|
||||||
|
raise Exception( 'unknown plage, cannot autocalibrate' )
|
||||||
first_peak = peaks_inside[0]
|
first_peak = peaks_inside[0]
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue