mkogg.py: Fix 'self.get_mp4_metadata(self, source)'
[blog.git] / posts / slow_bend.mdwn
1 [[!meta  title="slow_bend"]]
2
3 In the course of my [[research|Thesis]], I've spend a good deal of
4 time developing clean, Python interfaces to much of our lab equipment.
5 I also tend to have strong opinions on the One True Way® to solve a
6 problem.  This means that I occasionaly end up writing script to run
7 other people's experiment, especially when they don't take all that
8 much time to write.
9
10 I wrote `slow_bend` for Liming Zhao, who was a postdoc in our lab
11 from 2008 to 2010.  Liming coated one side of an AFM cantilever with a
12 film of cellulose and used [[slow_bend.py]] (version 0.2) to monitor
13 the cantilever deflection as he flushed in different buffers
14 ([paper]).  Unfortunately, the paper claims the data aquisition was
15 carried out in LabView.
16
17 `slow_bend` is not a complicated program; it polls analog input
18 channels using [[pycomedi]] (and optionally reads temperatures using
19 backends from [[pypid]]).  The polling continues until `slow_bend`
20 recieves a [KeyboardInterrupt][].
21
22     $ slow_bend.py --version
23     0.4
24     $ slow_bend.py 0 3
25     #time (second)      chan 0 (bit)    chan 0 (volt)   chan 3 (bit)    chan 3 (volt)
26     1.81198e-05 34727   0.598001        39679   2.10925
27     4.00409     34956   0.667887        38033   1.60693
28     8.00408     35074   0.703899        36780   1.22454
29     12.0041     35041   0.693828        35814   0.929732
30     16.0041     34917   0.655985        35044   0.694743
31     ^C
32
33 [paper]: http://dx.doi.org/10.1002/bit.22754
34 [KeyboardInterrupt]: http://docs.python.org/library/exceptions.html#exceptions.KeyboardInterrupt
35
36 [[!tag tags/code]]
37 [[!tag tags/python]]