Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PasantiasLaCOnGA_2022
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yessica Dominguez
PasantiasLaCOnGA_2022
Commits
f1c26c9d
Commit
f1c26c9d
authored
2 years ago
by
Yessica Dominguez
Browse files
Options
Downloads
Patches
Plain Diff
Replace EspectroUranos.py
parent
2a7eb39c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
HumedadConNeutrones/codigos python/EspectroUranos.py
+24
-16
24 additions, 16 deletions
HumedadConNeutrones/codigos python/EspectroUranos.py
with
24 additions
and
16 deletions
HumedadConNeutrones/codigos python/EspectroUranos.py
+
24
−
16
View file @
f1c26c9d
# Este programa Grafica el espectro de energias de los neutrones
# generados durante una simulacion hecha en URANOS.
import
pandas
as
pd
import
numpy
as
np
import
matplotlib.pyplot
as
plt
#Guardamos en un dataframe los datos
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)
#los filtramos para identificar de donde provienen
# las particulas
dfin
=
dlayer
.
drop_duplicates
([
'
Neutron_Number
'
],
keep
=
'
first
'
)
# espero que sean solo los incoming
df1
=
dlayer
[
dlayer
[
'
Soil_contact
'
]
==
1
]
#neutrones que tuvieron contacto con el suelo
df5
=
df1
[
df1
[
'
previous_Depth_[m]
'
]
>
0.0
]
# neutrones que rebotaron con suelo y volvieron a la superficie (Backscattering)
dfback
=
df5
[
df5
[
'
z_[m]
'
]
==
-
2.0
]
# otro filtro para asegurarnos que son neutrones Backscattering
dfinal
[
'
E
'
]
=
pd
.
concat
([
dfin
[
'
Energy_at_Interface_[MeV]
'
],
dfback
[
'
Energy_[MeV]
'
]],
axis
=
0
)
#TOTAL dfin + dfback
dfin
=
dlayer
.
drop_duplicates
([
'
Neutron_Number
'
],
keep
=
'
first
'
)
# Neutrones generados en la atmosfera(fuente de neutrones o Incoming)
dfinal
=
pd
.
DataFrame
()
dfinal
[
'
E
'
]
=
pd
.
concat
([
dfin
[
'
Energy_at_Interface_[MeV]
'
],
dfback
[
'
Energy_[MeV]
'
]],
axis
=
0
)
#TOTAL dfin + dfback, es decir el espetro completo.
#
LOG para todos
#
Creamos un dataframe para cada espectro (Backscattered, incoming y total) en escala logaritmica
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)
#############
#Contamos el total de particulas ('La Integral' de la curva del espectro de energias)
print
(
len
(
dfin
.
index
))
print
(
len
(
dfback
.
index
))
a
=
780
#Graficamos los histogramas del espectro de energias
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
############################
#cambiamos las estiquetas del eje x (energias)
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
'
]
val
=
[
'
1e-8
'
,
'
1e-6
'
,
'
1e-4
'
,
'
0.01
'
,
'
1
'
,
'
100
'
]
# los nuevos valores en MeV
#############################
plt
.
title
(
'
URANOS Neutron Spectra
'
,
loc
=
'
center
'
)
plt
.
xlabel
(
'
Energy(MeV)
'
,
size
=
13
)
plt
.
ylabel
(
'
Counts
'
,
size
=
13
)
...
...
@@ -39,7 +50,4 @@ 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)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment