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

Análisis de datos de la práctica de detección de Rayos cósmicos.

parent 61f64dea
No related branches found
No related tags found
No related merge requests found
%% 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
```
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