#!/usr/bin/python3 import ephys as ep t = ep.Quantity(0, 0.0001, 's').name(label='Time', latex='t') U = ep.Quantity(0, 0.02, 'V').name(label='Photo Diode Voltage', latex='U_{PD}') ep.daq('data.csv', t, U, skip=2) t.prefunit('ms') p = ep.Plot() p.error(t, U, ecolor='0.3') A = ep.Quantity('V').name(latex='U_0') mu = ep.Quantity('s').name(latex='\\mu') gamma = ep.Quantity('s').name(latex='\\Gamma') mf = ep.LorentzFit(A, mu, gamma) mf.fit(t, U) p.fit(mf) p.save('tut.png')
#!/usr/bin/python3 import ephys as ep x = ep.Quantity('mm').name(label='Positon', latex='x_0') U = ep.Quantity('mV').name(label='Voltage under Neadle', latex='U_N') ep.daq('small.csv', x, U, ep.StdDev(U), skip=1) x.variance = 0.00001**2 p = ep.Plot() p.error(x, U) offset = ep.Quantity('V').name(symbol='U_0') m = ep.Quantity('V/m').name(symbol='m') lin = ep.PolynomFit(offset, m) lin.fit(x, U) p.fit(lin) p.save('small.png')