Commit 5079ebce authored by Peter Jansweijer's avatar Peter Jansweijer

avoid warning "Covariance of the parameters could not be estimated" by changing…

avoid warning "Covariance of the parameters could not be estimated" by changing curve_fit method to 'trf'
parent a711b90e
......@@ -476,7 +476,12 @@ def analyze_plot(insitu_file, analyse_single, x, y, name, tolerance, use_itu_cha
# y[i] = y[i] + 8000
#popt, pcov = curve_fit(line, x, y)
popt, pcov = curve_fit(group_delay, x, y)
# (default) Method = lm = Levenberg-Marquardt algorithm => "Covariance of the parameters could not be estimated"
# Method = trf = Trust Region Reflective algorithm
popt, pcov = curve_fit(group_delay, x, y, method='trf')
perr = numpy.sqrt(numpy.diag(pcov))
print(pcov)
print(perr)
# define the best fit line based on array (still with outliers):
ly=[]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment