Skip to content
Snippets Groups Projects
Commit 5f1af77a authored by Yessica Dominguez's avatar Yessica Dominguez
Browse files

Upload New File

parent f14e5507
No related branches found
No related tags found
No related merge requests found
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
dlayer= pd.read_table('detectorLayer300000.dat')
df1 = dlayer[dlayer['Soil_contact'] == 1] # contacto con el suelo
df5 = df1[df1['previous_Depth_[m]'] > 0.0] # espero que vengan del suelo
dfinal=pd.DataFrame()
dfback = df5[df5['z_[m]'] == -2.0] # espero que vengan del suelo (Back scattering)
dfin = dlayer.drop_duplicates(['Neutron_Number'], keep = 'first') # espero que sean solo los incoming
dfinal['E'] = pd.concat([dfin['Energy_at_Interface_[MeV]'], dfback['Energy_[MeV]']], axis = 0) #TOTAL dfin + dfback
#LOG para todos
dlayer = dfinal.assign(energy=np.log(dfinal['E'])) #azul (TOTAL)
dback = dfback.assign(energy=np.log(dfback['Energy_[MeV]'])) # Green (Back Scattered)
din = dfin.assign(energy=np.log(dfin['Energy_at_Interface_[MeV]'])) # naranja (INCOMING)
#############
print(len(dfin.index))
print(len(dfback.index))
a = 780
dlayer['energy'].hist(bins=int(a*1.17),histtype='step',label='Total',linewidth=1) #azul
din['energy'].hist(bins=a,histtype='step', label = 'Incoming Spectrum',linewidth=1) #Naranja
dback['energy'].hist(bins=a, histtype='step', label = 'Backscattered Spectrum',linewidth=1) #verde
x = [-np.log(100000000),-np.log(1000000),-np.log(10000),-np.log(100),np.log(1),np.log(100)]
val = ['1e-8','1e-6','1e-4','0.01','1','100']
plt.title('URANOS Neutron Spectra', loc='center')
plt.xlabel('Energy(MeV)', size=13)
plt.ylabel('Counts', size = 13)
plt.tick_params(labelsize=14)
plt.xticks(x,val)
plt.legend(loc='upper left')
plt.show()
#y = [500,1000,1500,2000,2500,3000]
#valy = ['0.5','1','1.5','2.0','2.5','3.0']
#plt.title('e+3', loc = 'left')
#plt.yticks(y,valy)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment