Skip to content

Commit

Permalink
femc_*: use maxfev=10000
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Oct 23, 2024
1 parent 83651e7 commit 2f0bcec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions benchmarks/femc_electron/analysis/femc_electron_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def gauss(x, A,mu, sigma):
sigma=np.sqrt(y[slc])+0.5*(y[slc]==0)
p0=(100, p, 3)

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 p==50:
xx=np.linspace(15*p/20,22*p/20, 100)
Expand All @@ -151,7 +151,7 @@ def gauss(x, A,mu, sigma):
plt.errorbar(pvals, 100*np.array(res), 100*np.array(dres), ls='', marker='o')
fnc = lambda E, a, b: np.hypot(a,b/np.sqrt(E))
p0=(.05, .12)
coeff, var_matrix = curve_fit(fnc, pvals, res, p0=p0,sigma=dres)
coeff, var_matrix = curve_fit(fnc, pvals, res, p0=p0,sigma=dres, maxfev=10000)
xx=np.linspace(7, 85, 100)
plt.plot(xx, 100*fnc(xx,*coeff), label=f'fit:{100*coeff[0]:.1f}%$\\oplus\\frac{{{100*coeff[1]:.0f}\\%}}{{\\sqrt{{E}}}}$')
plt.legend()
Expand Down Expand Up @@ -190,7 +190,7 @@ def gauss(x, A,mu, sigma):
p0=(100, p, 3)

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)
if abs(coeff[1])>100 or np.sqrt(var_matrix[1][1])>100:
continue
pvals.append(p)
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/femc_photon/analysis/femc_photon_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def gauss(x, A,mu, sigma):
sigma=np.sqrt(y[slc])+0.5*(y[slc]==0)
p0=(100, p, 3)

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 p==50:
xx=np.linspace(15*p/20,22*p/20, 100)
Expand All @@ -150,7 +150,7 @@ def gauss(x, A,mu, sigma):
plt.errorbar(pvals, 100*np.array(res), 100*np.array(dres), ls='', marker='o')
fnc = lambda E, a, b: np.hypot(a,b/np.sqrt(E))
p0=(.05, .12)
coeff, var_matrix = curve_fit(fnc, pvals, res, p0=p0,sigma=dres)
coeff, var_matrix = curve_fit(fnc, pvals, res, p0=p0,sigma=dres, maxfev=10000)
xx=np.linspace(7, 85, 100)
plt.plot(xx, 100*fnc(xx,*coeff), label=f'fit:{100*coeff[0]:.1f}%$\\oplus\\frac{{{100*coeff[1]:.0f}\\%}}{{\\sqrt{{E}}}}$')
plt.legend()
Expand Down Expand Up @@ -188,7 +188,7 @@ def gauss(x, A,mu, sigma):
sigma=np.sqrt(y[slc])+0.5*(y[slc]==0)
p0=(100, p, 3)
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)
if abs(coeff[1])>100 or np.sqrt(var_matrix[1][1])>100:
continue
pvals.append(p)
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/femc_pi0/analysis/femc_pi0_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def gauss(x, A,mu, sigma):
sigma=np.sqrt(y[slc])+0.5*(y[slc]==0)
p0=(100, p, 3)

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 p==50:
xx=np.linspace(15*p/20,22*p/20, 100)
Expand All @@ -186,7 +186,7 @@ def gauss(x, A,mu, sigma):
plt.errorbar(pvals, 100*np.array(res), 100*np.array(dres), ls='', marker='o')
fnc = lambda E, a, b: np.hypot(a,b/np.sqrt(E))
p0=(.05, .12)
coeff, var_matrix = curve_fit(fnc, pvals, res, p0=p0,sigma=dres)
coeff, var_matrix = curve_fit(fnc, pvals, res, p0=p0,sigma=dres, maxfev=10000)
xx=np.linspace(15, 85, 100)
plt.plot(xx, 100*fnc(xx,*coeff), label=f'fit:{100*coeff[0]:.1f}%$\\oplus\\frac{{{100*coeff[1]:.0f}\\%}}{{\\sqrt{{E}}}}$')
plt.legend()
Expand Down Expand Up @@ -225,7 +225,7 @@ def gauss(x, A,mu, sigma):
p0=(100, p, 3)

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)
if abs(coeff[1])>100 or np.sqrt(var_matrix[1][1])>100:
continue
pvals.append(p)
Expand Down

0 comments on commit 2f0bcec

Please sign in to comment.