Skip to content
Snippets Groups Projects
Commit 01fef94d authored by Christian Sarmiento's avatar Christian Sarmiento
Browse files

Scrip de los histogramas del conteo de muones con y sin centellador

parent 9c7c01bf
No related branches found
No related tags found
1 merge request!1Script de las graficas de los espectros de Cs, Co y Na.
%% Cell type:code id:1e9e0f71 tags:
``` python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
%matplotlib inline
```
%% Cell type:code id:054e11a4 tags:
``` python
plt.rc('axes', labelsize=20)
plt.rc('xtick', labelsize=20)
plt.rc('ytick', labelsize=20)
```
%% Cell type:markdown id:235c5c85 tags:
### Lectura de los datos
- Datos obtenidos para el flujo de rayos cósmicos (muones) usando los equipos CAEN.
- En este caso tenemos dos tipos de datos, sin el centellador y con él.
%% Cell type:code id:73c4c6ff tags:
``` python
#A partir de aquí python sabe en que carpeta se encuentran los datos
os.chdir("/home/christian/MEGA/PostDoc_UIS/Conga_2022/Notebooks_CONGA/RayosCosmicos/")
os.getcwd()
```
%% Output
'/home/christian/MEGA/PostDoc_UIS/Conga_2022/Notebooks_CONGA/RayosCosmicos'
%% Cell type:code id:18a64f20 tags:
``` python
#Lectura de los datos
ds=pd.read_csv("RayosCosmicos_Treeshold_ConCentellador.tmp.txt", sep="\t")
```
%% Cell type:code id:4bd27abe tags:
``` python
ds.head()
```
%% Output
Threshold [mV] - Scintillator Frequency [kHz] - Scintillator
0 -7 18,7567
1 -9 10,03
2 -11 5,6
3 -13 3,39
4 -15 1,74333
%% Cell type:code id:57e0f701 tags:
``` python
ds.info()
```
%% Output
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 24 entries, 0 to 23
Data columns (total 2 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Threshold [mV] - Scintillator 24 non-null int64
1 Frequency [kHz] - Scintillator 24 non-null object
dtypes: int64(1), object(1)
memory usage: 512.0+ bytes
%% Cell type:markdown id:a6a7ae18 tags:
### Relación entre el threeshold y la frecuencia de conteo
%% Cell type:code id:15d0c568 tags:
``` python
from matplotlib.ticker import FormatStrFormatter
fig, ax = plt.subplots(figsize=(10, 8))
#plt.figure(figsize=(10, 8))
ax.plot(ds["Threshold [mV] - Scintillator"], ds["Frequency [kHz] - Scintillator"], '--*', color="b", linewidth=1)
ax.invert_xaxis()
ax.invert_yaxis()
plt.xlabel("Threshold [mV]")
plt.ylabel("Frequency [kHz]")
plt.grid()
plt.show()
```
%% Output
%% Cell type:markdown id:584d870b tags:
### Histogramas del flujo de muones con y sin centelladores
%% Cell type:code id:59c2ac01 tags:
``` python
#Lectura de los datos
dh1=pd.read_csv("RayosCosmicos_Conteo_SinCentellador.tmp.txt", sep="\t")
dh2=pd.read_csv("RayosCosmicos_Conteo_ConCentellador.tmp.txt", sep="\t")
```
%% Cell type:code id:0f91788c tags:
``` python
dh1.info()
```
%% Output
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 40 entries, 0 to 39
Data columns (total 2 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Frequency [Hz] - NO Scintillator 40 non-null float64
1 Counts - NO Scintillator 40 non-null int64
dtypes: float64(1), int64(1)
memory usage: 768.0 bytes
%% Cell type:code id:03755b1c tags:
``` python
plt.figure(figsize=(10, 8))
plt.step(dh1["Frequency [Hz] - NO Scintillator"], dh1["Counts - NO Scintillator"], '--b', linewidth=3)
plt.xlabel("Frequency [Hz]")
plt.ylabel("Counts")
plt.title("Conteo sin centellador", fontsize=22)
plt.grid()
plt.show()
```
%% Output
%% Cell type:code id:272b4233 tags:
``` python
dh2.info()
```
%% Output
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 40 entries, 0 to 39
Data columns (total 2 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Frequency [Hz] - Scintillator 40 non-null float64
1 Counts - Scintillator 40 non-null int64
dtypes: float64(1), int64(1)
memory usage: 768.0 bytes
%% Cell type:code id:422b7e43 tags:
``` python
plt.figure(figsize=(10, 8))
plt.step(dh2["Frequency [Hz] - Scintillator"], dh2["Counts - Scintillator"], '--b', linewidth=3)
plt.xlabel("Frequency [Hz]")
plt.ylabel("Counts")
plt.title("Conteo con centellador", fontsize=22)
plt.grid()
plt.show()
```
%% Output
%% Cell type:code id:0c9bb2cc tags:
``` python
```
Frequency [Hz] - Scintillator Counts - Scintillator
46792.9 1
47578.8 0
48364.6 0
49150.4 2
49936.2 3
50722.1 1
51507.9 0
52293.8 0
53079.6 0
53865.4 0
54651.2 1
55437.1 0
56222.9 0
57008.8 0
57794.6 1
58580.4 1
59366.2 5
60152.1 5
60937.9 10
61723.8 26
62509.6 43
63295.4 60
64081.2 104
64867.1 125
65652.9 129
66438.7 136
67224.6 139
68010.4 148
68796.2 128
69582.1 106
70367.9 94
71153.7 68
71939.6 42
72725.4 49
73511.2 30
74297.1 29
75082.9 27
75868.7 9
76654.6 6
77440.4 6
Frequency [Hz] - NO Scintillator Counts - NO Scintillator
18008.3 2
18225 3
18441.7 2
18658.3 7
18875 26
19091.7 25
19308.3 41
19525 50
19741.7 82
19958.3 79
20175 89
20391.7 83
20608.3 95
20825 109
21041.7 102
21258.3 78
21475 74
21691.7 79
21908.3 51
22125 53
22341.7 56
22558.3 48
22775 40
22991.7 35
23208.3 43
23425 28
23641.7 27
23858.3 16
24075 17
24291.7 11
24508.3 7
24725 1
24941.7 3
25158.3 1
25375 1
25591.7 3
25808.3 0
26025 0
26241.7 1
26458.3 2
Threshold [mV] - Scintillator Frequency [kHz] - Scintillator
-7 18,7567
-9 10,03
-11 5,6
-13 3,39
-15 1,74333
-17 0,793333
-19 0,496667
-21 0,236667
-23 0,15
-25 0,1
-27 0,0433333
-29 0,02
-31 0,00666667
-33 0,01
-35 0,00666667
-37 0,00333333
-39 0,00666667
-41 0,00333333
-43 0,00333333
-45 0,00333333
-47 0,00666667
-49 0,00333333
-57 0,00333333
-69 0,00333333
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