[workaround] using explicit Exception definition without a special handling does not make sense. Function broke on other errors in polyfit. Still might need fixes in the two lines above the "except" block(s).
This commit is contained in:
parent
486e3dc9c3
commit
a823eb2440
@ -336,7 +336,7 @@ class AICPicker(AutoPicker):
|
|||||||
self.slope = 1 / (len(dataslope) * self.Data[0].stats.delta) * (datafit[-1] - datafit[0])
|
self.slope = 1 / (len(dataslope) * self.Data[0].stats.delta) * (datafit[-1] - datafit[0])
|
||||||
# normalize slope to maximum of cf to make it unit independent
|
# normalize slope to maximum of cf to make it unit independent
|
||||||
self.slope /= aicsmooth[iaicmax]
|
self.slope /= aicsmooth[iaicmax]
|
||||||
except ValueError as e:
|
except Exception as e:
|
||||||
print("AICPicker: Problems with data fitting! {}".format(e))
|
print("AICPicker: Problems with data fitting! {}".format(e))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -275,7 +275,7 @@ def fmpicker(Xraw, Xfilt, pickwin, Pick, iplot=0, fig=None, linecolor='k'):
|
|||||||
try:
|
try:
|
||||||
P1 = np.polyfit(xslope1, xraw[islope1], 1)
|
P1 = np.polyfit(xslope1, xraw[islope1], 1)
|
||||||
datafit1 = np.polyval(P1, xslope1)
|
datafit1 = np.polyval(P1, xslope1)
|
||||||
except ValueError as e:
|
except Exception as e:
|
||||||
print("fmpicker: Problems with data fit! {}".format(e))
|
print("fmpicker: Problems with data fit! {}".format(e))
|
||||||
print("Skip first motion determination!")
|
print("Skip first motion determination!")
|
||||||
return FM
|
return FM
|
||||||
@ -321,7 +321,7 @@ def fmpicker(Xraw, Xfilt, pickwin, Pick, iplot=0, fig=None, linecolor='k'):
|
|||||||
try:
|
try:
|
||||||
P2 = np.polyfit(xslope2, xfilt[islope2], 1)
|
P2 = np.polyfit(xslope2, xfilt[islope2], 1)
|
||||||
datafit2 = np.polyval(P2, xslope2)
|
datafit2 = np.polyval(P2, xslope2)
|
||||||
except ValueError as e:
|
except Exception as e:
|
||||||
emsg = 'fmpicker: polyfit failed: {}'.format(e)
|
emsg = 'fmpicker: polyfit failed: {}'.format(e)
|
||||||
print(emsg)
|
print(emsg)
|
||||||
return FM
|
return FM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user