Santiago.R, Birge.T
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy as sp
from scipy.optimize import curve_fit
from scipy import stats
import sdtfile as sdt
data_path = '5.2.2021/'
Versuchsprotokoll
Aufbaumesswerte:
-Wellenlänge des Läsers von $\lambda = 652nm$
-$OD = 2,4$ der Phäophorbid Lösung
-Optische Weglänge von $10mm$ an der Küvette
-Betriebspannung des Detektors $V_d = 0,8V$
-Polarisationsfilter 90°
SDT File Test
DataTest = sdt.SdtFile('datatest.sdt')
DataTest.header.revision
28
print(DataTest)
SdtFile datatest.sdt FileRevision revision: 12 module type: Unknown *IDENTIFICATION ID : SPC Setup & Data File Title : datatest Version : 1 725 Revision : 10 bits ADC Date : 01-26-2021 Time : 14:07:32 Author : Unknown Company : Unknown Contents : *END BlockType mode: MEAS_DATA_FROM_FILE contents: PAGE_BLOCK dtype: uint16 compress: False BlockType mode: MEAS_DATA_FROM_FILE contents: PAGE_BLOCK dtype: uint16 compress: False shapes: (1, 1024) (1, 1024)
print(DataTest.info)
*IDENTIFICATION ID : SPC Setup & Data File Title : datatest Version : 1 725 Revision : 10 bits ADC Date : 01-26-2021 Time : 14:07:32 Author : Unknown Company : Unknown Contents : *END
print(DataTest.measure_info[1])
[(b'14:01:36', b'01-26-2021', b'3095020008', 0, 19.764706, 80., -1.496063, 5., -2.1259842, 4, 4., 5.e-08, 2, 25.006105, 5.490196, 94.90196, 1024, 1, 1, 1, 2, 20.000261, 20.000261, 1, 83, 0, 4, 0., 128, 1, 0, b'SPC-300', 5., 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0., 0, 0, 64, 1, 0, 0, 0, 0, 1, 0, 2.4233809e-27, 457179136, 1245184, (0, 1, 3.85186e-34, 19464192, 20316486, 23658850, 4.242894e-38, 4.628615e-38, 5.032806e-38, 6.2450323e-38, 5.9144475e-38, 7.1633996e-38, 7.6409666e-38, 7.273619e-38, 30540233, 7.2736364e-38), (500, 534, 32244216, 1.2637207e-37, 42599015, 52888264, 1.1873271e-36, 1096, 1204, 1374, 1479, 1545, 113903280), 129042282, 140511298, 149882994, 149621010, 2332, 2284, 2326, 2304, 2207, (2.0226568e-33, 1.3122564e-33, 150145358, 146802935, 3.6416654e-34, 124847985))]
int(DataTest.measure_info[0].scan_x)
64
len(DataTest.data)
2
DataTest.data[1].shape
(1, 1024)
print(DataTest.data[0][0])
[ 297 326 310 ... 2005 1917 1968]
print(DataTest.times[0])
[0.00000000e+00 2.44140628e-11 4.88281256e-11 ... 2.49267581e-08 2.49511722e-08 2.49755862e-08]
plt.plot(DataTest.times[0],DataTest.data[0][0])
plt.plot(DataTest.times[1],DataTest.data[1][0])
plt.grid(True)
Datenauswertung Funktion
def SDT_Auswertung(DataPath, Labels, file_name):
sdt_data = sdt.SdtFile(DataPath)
for i in range(0,len(sdt_data.data)):
plt.plot(sdt_data.times[i],sdt_data.data[i][0],label= Labels[i], linewidth=1.0)
plt.xlabel('Zeit t in Nanosekunden')
plt.ylabel('Counts')
plt.yscale("log")
plt.legend(bbox_to_anchor=(1.04,1), loc="upper left",prop={'size': 8})
plt.grid(True)
plt.savefig('Plots/' + file_name + '.pdf', bbox_inches="tight", dpi=1200)
plt.title(file_name)
plt.show
PlotNamen = ['Pheophörbid in Ethanol','Streuküvette']
SDT_Auswertung('datatest.sdt', PlotNamen, 'TestPlot')
Nicht Lineare Fit Funktion
Für den Fit der Messdaten wird die gemessene Funktion für die Fluoreszenz $f_m(t)$ mit dem Integral der
Apparaturfunktion $IRF(t-\tau)$ und der echten Funktion für die Fluoreszenz $f(\tau)$ gleichgesetzt als
$f_m(t)=\int_{\tau = 0}^{t}f(\tau)IRF(t-\tau)d\tau$
und $f(\tau)$ mit der exponentiellen Modelfunktion
$f(\tau)= a \cdot e^{-bt}+c$ mit Parametern $a$, $b$ und $c \in \mathbb{R}$
gefittet.
# Define model function to be used to fit the IRF:
def gauss(x, a_g, b_g, c_g):
y=a_g*np.exp(-((x-b_g)**2)/(2*c_g**2))
return y
FitData=sdt.SdtFile(data_path+'phäo_reabsorption.sdt')
set_number = 0
xdata = FitData.times[set_number][100:850]*1e9
ydata = FitData.data[set_number][0][100:850]
coeff_g, var_matrix = curve_fit(gauss, xdata, ydata)
hist_fit = gauss(xdata, *coeff_g)
plt.plot(xdata, ydata)
plt.plot(xdata, hist_fit, label='Fitted data')
print(coeff_g)
[5.06962350e+03 3.38369167e+00 1.73201590e-01]
from scipy.integrate import quad
from scipy.stats import norm
import numpy as np
a_g, b_g, c_g = coeff_g
def f(x,a1,b1,a2,b2,c):
gauss = a_g*np.exp(-((x-b_g)**2)/(2*c_g**2))
return gauss*a1*np.exp(-b1*x)+a2*np.exp(-b2*x)+c
def IntFit(xs,a1,b1,a2,b2,c):
return [quad(f,x0,x,args=(a1,b1,a2,b2,c))[0] for x in xs]
#p0 = np.array([2.60393921e+04, 1.69429390e-01, 8.28698883e+01])
FitData=sdt.SdtFile(data_path+'phäo_reabsorption.sdt')
set_number = 1
xdata = FitData.times[set_number][100:850]*1e9
ydata = FitData.data[set_number][0][100:850]
x0 = FitData.times[set_number][150]*1e9
#popt, pcov = curve_fit(IntFit,xdata,ydata)
#popt, pcov
#yfit = IntFit(xdata,*popt)
#plt.plot(xdata,yfit)
#plt.plot(xdata,ydata)
Hinweis: Aufgrund von Schwierigkeiten bei der Implementierung eines Algorithmus, der die obigen Fits mittels dem Reconvolutionsintegral bestimmen kann, wurde unten auf einen Exponential mit zwei Termen der Fit durchgeführt und die IRF vernachlässigt. Dies hat zur konsequenz, dass die bestimmten Abklingszeiten der Fluoreszenz deutlich fehlerbehafteter sind, doch jedoch geht die Erstellung eines Algorithmus in Python für Fits mit Integralen über Gauß oder ähnlichen Verteilungen samt der zu fittenden Funktion über die Anforderungen dieses Praktikums
Die vereinfachte Fit-Funktion ist eine Exponentialfunktion aus zwei Termen und einer Konstante
$f(t) = a1\cdot e^{-b1t}+a2\cdot e^{-b2t}+c$
und wird lediglich beschränkt auf das Intervall der Abklingszeit $t_i \in [t_0,t]$, die durch den exponentiell abfallenden Funktionsbereich $f'(t_i)<0$ gekennzeichnet wird, gefittet.
def DecayFit(x,a,a2,b,b2,c):
return a*np.exp(-b*x)+a2*np.exp(-b2*x)+c
def SPC_Fit(data_set, set_number, left_bound, right_bound,title_of_plot,savefile,file_format="pdf"):
## Plottet werte nach DecayFit
# title_of_plot: String, Fügt zum title nach Messdaten den string hinzu
# savefile: String, name der Output grafiken. Zu finden unter Plots
# file_format: String, pdf oder png nach geschmack. Für die menge an grafiken im protokoll empfohlen: pdf
#
FitData = sdt.SdtFile(data_set)
xax = FitData.times[set_number]
yax = FitData.data[set_number][0]
xdata = FitData.times[set_number][left_bound:right_bound]
ydata = FitData.data[set_number][0][left_bound:right_bound]
popt, pcov = curve_fit(DecayFit, xdata, ydata,maxfev=5000)
perr = np.sqrt(np.diag(pcov))
# Do ChiSq
chisq = sp.stats.chisquare(f_obs=ydata, f_exp=DecayFit(xdata, *popt))
lab = "$f(x)=a_i~exp(-b_ix)+c$ mit $i\in\{1,2\}$"
#Plot Fit
plt.figure(0)
plt.plot(xax,yax, label="Messdaten")
plt.plot(xdata, DecayFit(xdata, *popt), label=lab)
plt.title("Fit der Messdaten "+title_of_plot)
plt.xlabel('Zeit t in Nanosekunden')
plt.ylabel('Counts')
plt.yscale("log")
plt.legend(loc="upper right")
plt.grid(True)
plt.savefig('Plots/' + savefile +"_Fit."+ file_format, bbox_inches="tight", dpi=1200)
plt.show()
# Plot Residuals
plt.figure(2)
plt.plot(xdata,ydata-DecayFit(xdata, *popt),'o', label="Residuen mit $\chi^2/dof=$"+ str(round(chisq[0]/len(ydata-len(popt)),3)))
plt.xlabel('Zeit t in Nanosekunden')
plt.ylabel('Counts')
plt.legend(loc="upper right")
plt.grid(True)
plt.savefig('Plots/' + savefile +"_Resid." + file_format, bbox_inches="tight", dpi=1200)
plt.show()
print("ai=",popt[0],"+-", perr[0],",",popt[1],"+-", perr[1])
print("tau=1/bi=",1/popt[2],"+-", 1/popt[2]*perr[2]/popt[2] ,",",1/popt[3],"+-", 1/popt[3]*perr[3]/popt[3])
print("c=", popt[4],"+-", perr[4])
print("ReducedChisq=",str(round(chisq[0]/len(ydata-len(popt)),3)), ", P-Value=", chisq[1])
print(len(ydata),len(DecayFit(xdata, *popt)))
0. Test mit Streuküvette
bei unterschiedlichen Schwellwerten von $5-50mV$ mit einer Detektorspannung von $800 V$ und danach mit einem Schwellwert von $V_{Sch} =29.8mV$ bei unterschiedlichen Detektorspannungen $600-1000V$
Collection: 20 sekunden
Gain = 2
Offset = 21
Lambda-Gate = 40°
Graufilter
Schellwerte = ['19.76mV','5mV','9.73mV','29.8mV','39.84mV','49.88mV'] #in Milivolt
Spannungswerte = ['700V','750V','800V','850V','900V','950V','1000V'] #in Volt
SDT_Auswertung(data_path+'streukuvette_schellwerte.sdt',Schellwerte,'Streukuevette_Schellwerte')
SDT_Auswertung(data_path+'streukuvette_spannungswerte.sdt', Spannungswerte, 'Streukuevette_Spannungswerte')
1. Countsraten Test mit Streuküvette
Apparatur-Test bei unterschiedlichen Countsraten von $1e3-1e6$
Collection: 20 Sekunden
Schellwert = 29.8 mV
Detektorspannung = 800 V
Gain = 2
Offset = 21
Lambda-Gate = 0°-90°
Graufilter
Countsraten_CFD = [2.7e3,5.2e4,8.6e4,3e4,6.5e3]
Countsraten_TAC = [2.5e3,5e4,8.2e4,2.84e4,6.2e3]
Countsraten_ADC = [8.3e2,2e4,3.2e4,1.1e4,2.3e3]
Lambda_Gate = [0,22.5,45,67.5,90]
SDT_Auswertung(data_path+'streukuvette_countsraten.sdt', Lambda_Gate, 'Countraten_Streukuevette')
2. Test mit Pheophörbid a Lösung in Ethanol
bei OD von 0.1, bzw. Stoffmengen von $V_{Ph} = 60 ul$ und $V_{Eth} = 1440 ul$ und unterschiedlichen Countsraten
Collection: 5 sekunden
Schellwert = 29.8 mV
Detektorspannung = 800 V
Gain = 2
Offset = 21
Lambda-Gate_Apparatefunktion = 67.5°
Passfilter
Notiz: Overflow nach 15.7 sekunden bei 45°
Countsraten_CFD = [1.5e5,5.45e6,8.95e6,3.48e6,6.4e3,2.64e5]
Countsraten_TAC = [1.4e5,2.8e6,3.57e6,2.13e6,6.2e3,2.42e5]
Countsraten_ADC = [4.3e4,7.9e5,9.47e5,6.28e5,2.3e3,7.49e4]
Lambda_Gate = ['IRF',0,22.5,45,67.5,90]
SDT_Auswertung(data_path+'phäo01_countsraten.sdt', Lambda_Gate, 'Countraten_Pheophorbid')
SPC_Fit(data_path+'phäo01_countsraten.sdt',5,160,900,'Öffnung 90°', 'phao_counts_fit_90degree')
/home/santi/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:14: RuntimeWarning: invalid value encountered in sqrt
ai= 911.2457777719975 +- nan , 911.0956427417901 +- nan tau=1/bi= 6.192784783736812e-09 +- 5.709097802512523e-06 , 6.1925357011677165e-09 +- 5.714002281771825e-06 c= -7.169331187447161 +- 10.138704886774045 ReducedChisq= 1.075 , P-Value= 0.0725429995970515 740 740
SPC_Fit(data_path+'phäo01_countsraten.sdt',4,160,880,'Öffnung 67.5°', 'phao_counts_fit_67_5degree')
ai= 422407.04472007824 +- 586476450.9696982 , -401140.8614000073 +- 586475958.1062504 tau=1/bi= 8.577008998244667e-09 +- 1.2490643161022085e-07 , 8.7597297725991e-09 +- 1.3623227041978013e-07 c= 749.4207977392168 +- 681.9855926220348 ReducedChisq= 1.244 , P-Value= 7.133981176443176e-06 720 720
SPC_Fit(data_path+'phäo01_countsraten.sdt',3,160,850,'Öffnung 45°', 'phao_counts_fit_45degree')
ai= 47180.89378002288 +- 14770.74613355725 , 8470.281791174746 +- 14502.58903666248 tau=1/bi= 4.908667203320355e-09 +- 5.894472091013826e-10 , 1.0534908551582388e-08 +- 9.807042526409541e-09 c= -50.60602281950364 +- 727.1787374411069 ReducedChisq= 1.374 , P-Value= 1.8405887514984396e-10 690 690
3. Reabsorption mit unterschiedlichen Pheophörbid a Lösungen in Ethanol
bei OD von 0.1-1.5
Collection: 5 sekunden
Schellwert = 29.8 mV
Detektorspannung = 800 V
Gain = 2
Offset = 21
Lambda-Gate = 67.5°
Passfilter
Ausrechnen der Stoffmengen
OD = np.array([0.1,0.3,0.6,0.9,1.2,1.5])
2.4/OD*100
array([2400. , 800. , 400. , 266.66666667, 200. , 160. ])
1500/(2.4+OD)*2.4/3
array([480. , 444.44444444, 400. , 363.63636364, 333.33333333, 307.69230769])
1500/(2.4+OD)*OD
array([ 60. , 166.66666667, 300. , 409.09090909, 500. , 576.92307692])
#Funktionsrechner
#N = Gesamte Stoffmenge in Microliter
#Z_OD = Ziel Optische Dichte
#OD_0 = Ursprüngliche Optische Dichte
def Stoffmenge_OD(N,Z_OD,OD_0):
N_1 = N_0/(OD_0+OD)*OD_0
N_2 = N_0/(OD_0+OD)*OD
return N_1,N_2
Messungen
OD = ['IRF',0.1,0.3,0.6,0.9,1.2,1.5]
SDT_Auswertung(data_path+'phäo_reabsorption.sdt', OD, 'Reabsorption_OD')
SPC_Fit(data_path+'phäo_reabsorption.sdt',1,180,850,'Fit Reabsorption', 'phao_reab_fit1')
ai= -312579.54485316115 +- 753000181.263113 , 337849.4902637667 +- 753000548.364008 tau=1/bi= 7.739293470963729e-09 +- 1.9930849861185659e-07 , 7.576663746896579e-09 +- 1.785770865697932e-07 c= 459.90319705894154 +- 756.58760950367 ReducedChisq= 1.271 , P-Value= 1.9462622219425486e-06 670 670
for i in range(1,4):
SPC_Fit(data_path+'phäo_reabsorption.sdt',i,180,850,'Fit Reabsorption', 'phao_reab_fit')
ai= -312579.54485316115 +- 753000181.263113 , 337849.4902637667 +- 753000548.364008 tau=1/bi= 7.739293470963729e-09 +- 1.9930849861185659e-07 , 7.576663746896579e-09 +- 1.785770865697932e-07 c= 459.90319705894154 +- 756.58760950367 ReducedChisq= 1.271 , P-Value= 1.9462622219425486e-06 670 670
ai= 261118.79490116826 +- 384251164.09517825 , -230392.8823720249 +- 384250900.47072893 tau=1/bi= 7.2832783900416835e-09 +- 1.4187482722527844e-07 , 7.47959572324998e-09 +- 1.6714389092332722e-07 c= 449.6583631760009 +- 714.9812234455497 ReducedChisq= 1.344 , P-Value= 4.982966984996177e-09 670 670
ai= 341388.9409984178 +- 397884456.5883294 , -318862.6641052218 +- 397883911.00596964 tau=1/bi= 8.62409426072528e-09 +- 1.234439356615075e-07 , 8.840105956165622e-09 +- 1.3774926312467565e-07 c= 702.0725756061667 +- 766.0390007190655 ReducedChisq= 1.326 , P-Value= 2.424156007417096e-08 670 670
SPC_Fit(data_path+'phäo_reabsorption.sdt',4,160,860,'Fit Reabsorption', 'phao_reab_fit1')
ai= 364532.93255717866 +- 422378197.8376763 , -344740.75199464505 +- 422377457.003807 tau=1/bi= 9.330559014692358e-09 +- 1.3197130794778488e-07 , 9.562978911307343e-09 +- 1.4581797425129496e-07 c= 860.1228150036703 +- 895.5960459618763 ReducedChisq= 1.259 , P-Value= 3.1462999861016893e-06 700 700
SPC_Fit(data_path+'phäo_reabsorption.sdt',5,180,850,'Fit Reabsorption', 'phao_reab_fit1')
ai= -186227.0311967205 +- 274036248.04792875 , 198161.69074521036 +- 274037605.21695405 tau=1/bi= 1.046440323162372e-08 +- 2.60455162207841e-07 , 1.0121636710810711e-08 +- 2.30054093199325e-07 c= 725.7233794265439 +- 1560.91610919402 ReducedChisq= 1.189 , P-Value= 0.0004686370247945138 670 670
SPC_Fit(data_path+'phäo_reabsorption.sdt',6,200,880,'Fit Reabsorption', 'phao_reab_fit1')
ai= 119332.94479090422 +- 124947598.78579633 , -109954.38302367581 +- 124946506.90378353 tau=1/bi= 1.0098551640271815e-08 +- 2.1670090388009828e-07 , 1.0527404424320833e-08 +- 2.535368102722098e-07 c= 495.4285607394066 +- 1310.6047310279273 ReducedChisq= 1.089 , P-Value= 0.05123599482702629 680 680
4.Fluoreszenz von Phäophorbid bei unterschiedlichen Proportionen von Ethanol-Wasser
OD von 0.6, $V_{Ph}=300ul$ und unterschiedliche Anteile von $V_{LM}=1200ul$ an Wasser/Ethanol
Collection: 5 sekunden
Schellwert = 29.8 mV
Detektorspannung = 800 V
Gain = 2
Offset = 21
Lambda-Gate = 67.5°
Passfilter
Anteile_Ethanol = np.array([1,1/2,1/3,1/4,1/5,0])*1200
Anteile_Wasser = np.array([0,1/2,2/3,3/4,4/5,1])*1200
print(Anteile_Ethanol,Anteile_Wasser)
[1200. 600. 400. 300. 240. 0.] [ 0. 600. 800. 900. 960. 1200.]
960/3
320.0
Anteile = ['IRF','0% H2O','50% H2O','66,6% H2O','75% H2O','82,5% H2O','100% H2O']
SDT_Auswertung(data_path+'korrektur_phäo_fluoreszenz_wasser_ethanol.sdt', Anteile, 'Fluoreszenz_Ethanol_Wasser_Loesung')
SPC_Fit(data_path+'korrektur_phäo_fluoreszenz_wasser_ethanol.sdt',1,180,850,'Fit Reabsorption', 'phao_fluoh20_fit1')
ai= 230526.25888223754 +- 355344201.2676038 , -202841.6537405858 +- 355343886.0782705 tau=1/bi= 7.42198771769973e-09 +- 1.5534218429755547e-07 , 7.627309996445974e-09 +- 1.8383987558402605e-07 c= 400.1942309437659 +- 736.0846565822068 ReducedChisq= 1.298 , P-Value= 2.3834919808362236e-07 670 670
5.Fluoreszenz von Phäophorbid in Wasser bei Zugabe von Triton X-100 Detergenzmittel
OD von 0.6, $V_{Ph}=300ul$ und unterschiedliche Anteile von $V_{LM}=1200ul$ an Wasser/Ethanol
mit 2 Tropfen Triton X-100 bei 100% Wasser und bei 82,5% Wasser ca. 5 Tropfen
Collection: 5 sekunden
Schellwert = 29.8 mV
Detektorspannung = 800 V
Gain = 2
Offset = 21
Lambda-Gate = 67.5°
Passfilter
Anteile = ['IRF','82,5% H2O; X-100','100% H2O; X-100','82,5% H2O','100% H2O']
SDT_Auswertung(data_path+'phäo_fluoreszenz_wasser_ethanol_tritonx100.sdt', Anteile, 'Fluoreszenz_Ethanol_Wasser_TritonX-100_Lösung')
6.Fluoreszenz von Phäophorbid in Wasser/ Triton X-100 Detergenzmittel bei unterschiedlichen Polarisationsfilter Einstellungen
OD von 0.6, $V_{Ph}=300ul$ $V_{LM}=1200ul$ von Wasser mit 2 Tropfen Triton X oder Ethanol
Collection: 5 sekunden
Schellwert = 29.8 mV
Detektorspannung = 800 V
Gain = 2
Offset = 21
Lambda-Gate = 67.5°
Passfilter
Polarisationsfilter = ['IRF',0,45,90,135,180]
1.Messung mit Wasser/Triton X-100
SDT_Auswertung(data_path+'phäo_polarisation_wasser_ethanol_tritonx100.sdt', Polarisationsfilter, 'Fluoreszenz_Polarisation_Wasser_TritonX100')
2. Messung mit Ethanol
SDT_Auswertung(data_path+'korrektur_phäo_polarisation_ethanol.sdt', Polarisationsfilter, 'Fluoreszenz_Polarisation_Ethanol')
Anisotropie
#Anisotropie
sdt_data = sdt.SdtFile(data_path+'phäo_polarisation_wasser_ethanol_tritonx100.sdt')
begin = 100
end = 655
I_p = sdt_data.data[1][0].astype('int32')
I_p = I_p.astype('int32')
I_s = sdt_data.data[3][0].astype('int32')
I_s = I_s.astype('int32')
times = sdt_data.times[0]
plt.figure(0)
ani_triton = (I_p-I_s)/(I_p+I_s)
plt.plot(times,ani_triton, label="Anisotropie $H_2O$+Triton X-100")
print(sdt_data.times[0])
sdt_data = sdt.SdtFile(data_path+'korrektur_phäo_polarisation_ethanol.sdt')
begin = 100
end = 174
I_p = sdt_data.data[1][0].astype('int32')
I_p = I_p.astype('int32')
I_s = sdt_data.data[3][0].astype('int32')
I_s = I_s.astype('int32')
ani_triton = (I_p-I_s)/(I_p+I_s)
plt.plot(times,ani_triton,label="Anisotropie EthOH")
plt.title
plt.xlabel('Zeit t in Nanosekunden')
plt.ylabel('Counts')
plt.legend(bbox_to_anchor=(1,1), loc="upper right")
plt.grid(True)
plt.savefig('Plots/' + "Anisotropie.pdf", bbox_inches="tight", dpi=1200)
plt.show()
[0.00000000e+00 2.44140628e-11 4.88281256e-11 ... 2.49267581e-08 2.49511722e-08 2.49755862e-08]
#Anisotropie mit Error
sdt_data = sdt.SdtFile(data_path+'phäo_polarisation_wasser_ethanol_tritonx100.sdt')
times = sdt_data.times[0]
I_p = sdt_data.data[1][0]
I_s = sdt_data.data[3][0]
plt.figure(0)
ani_triton = np.abs(I_p-I_s)/(I_p+I_s)
plt.plot(times,ani_triton, label="Anisotropie $H_2O$+Triton X-100")
print(sdt_data.times[0])
sdt_data = sdt.SdtFile(data_path+'korrektur_phäo_polarisation_ethanol.sdt')
ani_triton = (I_p-I_s)/10000
plt.plot(times,ani_triton,label="$(I_\parallel-I_\perp)/10000$")
plt.title
plt.xlabel('Zeit t in Nanosekunden')
plt.ylabel('Counts')
plt.legend(bbox_to_anchor=(1,1), loc="upper right")
plt.grid(True)
plt.savefig('Plots/' + "Anisotropie3.pdf", bbox_inches="tight", dpi=1200)
plt.show()
[0.00000000e+00 2.44140628e-11 4.88281256e-11 ... 2.49267581e-08 2.49511722e-08 2.49755862e-08]
#Fehleranalyse Step by Step
indexes = []
for idx,val in enumerate((I_p-I_s)/(I_p+I_s)):
if val > 1:
indexes.append(idx)
print("Zähler", (I_p-I_s)[indexes])
print("Parallel", I_p[indexes])
print("Senkrecht", I_s[indexes])
# Muster erkennbar, hilt das aber auch für alle
# Hypothese: Wenn (I_p-I_s<0, gibt es einen fehler)
for i in indexes:
if (I_p[i]>I_s[i]):
print("Hypothese Wiederlegt")
print("done")
# Das sieht nach einem Underflow error aus!
print(I_p.dtype)
# numpy.uint16 Unsigned integer (0 to 65535)
# UNDERFLOW ERROR!!!!!! Keine Negativen zahlen zulässig!
Zähler [65535 65513 65508 65531 65488 65495 65507 65491 65518 65527 65534 65499 65504 65528 65525 65528 65533 65484 65504 65518 65514 65529 65511 65511 65498 65494 65480 65535 65500 65520 65504 65517 65512 65511 65515 65529 65532 65480 65469 65494 65506 65489 65533 65528 65499 65497 65500 65473 65449 65533 65534 65497 65524 65532 65492 65497 65520 65530 65532 65503] Parallel [ 800 716 675 1852 1687 1531 1473 1435 1395 1418 1392 1281 1187 1221 1188 1157 1184 1131 1154 1136 1098 1138 1131 1146 1078 1081 1033 1030 991 983 950 1012 946 903 926 889 915 862 842 858 837 792 857 837 821 815 789 794 759 766 785 693 763 764 753 726 723 733 685 649] Senkrecht [ 801 739 703 1857 1735 1572 1502 1480 1413 1427 1394 1318 1219 1229 1199 1165 1187 1183 1186 1154 1120 1145 1156 1171 1116 1123 1089 1031 1027 999 982 1031 970 928 947 896 919 918 909 900 867 839 860 845 858 854 825 857 846 769 787 732 775 768 797 765 739 739 689 682] done uint16