Commit 3d218bda authored by Muriel Bonetto's avatar Muriel Bonetto

modificacion ion_statistics.py

parent a9499f0b
...@@ -7,6 +7,20 @@ import ast ...@@ -7,6 +7,20 @@ import ast
from scipy.optimize import curve_fit from scipy.optimize import curve_fit
import os import os
import scipy.stats as sts import scipy.stats as sts
import seaborn as sns
colors1=sns.color_palette("rocket", 10)
colors2=sns.color_palette("mako", 10)
color1 = colors1[3]
color2 = colors1[2]
color3 = colors1[1]
plt.rcParams.update({
"font.family": "STIXGeneral"
})
plt.rcParams.update({
"font.size": 14
})
# Solo levanto algunos experimentos # Solo levanto algunos experimentos
Stat_files = [8731, 8738, 8745] Stat_files = [8731, 8738, 8745]
...@@ -53,26 +67,34 @@ for i, fname in enumerate(Stat_files): ...@@ -53,26 +67,34 @@ for i, fname in enumerate(Stat_files):
#plt.figure() #plt.figure()
#plt.plot(Stat_Bins[0][:-1], Stat_Heigths[0]) #plt.plot(Stat_Bins[0][:-1], Stat_Heigths[0])
#plot figuras papers
bins1 = np.arange(100,350, 1) bins1 = np.arange(100,350, 1)
bins2 = np.arange(10,50,1) bins2 = np.arange(10,50,1)
bins3 = np.arange(30,100,1) bins3 = np.arange(30,100,1)
plt.figure() plt.figure(figsize = (4.5,3))
plt.hist(Stat_Heigths[0], bins=bins1, histtype='step',density = True) plt.hist(Stat_Heigths[0], bins=bins1, histtype='step',density = True,color = color1,label = 'BG')
#plt.hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True) #plt.hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True)
plt.hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True) plt.hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True,color = color2,label = 'UV laser')
#plt.hist(Stat_Heigths[3], bins=bins2, histtype='step',density = True) #plt.hist(Stat_Heigths[3], bins=bins2, histtype='step',density = True)
#plt.hist(Stat_Heigths[4], bins=bins2, histtype='step',density = True) #plt.hist(Stat_Heigths[4], bins=bins2, histtype='step',density = True)
plt.hist(Stat_Heigths[2], bins=bins3, histtype='step',density = True) plt.hist(Stat_Heigths[2], bins=bins3, histtype='step',density = True,color = color3,label = 'Ion')
#%%
poisson = sts.poisson.pmf(bins,np.mean(Stat_Heigths))
plt.plot(bins+0.5,poisson)
poissoneidad = np.var(Stat_Heigths)/np.mean(Stat_Heigths) poisson1= sts.poisson.pmf(bins1,np.mean(Stat_Heigths[0]))
plt.title('Varianza/media = {:.4f}'.format(poissoneidad)) poisson2= sts.poisson.pmf(bins2,np.mean(Stat_Heigths[1]))
poisson3= sts.poisson.pmf(bins3,np.mean(Stat_Heigths[2]))
plt.plot(bins1+0.5,poisson1,color = color1,alpha = 0.9)
plt.plot(bins2+0.5,poisson2,color = color2,alpha = 0.9)
plt.plot(bins3+0.5,poisson3,color = color3,alpha = 0.9)
plt.legend()
plt.grid()
plt.tight_layout()
#poissoneidad = np.var(Stat_Heigths)/np.mean(Stat_Heigths)
#plt.title('Varianza/media = {:.4f}'.format(poissoneidad))
plt.savefig('bg_laser_ion_stats.pdf',dpi = 600 )
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