1 # Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
3 # This file is part of Hooke.
5 # Hooke is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as
7 # published by the Free Software Foundation, either version 3 of the
8 # License, or (at your option) any later version.
10 # Hooke is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 # Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with Hooke. If not, see
17 # <http://www.gnu.org/licenses/>.
20 >>> from hooke.hooke import Hooke, HookeRunner
24 Setup a playlist to act on.
26 >>> h = r.run_lines(h, ['load_playlist test/data/vclamp_picoforce/playlist'])
27 <FilePlaylist PicoForce>
31 Build the command stack.
33 >>> h = r.run_lines(h, [
34 ... 'start_command_capture',
35 ... 'zero_surface_contact_point --block retract',
36 ... 'flat_filter_peaks --block retract --min_points 1',
37 ... 'zero_surface_contact_point --block retract --ignore_after_last_peak_info_name "flat filter peaks"',
38 ... 'convert_distance_to_force --block retract --deflection_column "surface deflection (m)"',
39 ... 'remove_cantilever_from_extension --block retract',
40 ... 'flat_peaks_to_polymer_peaks --block retract',
41 ... 'polymer_fit_peaks --block retract',
42 ... 'stop_command_capture',
43 ... ]) # doctest: +REPORT_UDIFF
63 Apply the command stack.
65 >>> h = r.run_lines(h, ['apply_command_stack_to_playlist'])
69 Verify successful application.
71 >>> curve = h.playlists.current().current()
73 <Curve 20071120a_i27_t33.100>
74 >>> for c in curve.command_stack:
75 ... print c # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE, +REPORT_UDIFF
76 <CommandMessage zero surface contact point {block: retract}>
77 <CommandMessage flat filter peaks {block: retract, min points: 1}>
78 <CommandMessage zero surface contact point {block: retract, ignore after last peak info name: flat filter peaks}>
79 <CommandMessage convert distance to force {block: retract, deflection column: surface deflection (m)}>
80 <CommandMessage remove cantilever from extension {block: retract}>
81 <CommandMessage flat peaks to polymer peaks {block: retract}>
82 <CommandMessage polymer fit peaks {block: retract}>
83 >>> for c in curve.data[-1].info['columns']:
84 ... print c # doctest: +REPORT_UDIFF
88 surface deflection (m)
91 cantilever adjusted extension (m)
93 >>> h.playlists.current().next()
94 >>> curve = h.playlists.current().current()
96 <Curve 20071120a_i27_t33.101>
97 >>> for c in curve.command_stack:
98 ... print c # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE, +REPORT_UDIFF
99 <CommandMessage zero surface contact point {block: retract}>
100 <CommandMessage flat filter peaks {block: retract, min points: 1}>
101 <CommandMessage zero surface contact point {block: retract, ignore after last peak info name: flat filter peaks}>
102 <CommandMessage convert distance to force {block: retract, deflection column: surface deflection (m)}>
103 <CommandMessage remove cantilever from extension {block: retract}>
104 <CommandMessage flat peaks to polymer peaks {block: retract}>
105 <CommandMessage polymer fit peaks {block: retract}>
106 >>> for c in curve.data[-1].info['columns']:
107 ... print c # doctest: +REPORT_UDIFF
111 surface deflection (m)
112 flat filter peaks (m)
114 cantilever adjusted extension (m)