Skip to content
Snippets Groups Projects
Commit c1b87541 authored by Victor Clarizio's avatar Victor Clarizio
Browse files

Upload New File

parent d200e3e4
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 16 16:51:00 2022
@author: victor
"""
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import math
import csv, operator
import scipy.stats as st
from numpy import random
import pandas as pd
from datetime import datetime
from pandas import *
from scipy.stats import norm
import statistics
matplotlib.pyplot.savefig
#df = df.rename(columns={'oldName1': 'newName1', 'oldName2': 'newName2'})
##Este código Python servirá para analizar los datos correspondientes al WCD Characatito.
##Existen diferentes terminaciones de archivos que corresponden a datos de análisis distintos.
##Pero todos los archivos comparten el mismo nombre, salvo la terminación.
##Luego de realizar el primer procesamiento de datos (Lo a L1) con ./raw en la terminal,
##procedemos a estudiar la data adquirida aquí. Las terminaciones de archivos que nos interesan
##son: .rte (pulsos detectados por unidad de tiempo fijada por el usuario), .flx (pulsos detec-
##tados por segundo)
#dfc0000 = dfc0000.drop(dfc0000.columns[[0, 2, 3, 4, 5, 6]], axis=1)
##PARA MODIFICAR EL NÚMERO DE BINES
Bines = 30
Opac = 0.5
Rwidth = 0.85
Xmin = 1400
Xmax = 1800
ajust = 0.076
###----------------------------------------------------------------------
df = pd.read_csv('histogramavems.csv', decimal = ',', skiprows=0)
df.columns=['1','2','3']
df = df.drop(df.columns[[0, 1]], axis=1)
df['3'].hist(bins= Bines)
#plt.title("Histograma de Cargas de VEMS - Julio/Octubre", fontsize = 'xx-large')
#plt.ylabel("Conteos registrados", fontsize = 'xx-large')
plt.xlabel('Carga del VEM [ADC]', fontsize = 'xx-large')
plt.axvline(x = Xmin + Xmax/2 - Xmin/2, color = 'red')
plt.axvline(x = Xmin, color = 'green')
plt.axvline(x = Xmax, color = 'green')
df=df[df['3']<Xmax]
df=df[df['3']>Xmin]
df.hist(bins=Bines, color = 'blue', alpha= Opac, rwidth=Rwidth)
# Plot the Gaussian PDF
xmin, xmax = plt.xlim()
x = np.linspace(Xmin, Xmax, 1000)
df['3'].std()
mu, std = norm.fit(df)
gfit = norm.pdf(x, mu, std) * 14000
plt.plot(x, gfit, 'r--', linewidth=1)
plt.xticks(np.arange(1400, 1850, 50))
title = ""
plt.text(1700, 70,r'$\mu={:.2f}$'.format(mu, std), fontsize = 'large')
plt.text(1700, 60, r'$\sigma= {:.2f}$'.format(std), fontsize = 'large')
plt.text(1700, 50, r'$\epsilon= 0.0756\;\frac{MeV}{{ADC}}$', fontsize = 'large')
plt.ylabel("Conteos registrados", fontsize = 'xx-large')
plt.xlabel('Carga del VEM [ADC]', fontsize = 'xx-large')
plt.axvline(x = 1585.27 + df['3'].std(), color = 'green', linestyle = '-.')
plt.axvline(x = 1585.27, color = 'red', linestyle = '-.')
plt.axvline(x = 1585.27 - df['3'].std(), color = 'green', linestyle = '-.')
#plt.axvline(x = 1584.60 + 2*df['3'].std(), color = 'red')
#plt.axvline(x = 1584.60 - 2*df['3'].std(), color = 'red')
plt.title(title)
plt.savefig("VEMS30.png", dpi=300)
print(df['3'].std())
\ No newline at end of file
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