Began versioning.
[calibcant.git] / README
1 == Dependencies ==
2
3 linfit (depends in turn on scipy.stats.linregress)
4
5 *** Command line interface ***
6
7 ** bumps **
8
9 Create a two-column ascii data file for fitting bumps with (for example)
10  $ int16s_to_ascii_array ~/rsrch/data/z_piezo_calib/20080116/20080116090005_bump_surface_Z_piezo_output \
11                          ~/rsrch/data/z_piezo_calib/20080116/20080116090005_bump_surface_Deflection_input > d
12
13 Then fit slope with
14  $ python calibcant_bump_analyze.py -c d  > stdout 2> stderr
15  $ cat stdout
16  0.00958650972452
17  $ cat stderr
18  not cutting
19
20 ** vibs **
21
22 Create a two-column ascii data file for fitting bumps with (for example)
23  $ cd ~/src/comedi_simult_AIO
24  $ cmd -c0 -n1 -F200000 -N2097152 > vib.raw   # 2097152 = 2^21 points ~= 10 seconds of data
25  $ unitary_avg_fft_from_raw.py vib.raw
26 Creates vib.raw.psd, with frequency in Hz in the first column, and amplitude in Volts^2/Hz in the second column.
27 Then get the variance with
28  $ cd ~/src/calibrate_cantilever
29  $ python psd_filter_analyze.py -s9 -tmedian -g ~/src/comedi_simult_AIO/vib.raw 2> check.gp
30  <Lorentzian-fit-variance>
31 You can check the validity of the fit with
32  $ gnuplot check.gp -
33 And adjust the min and max of the fitted frequency range as neccessary
34  $ python psd_filter_analyze.py -s9 -tmedian -m1000 -M8500 -g ~/src/comedi_simult_AIO/vib.raw 2> check.gp
35  <new Lorentzian-fit-variance>
36 Until the fit looks reasonable.
37
38
39 ** calibrating **
40
41 Once you've assembled a few slopes, vibs, and Ts, put it all together to calculate k with
42  $ python calibcant_analyze.py -vC 0.02,0.03,0.025 22.5,22.1 6e-9,5.5e-9  > stdout 2> stderr
43  $ cat stdout
44  456.069575483
45  $ cat stderr
46  Variable (units)              : mean +/- std. dev. (relative error)
47  Cantilever k (pN/nm)          : 456.07 +/- 146.671 (0.321599)
48  photoSensitivity**2 (V/nm)**2 : 0.000641667 +/- 0.000204464 (0.318645)
49  T (K)                         : 295.45 +/- 0.2 (0.000676933)
50  1/Vphoto**2 (1/V)**2          : 1.74242e+08 +/- 7.57576e+06 (0.0434783)