Commit b5bfa241 authored by Nicolas Nunez Barreto's avatar Nicolas Nunez Barreto

todo

parent b848b77e
...@@ -121,7 +121,7 @@ palette = sns.color_palette("tab10") ...@@ -121,7 +121,7 @@ palette = sns.color_palette("tab10")
pmlocmedvec1=list(np.arange(0,len(PIEZOS1_FILES)-2,1)) pmlocmedvec1=list(np.arange(0,len(PIEZOS1_FILES)-2,1))
#pmlocmedvec1 = [1] #pmlocmedvec1 = [18]
plt.figure() plt.figure()
...@@ -172,7 +172,7 @@ for med in pmlocmedvec1: ...@@ -172,7 +172,7 @@ for med in pmlocmedvec1:
plt.plot([2*f*1e-6 for f in Piezo1Frequencies[med][1:]], [c for c in Piezo1Counts[med][1:]], '-o', markersize=2, alpha=0.7) plt.plot([2*f*1e-6 for f in Piezo1Frequencies[med][1:]], [c for c in Piezo1Counts[med][1:]], '-o', markersize=2, alpha=0.7)
plt.plot([f*1 for f in Freqs],Lorentzian(Freqs,*popt)) plt.plot([f*1 for f in Freqs],Lorentzian(Freqs,*popt))
plt.axhline(bkg,linestyle='dashed',color='k') #plt.axhline(bkg,linestyle='dashed',color='k')
jj=jj+1 jj=jj+1
plt.grid() plt.grid()
...@@ -471,7 +471,8 @@ from scipy.optimize import curve_fit ...@@ -471,7 +471,8 @@ from scipy.optimize import curve_fit
def modelo3(r,a,b,d): def modelo3(r,a,b,d):
return (a*jv(0, b*(1/(r-d)))*jv(0,2*b*(1/(r-d))))**2 #d=0
return a*(jv(0, b*(1/(r-d))))**2
rfit = np.arange(x1,len(Intensityver2)*20+x2,20) rfit = np.arange(x1,len(Intensityver2)*20+x2,20)
yfit = [pmdepthsdrver1[0],pmdepthsdrver1[1],pmdepthsdrver1[2]] + [p for p in pmdepthsdrver2] yfit = [pmdepthsdrver1[0],pmdepthsdrver1[1],pmdepthsdrver1[2]] + [p for p in pmdepthsdrver2]
...@@ -482,9 +483,9 @@ popt,pcov = curve_fit(modelo3,rfit,yfit) ...@@ -482,9 +483,9 @@ popt,pcov = curve_fit(modelo3,rfit,yfit)
rfit = np.arange(x2,len(Intensityver2)*20+x2,20) rfit = np.arange(x2,len(Intensityver2)*20+x2,20)
yfit = [p for p in pmdepthsdrver2] yfit = [p for p in pmdepthsdrver2]
rlong = np.arange(1e-10,1000,1) rlong = np.arange(-200.1,1000,1)
popt,pcov = curve_fit(modelo3,rfit,yfit,p0=(10,10,10)) popt,pcov = curve_fit(modelo3,rfit,yfit,p0=(10,100,10))
print(popt) print(popt)
plt.figure() plt.figure()
...@@ -495,9 +496,9 @@ plt.plot([x*20 for x in xchicofinal],[i/np.max(IntensityChico) for i in Intensit ...@@ -495,9 +496,9 @@ plt.plot([x*20 for x in xchicofinal],[i/np.max(IntensityChico) for i in Intensit
plt.errorbar(np.arange(x2,len(Intensityver2)*20+x2,20), [p for p in pmdepthsdrver2], yerr= errorpmdepthsdrver2, fmt='o',color='blue', capsize=3, markersize=8,zorder=1) plt.errorbar(np.arange(x2,len(Intensityver2)*20+x2,20), [p for p in pmdepthsdrver2], yerr= errorpmdepthsdrver2, fmt='o',color='blue', capsize=3, markersize=8,zorder=1)
plt.plot([x*20 for x in xgrandefinal],[i/np.max(IntensityGrande) for i in IntensityGrande],'o',color='blue',alpha=0.3) plt.plot([x*20 for x in xgrandefinal],[i/np.max(IntensityGrande) for i in IntensityGrande],'o',color='blue',alpha=0.3)
plt.plot(rlong,modelo3(rlong,*popt),zorder=2,color='green',linewidth=3,label=r'$I(r)=a\,(J_0(\frac{b}{r}))^2$') plt.plot(rlong,modelo3(rlong,popt[0],popt[1]*1,popt[2]),zorder=2,color='green',linewidth=3,label=r'$I(r)=a\,(J_0(\frac{b}{r}))^2$')
plt.xlim(-20,600+x2+10) plt.xlim(-100,600+x2+10)
plt.legend() plt.legend()
plt.grid() plt.grid()
......
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