Skip to content

Commit

Permalink
insert_*: use maxfev=10000
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Oct 23, 2024
1 parent 89c8682 commit 958f6cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benchmarks/insert_muon/analysis/muon_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def Landau(x, normalization,location,stdev):
p0=[100, .5, .05]
#print(list(y), list(x))
coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0,
sigma=list(np.sqrt(y[slc])+(y[slc]==0)))
sigma=list(np.sqrt(y[slc])+(y[slc]==0)), maxfev=10000)
print(coeff)
xx=np.linspace(0,.7, 100)
MIP=coeff[1]/1000
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/insert_neutron/analysis/neutron_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def gauss(x, A,mu, sigma):
fnc=gauss
sigma=np.sqrt(y[slc])+(y[slc]==0)
p0=(100, 0, 5)
coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0,sigma=list(sigma))
coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
xx=np.linspace(-5,5,100)
plt.plot(xx,fnc(xx,*coeff))
# except:
Expand All @@ -104,7 +104,7 @@ def gauss(x, A,mu, sigma):
#print(bc[slc],y[slc])
sigma=np.sqrt(y[slc])+(y[slc]==0)
try:
coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0,sigma=list(sigma))
coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
sigmas.append(np.abs(coeff[2]))
dsigmas.append(np.sqrt(var_matrix[2][2]))
xvals.append(p)
Expand Down Expand Up @@ -151,7 +151,7 @@ def gauss(x, A,mu, sigma):
sigma=np.sqrt(y[slc])+0.5*(y[slc]==0)
p0=(100, np.mean(r), np.std(r))
try:
coeff, var_matrix = curve_fit(fnc, list(bcs[slc]), list(y[slc]), p0=p0,sigma=list(sigma))
coeff, var_matrix = curve_fit(fnc, list(bcs[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
res=np.abs(coeff[2]/coeff[1])

if res<best_res:
Expand Down Expand Up @@ -234,7 +234,7 @@ def gauss(x, A,mu, sigma):
sigma=np.sqrt(y[slc])+0.5*(y[slc]==0)
p0=(100, np.mean(r), np.std(r))
try:
coeff, var_matrix = curve_fit(fnc, list(bcs[slc]), list(y[slc]), p0=p0,sigma=list(sigma))
coeff, var_matrix = curve_fit(fnc, list(bcs[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
res=np.abs(coeff[2]/coeff[1])

if res<best_res:
Expand Down

0 comments on commit 958f6cb

Please sign in to comment.