Ran update_copyright.py.
[hooke.git] / test / flat_filter_peaks.py
1 # Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
2 #
3 # This file is part of Hooke.
4 #
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.
9 #
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.
14 #
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/>.
18
19 """
20 >>> from hooke.hooke import Hooke, HookeRunner
21 >>> h = Hooke()
22 >>> r = HookeRunner()
23 >>> h = r.run_lines(h, ['load_playlist test/data/test']) # doctest: +ELLIPSIS
24 <FilePlaylist test.hkp>
25 Success
26 <BLANKLINE>
27 >>> h = r.run_lines(h,
28 ...     ['zero_surface_contact_point --block retract']
29 ...     ) # doctest: +ELLIPSIS, +REPORT_UDIFF
30 {'active fitted parameters':...}
31 Success
32 <BLANKLINE>
33 >>> h = r.run_lines(h, ['flat_filter_peaks --block retract']
34 ...     ) # doctest: +ELLIPSIS
35 [<Peak flat filter peak 0 of surface deflection 610 [ -1.156...e-09  -8.840...e-10  -3.173...e-10  -7.480...e-10]>]
36 Success
37 <BLANKLINE>
38 >>> curve = h.playlists.current().current()
39 >>> retract = curve.data[-1]
40 >>> retract.info['flat filter peaks']  # doctest: +ELLIPSIS
41 [<Peak flat filter peak 0 of surface deflection 610 [ -1.156...e-09  -8.840...e-10  -3.173...e-10  -7.480...e-10]>]
42 >>> retract.info['columns']
43 ['z piezo (m)', 'deflection (m)', 'surface distance (m)', 'surface deflection (m)', 'flat filter peaks (m)']
44 >>> retract[:5,-1]  # doctest: +ELLIPSIS
45 Data([-0., -0., -0., -0., -0.])
46 >>> retract[609:615,-1]  # doctest: +ELLIPSIS
47 Data([  0.000...e+00,   2.380...e-09,   9.747...e-10,
48         -2.266...e-10,   9.071...e-11,  -0.000...e+00])
49 >>> retract[-5:,-1]  # doctest: +ELLIPSIS
50 Data([-0., -0., -0., -0., -0.])
51 """