def test_Ti(self): R, sigma_R = responseFactor(N, 49.4, i, t, sigma_N) R_calculated = 454712 / (268 * 179 * 49.4) sigma_calculated = R_calculated * np.sqrt((676 / 454712)**2 + (0.05)**2 + (0.05)**2 + (0.05)**2) self.assertAlmostEqual(R, R_calculated) self.assertAlmostEqual(sigma_R, sigma_calculated)
import shimadzu as sd doc_csv = 'data/calibration/2010-10/csv/' for j in range(len(serial)): doc_csv += serial[j] for j in range(len(pto_csv)): doc_csv += pto_csv[j] file_content = pathlib.Path(doc_csv).read_text() It = sd.parseCsv(file_content) I = It['current'] tempo = It['livetime'] # subtrair branco ?? # caculcar fator de resposta ponto a ponto from responseFactor import responseFactor R, sigma_R = responseFactor(N, d, I, tempo, sigma_N) linha_fatores = [df['element1'][i], R, sigma_R] fatores.append(linha_fatores) #calcular fator de resposta para element2 d = df['density2'][i] try: N = txt['K']['peaks'][df['element1'][i]] sigma_N = txt['K']['errors'][df['element1'][i]] except: pass R, sigma_R = responseFactor(N, d, I, tempo, sigma_N) linha_fatores = [df['element1'][i], R, sigma_R] fatores.append(linha_fatores)
import pandas as pd densidades = pd.read_csv('data/calibration/micromatter-table-iag.csv') df = pd.DataFrame(densidades) d = df['density1'][0] # ler contagens do arquivos txt import sys import pathlib sys.path.append('lib') from winqxas import parseTxt file_content = pathlib.Path('data/calibration/2010-10/txt/34662.txt').read_text() txt = parseTxt(file_content) N = txt['K']['peaks'][11] #print(txt['K']['errors'][11]) # ler corrente e tempo dos arquivos csv import shimadzu file_content = pathlib.Path('data/calibration/2010-10/csv/34662.csv').read_text() It = shimadzu.parseCsv(file_content) I = It['current'] tempo = It['livetime'] # subtrair branco ?? # caculcar fator de resposta ponto a ponto from responseFactor import responseFactor R = responseFactor(N,d,I,tempo) print(R) # Ajustar polinĂ´mio