11 years agoUpdate distance-measurement sections of doc/tutorial.txt and doc/gui.txt
W. Trevor King [Tue, 17 Aug 2010 10:57:44 +0000 (06:57 -0400)]
Update distance-measurement sections of doc/tutorial.txt and doc/gui.txt

11 years agoRemove export and distance sections from test/tutorial.py (they duplicate other test...
W. Trevor King [Tue, 17 Aug 2010 10:56:23 +0000 (06:56 -0400)]
Remove export and distance sections from test/tutorial.py (they duplicate other test/*s).

11 years agoUse UUID in test/config.py's output file name.
W. Trevor King [Tue, 17 Aug 2010 10:38:18 +0000 (06:38 -0400)]
Use UUID in test/config.py's output file name.

11 years agoBroke config section of test/tutorial.py out into test/config.py
W. Trevor King [Tue, 17 Aug 2010 10:29:34 +0000 (06:29 -0400)]
Broke config section of test/tutorial.py out into test/config.py

11 years agoAdded 'save config'. Adjusted test/tutorial.py (and test/ in general) passes.
W. Trevor King [Tue, 17 Aug 2010 04:02:33 +0000 (00:02 -0400)]
Added 'save config'.  Adjusted test/tutorial.py (and test/ in general) passes.

11 years agoUpdate test/flat_filter_playlist.py to explicitly specify input columns.
W. Trevor King [Tue, 17 Aug 2010 02:56:48 +0000 (22:56 -0400)]
Update test/flat_filter_playlist.py to explicitly specify input columns.

11 years agoUse 'simple' conversion handler to process 'file'-type JPK conversions.
W. Trevor King [Tue, 17 Aug 2010 02:17:26 +0000 (22:17 -0400)]
Use 'simple' conversion handler to process 'file'-type JPK conversions.

Michael Haggerty at JPK pointed out that the information from the
external file was already stored in the curve file.  He also confirmed
that my interpretation of the external calibration file format was
correct, although that no longer matters now that I've just removed
the 'file'-specific conversion code.

11 years agoMake file-format-version=0.5 support explicit in JPKDriver
W. Trevor King [Tue, 17 Aug 2010 01:47:25 +0000 (21:47 -0400)]
Make file-format-version=0.5 support explicit in JPKDriver

11 years agoConfirm big-endian binary data format for JPK files.
W. Trevor King [Tue, 17 Aug 2010 01:20:42 +0000 (21:20 -0400)]
Confirm big-endian binary data format for JPK files.

Michael Haggerty, JPK's head of software development, sent me their
file specs.  I'll add the specs themselves to our version control if I
get permission from them.

11 years agoAdd test/note.py and adjust playlist handling so NoteFilterCommand works again.
W. Trevor King [Tue, 17 Aug 2010 01:07:30 +0000 (21:07 -0400)]
Add test/note.py and adjust playlist handling so NoteFilterCommand works again.

11 years agoAdded hooke.util.itertools with reverse_enumerate
W. Trevor King [Mon, 16 Aug 2010 19:16:05 +0000 (15:16 -0400)]
Added hooke.util.itertools with reverse_enumerate

11 years agoDon't save Curve._hooke when pickling or deepcopying.
W. Trevor King [Mon, 16 Aug 2010 18:59:27 +0000 (14:59 -0400)]
Don't save Curve._hooke when pickling or deepcopying.

Two reasons:
1) It crashes because hooke.config._comment_textwrap contains a
   compiled regexp, and these cannot be deepcopied.  See
2) We don't want to copy Hooke instances anyway, since we need them to stay
   in sync.  Anything copying curves (e.g. Playlist.filter) should shallow
   copy Hooke instances between the curves.
If this turns up anywhere else, we should think about adding a
Curve.copy method to get the "just right" copy depth ;).

11 years agoAdjust test/tutorial.py to account for 4f4640207a50
W. Trevor King [Mon, 16 Aug 2010 18:53:06 +0000 (14:53 -0400)]
Adjust test/tutorial.py to account for 4f4640207a50

11 years agoAdjust test/polynomial_flatten.py to account for 01ff9349a0c6
W. Trevor King [Mon, 16 Aug 2010 18:51:28 +0000 (14:51 -0400)]
Adjust test/polynomial_flatten.py to account for 01ff9349a0c6

11 years agoAdjust test/flat_filter_peaks.py to account for 01ff9349a0c6
W. Trevor King [Mon, 16 Aug 2010 18:50:43 +0000 (14:50 -0400)]
Adjust test/flat_filter_peaks.py to account for 01ff9349a0c6

11 years agoUpgraded hooke.plugin.polymer_fit commands to ColumnAddingArgument subclasses.
W. Trevor King [Mon, 16 Aug 2010 16:33:39 +0000 (12:33 -0400)]
Upgraded hooke.plugin.polymer_fit commands to ColumnAddingArgument subclasses.

Now the following command works:

    $ bin/hk.py
        -c 'load_playlist test/data/test'
        -c 'zero_surface_contact_point --block retract'
        -c 'flat_filter_peaks --block retract --min_points 1'
        -c 'zero_surface_contact_point --block retract
                --ignore_after_last_peak_info_name "flat filter peaks"'
        -c 'convert_distance_to_force --block retract
                --deflection_column "surface deflection (m)"'
        -c 'remove_cantilever_from_extension --block retract'
        -c 'flat_peaks_to_polymer_peaks --block retract'
        -c 'polymer_fit_peaks --block retract'
        -c 'export_block --block retract --output myblock.dat'

See related commands in 725a18055518 and 27bf3c1e98e1.

11 years agoPoint to config.txt rather than hardcoding hooke.cfg in doc/gui.txt
W. Trevor King [Mon, 16 Aug 2010 16:29:27 +0000 (12:29 -0400)]
Point to config.txt rather than hardcoding hooke.cfg in doc/gui.txt

11 years agoRewrap a line in test/zero_surface_contact_point.py
W. Trevor King [Mon, 16 Aug 2010 16:01:44 +0000 (12:01 -0400)]
Rewrap a line in test/zero_surface_contact_point.py

11 years agoApply constant offset to contact region in 'polynomial flatten' to avoid discontinuity
W. Trevor King [Mon, 16 Aug 2010 16:00:43 +0000 (12:00 -0400)]
Apply constant offset to contact region in 'polynomial flatten' to avoid discontinuity

11 years agoFix playlist filename preservation for 'load playlist' and 'new playlist'
W. Trevor King [Mon, 16 Aug 2010 14:48:19 +0000 (10:48 -0400)]
Fix playlist filename preservation for 'load playlist' and 'new playlist'

11 years agoMove NoteFilterCommand from plugin.playlist to plugin.note.
W. Trevor King [Sun, 15 Aug 2010 22:17:40 +0000 (18:17 -0400)]
Move NoteFilterCommand from plugin.playlist to plugin.note.

11 years agoAdded test/tutorial.py. Works until you get to note_filter_playlist
W. Trevor King [Sun, 15 Aug 2010 14:41:18 +0000 (10:41 -0400)]
Added test/tutorial.py.  Works until you get to note_filter_playlist

11 years agoMention playlist navigation commands in doc/tutorial.txt
W. Trevor King [Sun, 15 Aug 2010 12:21:11 +0000 (08:21 -0400)]
Mention playlist navigation commands in doc/tutorial.txt

11 years agoFix existing Driver.is_me's crashes if path is a directory.
W. Trevor King [Sun, 15 Aug 2010 12:18:47 +0000 (08:18 -0400)]
Fix existing Driver.is_me's crashes if path is a directory.

I didn't add this at the curve level, since it seems reasonable that
someone might develop a curve format where the 'file' is a directory.

11 years agoLog a warning (rather than raising a Failure) on glob-loading a non-curve
W. Trevor King [Sun, 15 Aug 2010 12:11:47 +0000 (08:11 -0400)]
Log a warning (rather than raising a Failure) on glob-loading a non-curve

11 years agoUpdated tutorial's new_playlist call for new PlaylistAddingCommand syntax
W. Trevor King [Sun, 15 Aug 2010 12:02:23 +0000 (08:02 -0400)]
Updated tutorial's new_playlist call for new PlaylistAddingCommand syntax

11 years agoUse input name in 'new playlist' and 'load playlist' if p.name == None.
W. Trevor King [Sun, 15 Aug 2010 12:01:47 +0000 (08:01 -0400)]
Use input name in 'new playlist' and 'load playlist' if p.name == None.

11 years agoCleanups to playlist name handling in 'load playlist'.
W. Trevor King [Sun, 15 Aug 2010 11:52:01 +0000 (07:52 -0400)]
Cleanups to playlist name handling in 'load playlist'.

* push new curves to outqueue during 'glob curves to playlist'.
* 'new playlist' transitioned to a subclass of PlaylistAddingCommand.

11 years agoLowercase initial word in some log messages.
W. Trevor King [Sun, 15 Aug 2010 11:49:49 +0000 (07:49 -0400)]
Lowercase initial word in some log messages.

11 years agoAdd "or '.'" after dirname() calls in hooke.command_stack and .playlist.
W. Trevor King [Sun, 15 Aug 2010 11:48:46 +0000 (07:48 -0400)]
Add "or '.'" after dirname() calls in hooke.command_stack and .playlist.

  >>> import os.path
  >>> os.path.dirname('some-file')
  >>> os.path.dirname('some-file') or '.'
  >>> import os
  >>> os.makedirs('')
  Traceback (most recent call last):
  OSError: [Errno 2] No such file or directory: ''

11 years agobin/hooke -> bin/hk.py in setup.py. Thanks to amantedpaz for pointing this out.
W. Trevor King [Sun, 15 Aug 2010 11:12:43 +0000 (07:12 -0400)]
bin/hooke -> bin/hk.py in setup.py.  Thanks to amantedpaz for pointing this out.

11 years agoBring doc/config.txt up to speed
W. Trevor King [Sat, 14 Aug 2010 15:49:54 +0000 (11:49 -0400)]
Bring doc/config.txt up to speed

11 years agoAdded command stack saving and loading.
W. Trevor King [Sat, 14 Aug 2010 15:28:55 +0000 (11:28 -0400)]
Added command stack saving and loading.

11 years agoReplace .config rather than reconstructing plugins, drivers, and UIs.
W. Trevor King [Sat, 14 Aug 2010 15:28:00 +0000 (11:28 -0400)]
Replace .config rather than reconstructing plugins, drivers, and UIs.

The previous implementation destroyed any state the plugins, etc. were
holding.  For example, it cleared CommandStackPlugin.command_stack.

11 years agoFix p name collision bug in plugin.playlist.LoadCommand._run
W. Trevor King [Sat, 14 Aug 2010 13:19:59 +0000 (09:19 -0400)]
Fix p name collision bug in plugin.playlist.LoadCommand._run

11 years agoAdd logging import to hooke.ui
W. Trevor King [Sat, 14 Aug 2010 13:08:43 +0000 (09:08 -0400)]
Add logging import to hooke.ui

11 years agoUpdate (don't re-add) already loaded playlists in HookeFrame._postprocess_playlists
W. Trevor King [Sat, 14 Aug 2010 08:32:23 +0000 (04:32 -0400)]
Update (don't re-add) already loaded playlists in HookeFrame._postprocess_playlists

11 years agoDon't process unhandled arguments (e.g. 'driver') in HookeFrame.execute_command
W. Trevor King [Sat, 14 Aug 2010 08:20:33 +0000 (04:20 -0400)]
Don't process unhandled arguments (e.g. 'driver') in HookeFrame.execute_command

11 years agoFix self.command.name -> command.name in gui.HookeFrame.execute_command
W. Trevor King [Sat, 14 Aug 2010 08:11:26 +0000 (04:11 -0400)]
Fix self.command.name -> command.name in gui.HookeFrame.execute_command

11 years agoFix toolbar -> self._c['toolbar'] in gui.panel.plot on MS Windows.
W. Trevor King [Sat, 14 Aug 2010 08:08:04 +0000 (04:08 -0400)]
Fix toolbar -> self._c['toolbar'] in gui.panel.plot on MS Windows.

11 years agoOops, protect hk.py's hooke.main() call with if __name__ == '__main__'.
W. Trevor King [Sat, 14 Aug 2010 07:58:05 +0000 (03:58 -0400)]
Oops, protect hk.py's hooke.main() call with if __name__ == '__main__'.

*This* fixes amantedpaz' crash ;).

11 years agoRenamed bin/hooke -> bin/hk.py.
W. Trevor King [Sat, 14 Aug 2010 07:50:55 +0000 (03:50 -0400)]
Renamed bin/hooke -> bin/hk.py.

This fixes amantedpaz' crash from
It turned out to not be related to issue8534, as I'd originally thought.

The crash looked like:
  C:\hooke>c:\python26\python bin/hooke
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "c:\python26\lib\multiprocessing\forking.py", line 341, in main
    File "c:\python26\lib\multiprocessing\forking.py", line 450, in prepare
      file, path_name, etc = imp.find_module(main_name, dirs)
  ImportError: No module named hooke

11 years agoFleshed out hooke.plugin.command_stack except for save/load
W. Trevor King [Fri, 13 Aug 2010 16:34:25 +0000 (12:34 -0400)]
Fleshed out hooke.plugin.command_stack except for save/load

11 years agoRemove superfluous doctest comment from test/load_playlist.py
W. Trevor King [Fri, 13 Aug 2010 15:27:13 +0000 (11:27 -0400)]
Remove superfluous doctest comment from test/load_playlist.py

11 years agoLowercase initial word in some log messages.
W. Trevor King [Fri, 13 Aug 2010 15:26:27 +0000 (11:26 -0400)]
Lowercase initial word in some log messages.

11 years agoConsolidate UI command submission to hooke.ui.UserInterface._submit_command().
W. Trevor King [Fri, 13 Aug 2010 14:56:11 +0000 (10:56 -0400)]
Consolidate UI command submission to hooke.ui.UserInterface._submit_command().

Currently this just ensures standardized logging, but eventually it
will allow us to easily record command histories in a UI-agnostic way.

11 years agoRemoved hooke.compat.forking since issue8534 can't be monkey patched.
W. Trevor King [Fri, 13 Aug 2010 11:31:19 +0000 (07:31 -0400)]
Removed hooke.compat.forking since issue8534 can't be monkey patched.

You'll have to apply simonsteiner's issue8534 patch
to your Python's multiprocessing.forking by hand (on MS Windows).  See

Here's what happens on Linux:
  1) main program starts running
  2) monkey patch applied
  3) multiprocessing.Process() forks off the subprocess.
    a) child process inherits parent's memory, getting all currently
       imported libraries for free.
    b) child process continues successful run.
  4) main process continues successful run.

Here's what happens on MS Windows:
  1) main program starts running
  2) monkey patch applied
  3) multiprocessing.Process() spawns subprocess, feeding its pickling
     state to the child through the connecting socket.
    a) child process starts, loading (unpatched) base Python libraries
       to figure out what it should do.
    b) child process starts reading pickled parent state.
    c) child process attempts to find hooke to unpickle parent state.
    d) child process cannot find hooke (with unpatched
       multiprocessing) and dies.
  4) main process dies from lack of child.

After applying simonsteiner's issue8534 patch, Windows looks like:
  1) main program starts running
  2) multiprocessing.Process() spawns subprocess, feeding its pickling
     state to the child through the connecting socket.
    a) child process starts, loading (patched) base Python libraries
       to figure out what it should do.
    b) child process starts reading pickled parent state.
    c) child process attempts to find hooke to unpickle parent state.
    d) child process loads hooke.
    e) child process continues successful run.
  3) main process continues successful run.

11 years agoAdded log warnings on monkey patch imports
W. Trevor King [Fri, 13 Aug 2010 11:03:02 +0000 (07:03 -0400)]
Added log warnings on monkey patch imports

11 years agoUse the playlist's basename if it doesn't colide with earlier playlists.
W. Trevor King [Fri, 13 Aug 2010 02:08:24 +0000 (22:08 -0400)]
Use the playlist's basename if it doesn't colide with earlier playlists.

11 years agoRemove PlaylistArgument from plugin.playlist.SaveCommand now that it's a PlaylistCommand
W. Trevor King [Fri, 13 Aug 2010 01:55:38 +0000 (21:55 -0400)]
Remove PlaylistArgument from plugin.playlist.SaveCommand now that it's a PlaylistCommand

11 years agoAdded hooke.plugin.playlist.ApplyCommandStack and related changes.
W. Trevor King [Fri, 13 Aug 2010 01:38:04 +0000 (21:38 -0400)]
Added hooke.plugin.playlist.ApplyCommandStack and related changes.

* Added test/apply_command_stack.py testing the new command.
* Added hooke.plugin.playlist.PlaylistCommand mirroring CurveCommand.
* Added hooke.plugin.playlist.AddingPlaylistCommand mirroring
* Renamed CommandStack._execute -> .execute_command since it may be
  used externally.
* Changed assorted log messages to use CommandMessage string-ification.
* Set Hooke.engine to None in the UI process.
* Set ._index during NoteIndexList.items() iteration.

11 years agoAdded nicer CommandMessage string-ification methods
W. Trevor King [Thu, 12 Aug 2010 22:01:41 +0000 (18:01 -0400)]
Added nicer CommandMessage string-ification methods

11 years agoRename ./bin/hooke's --command-no-exit to --persist.
W. Trevor King [Thu, 12 Aug 2010 20:11:20 +0000 (16:11 -0400)]
Rename ./bin/hooke's --command-no-exit to --persist.

Inspired by the similar gnuplot option.  Certainly less awkward than
our old option.

11 years agoRemove unnecessary doctest comments from test/get_curve.py
W. Trevor King [Thu, 12 Aug 2010 18:11:53 +0000 (14:11 -0400)]
Remove unnecessary doctest comments from test/get_curve.py

11 years agoAdjust test/get_curve.py for Curve.__str__, etc. changes in d2317379f775
W. Trevor King [Thu, 12 Aug 2010 18:09:56 +0000 (14:09 -0400)]
Adjust test/get_curve.py for Curve.__str__, etc. changes in d2317379f775

11 years agoFix .split() -> .strip() typo in 'output peak column' arg for FlatPeaksCommand
W. Trevor King [Thu, 12 Aug 2010 18:08:12 +0000 (14:08 -0400)]
Fix .split() -> .strip() typo in 'output peak column' arg for FlatPeaksCommand

11 years agoAdd hooke.compat.forking to fix Python's ImportError issue8534.
W. Trevor King [Thu, 12 Aug 2010 17:59:26 +0000 (13:59 -0400)]
Add hooke.compat.forking to fix Python's ImportError issue8534.

multiprocessing can have problems importing modules from child processes.  See
Importing hooke.compat.forking fixes this bug dynamically.

11 years agoAdd successful Curve.command_stack maintenance.
W. Trevor King [Thu, 12 Aug 2010 17:15:29 +0000 (13:15 -0400)]
Add successful Curve.command_stack maintenance.

Now commands successfully track CurveCommands applied to them, and run
them again when they're reloaded.  Still to do:
* save/load .command_stacks with the playlist
* hooke.plugin.command_stack

11 years agoMove LocalHelpCommand and LocalExitCommand from ui.commandline to plugin.engine.
W. Trevor King [Thu, 12 Aug 2010 17:10:37 +0000 (13:10 -0400)]
Move LocalHelpCommand and LocalExitCommand from ui.commandline to plugin.engine.

It's not a good idea to have UI-specific commands that get sent down
to the CommandEngine.

11 years agoAdd --save-config to bin/hooke and don't silently save config file.
W. Trevor King [Thu, 12 Aug 2010 16:12:10 +0000 (12:12 -0400)]
Add --save-config to bin/hooke and don't silently save config file.

With the old implementation, setting --debug once would effectively
set it for all future calls :p.  There should be an explicit 'save
config' command if the user wishes to do so.

11 years agoChange CommandMessage.command from Command instance to command's name.
W. Trevor King [Thu, 12 Aug 2010 15:33:41 +0000 (11:33 -0400)]
Change CommandMessage.command from Command instance to command's name.

No sense in building up large numbers of Command copies if you're
passing CommandMessages through a multiprocess.Queue and storing them
in CommandStacks.

11 years agoAdd --debug option to bin/hooke and log CommandEngine.run_command()
W. Trevor King [Thu, 12 Aug 2010 15:12:29 +0000 (11:12 -0400)]
Add --debug option to bin/hooke and log CommandEngine.run_command()

11 years agoAdded CurveEngine.run_command and reorganized CommandStack._execute
W. Trevor King [Thu, 12 Aug 2010 15:02:06 +0000 (11:02 -0400)]
Added CurveEngine.run_command and reorganized CommandStack._execute

11 years agoInitial work on hooke.command_stack and hooke.playlist integration.
W. Trevor King [Thu, 12 Aug 2010 14:26:28 +0000 (10:26 -0400)]
Initial work on hooke.command_stack and hooke.playlist integration.

The current problem is figuring out how to run commands from a Curve
without Curves knowing about Hooke or CommandEngine instances.

11 years agoRemove superfluous ..plugin from imports in hooke.plugin.*
W. Trevor King [Thu, 12 Aug 2010 11:31:09 +0000 (07:31 -0400)]
Remove superfluous ..plugin from imports in hooke.plugin.*

11 years agoWe'll keep most command stack functionality in a new hooke.command_stack
W. Trevor King [Thu, 12 Aug 2010 11:25:56 +0000 (07:25 -0400)]
We'll keep most command stack functionality in a new hooke.command_stack

11 years agoMoved QueueMessage and subclasses from hooke.ui to the more central hooke.engine.
W. Trevor King [Thu, 12 Aug 2010 11:16:19 +0000 (07:16 -0400)]
Moved QueueMessage and subclasses from hooke.ui to the more central hooke.engine.

11 years agoRemove superflous ~ from flatfilt docstring.
W. Trevor King [Thu, 12 Aug 2010 11:09:21 +0000 (07:09 -0400)]
Remove superflous ~ from flatfilt docstring.

11 years agoRenamed hooke.plugin.macro -> hooke.plugin.command_stack
W. Trevor King [Thu, 12 Aug 2010 11:02:11 +0000 (07:02 -0400)]
Renamed hooke.plugin.macro -> hooke.plugin.command_stack

11 years agoRestored hooke.plugin.macro from revision a008bd5c28ca.
W. Trevor King [Thu, 12 Aug 2010 11:01:12 +0000 (07:01 -0400)]
Restored hooke.plugin.macro from revision a008bd5c28ca.

It had been removed in the subsequent commit:
  changeset:   519:928a1a2f6041
  branch:      wtk
  user:        W. Trevor King <wking@drexel.edu>
  date:        Sat Aug 07 11:45:12 2010 -0400
  files:       conf/macro.conf hooke/plugin/__init__.py hooke/plugin/macro.py
  description: Remove macro plugin.

In the commit comments, I explain that the hooke command line lacks
flexibility for function definition (e.g. no variables).  However, you
can do a number of things by chaining commands together, so I'm
bringing back the macro plugin.  I intend to reimagine macros as
editable "command stacks", which will allow for
* flexible loops
* undo/redo recent changes
* preserving processing through playlist save/load cycles.

This will get us most of the way to the goals expressed in commit
725a18055518 and a useful Hooke :).

11 years agoUpdated FlatFilterCommand's argument handling.
W. Trevor King [Wed, 11 Aug 2010 23:46:46 +0000 (19:46 -0400)]
Updated FlatFilterCommand's argument handling.

11 years agoMore detailed misnamed column error in ColumnAccessCommand._get_column
W. Trevor King [Wed, 11 Aug 2010 22:06:56 +0000 (18:06 -0400)]
More detailed misnamed column error in ColumnAccessCommand._get_column

11 years agoFix '@Sens. ZSensorSens' KeyError loading picoforce 0x07200000 curves.
W. Trevor King [Wed, 11 Aug 2010 21:48:26 +0000 (17:48 -0400)]
Fix '@Sens. ZSensorSens' KeyError loading picoforce 0x07200000 curves.

Regression from 93e0e4284534.  Of course, we still don't know where
the z-data is in the 0x07200000 curves,
so its hard to know if this is the right sensitivity.  It doesn't
crash anyway...

11 years agoUpdated FlatPeaksCommand to ColumnAddingCommand.
W. Trevor King [Wed, 11 Aug 2010 21:11:18 +0000 (17:11 -0400)]
Updated FlatPeaksCommand to ColumnAddingCommand.

11 years agoUpdated vclamp to use new ColumnAddingCommand.
W. Trevor King [Wed, 11 Aug 2010 20:25:47 +0000 (16:25 -0400)]
Updated vclamp to use new ColumnAddingCommand.

Also added 'ignore after last peak info name' argument to

This allows for the two-cycle surface detection mentioned in commit

  ./bin/hooke -c 'load_playlist test/data/vclamp_wtk/playlist'
              -c 'zero_surface_contact_point --block retract'
              -c 'flat_filter_peaks --block retract --min_points 1'
              -c 'zero_surface_contact_point --block retract
              --ignore_after_last_peak_info_name "flat filter peaks"'
              -c 'convert_distance_to_force --block retract'
              -c 'remove_cantilever_from_extension --block retract'
              -c 'flat_peaks_to_polymer_peaks --block retract'
              -c 'polymer_fit_peaks --block retract' --command-no-exit

Note that `flat filter peaks`, `flat peaks to polymer peaks`, and
`polymer fit peaks` still need to be updated to ColumnAddingCommand
subclasses.  Also, I might be missing a few column renames in the
above command.  I'll include a working (and tested) command once I get
the other plugins up to speed with ColumnAddingCommand.

11 years agoAdd CurveCommand, BlockCommand, ColumnAccessCommand, and ColumnAddingCommand.
W. Trevor King [Wed, 11 Aug 2010 18:09:22 +0000 (14:09 -0400)]
Add CurveCommand, BlockCommand, ColumnAccessCommand, and ColumnAddingCommand.

Added to hooke.plugin.curve.  These abstract out the boring
bookkeeping from many commands (so far only the ones in plugin.curve).

Also add test/derivative.py and rework hooke.util.calculus.derivative
to be less block-centric.

11 years agoAdd test/difference.py
W. Trevor King [Wed, 11 Aug 2010 17:45:22 +0000 (13:45 -0400)]
Add test/difference.py

11 years agoAdd test/export_block.py
W. Trevor King [Wed, 11 Aug 2010 17:37:29 +0000 (13:37 -0400)]
Add test/export_block.py

11 years agoAdd test/delta.py
W. Trevor King [Wed, 11 Aug 2010 17:25:46 +0000 (13:25 -0400)]
Add test/delta.py

11 years agoAdd test/get_curve.py
W. Trevor King [Wed, 11 Aug 2010 17:23:12 +0000 (13:23 -0400)]
Add test/get_curve.py

11 years agoRemove outdated type TODOs from hooke/command (conversion handled by UIs).
W. Trevor King [Wed, 11 Aug 2010 17:20:10 +0000 (13:20 -0400)]
Remove outdated type TODOs from hooke/command (conversion handled by UIs).

11 years agoPrint tutorial init message to stderr so it won't interfere with doctests.
W. Trevor King [Wed, 11 Aug 2010 17:19:05 +0000 (13:19 -0400)]
Print tutorial init message to stderr so it won't interfere with doctests.

  nosetests --with-doctest --doctest-tests test/curve_info.py

11 years agoAllow fallback to XeX notation for efor extreme powers in ppSI
W. Trevor King [Wed, 11 Aug 2010 13:58:09 +0000 (09:58 -0400)]
Allow fallback to XeX notation for efor extreme powers in ppSI

11 years agoRemove post-fit L/N conversions from polymer_fit.py (handled in .fit() now).
W. Trevor King [Wed, 11 Aug 2010 13:57:19 +0000 (09:57 -0400)]
Remove post-fit L/N conversions from polymer_fit.py (handled in .fit() now).

11 years agoAdd 'ignore index' argument to SurfaceContactCommand
W. Trevor King [Wed, 11 Aug 2010 13:46:02 +0000 (09:46 -0400)]
Add 'ignore index' argument to SurfaceContactCommand

11 years agoWe don't seem to need to guess the scale in SurfacePositionModel
W. Trevor King [Wed, 11 Aug 2010 13:31:58 +0000 (09:31 -0400)]
We don't seem to need to guess the scale in SurfacePositionModel

11 years agoUpdate ModelFitters in polymer_fit.py to match new diag/scale interpretation.
W. Trevor King [Wed, 11 Aug 2010 13:30:28 +0000 (09:30 -0400)]
Update ModelFitters in polymer_fit.py to match new diag/scale interpretation.

11 years agoUpdate SurfacePositionModel to match new diag/scale interpretation.
W. Trevor King [Wed, 11 Aug 2010 13:12:27 +0000 (09:12 -0400)]
Update SurfacePositionModel to match new diag/scale interpretation.

11 years agoOops, correct my faulty interpretation of leastsq's 'diag' argument in fit.py
W. Trevor King [Wed, 11 Aug 2010 13:11:36 +0000 (09:11 -0400)]
Oops, correct my faulty interpretation of leastsq's 'diag' argument in fit.py

11 years agoAdd TranslateFlatPeaksCommand.
W. Trevor King [Tue, 10 Aug 2010 20:32:31 +0000 (16:32 -0400)]
Add TranslateFlatPeaksCommand.

This completes a simple velocity clamp force analysis approach.  Consider:

  ./bin/hooke -c 'load_playlist test/data/test'
              -c 'zero_block_surface_contact_point --block 1'
              -c 'add_flattened_extension_array --block 1 --max_degree 1
                      --input_deflection_column "surface deflection (m)"'
              -c 'add_block_force_array --block 1
                      --input_deflection_column "flattened deflection (m)"'
              -c 'add_block_cantilever_adjusted_extension_array --block 1'
              -c 'flat_filter_peaks --min_points 1'
              -c 'flat_peaks_to_polymer_peaks --block 1'
              -c 'polymer_fit_peaks --block 1'

Still to come:
* Better contact point fitting or flattening, since the above method
  currently does a pretty bad job with the actual WLCs.  Perhaps a
  WLC-based zeroing could lead a second fitting iteration.
* A way to apply grouped commands like this to each curve in a playlist.
* Saving dicts in the playlist format or changing formats so the WLC
  fitting parameters are accessible for further analysis (e.g. with
  sawsim: http://dx.doi.org/10.1016/j.ijbiomac.2009.12.001 ).

11 years agoAdjust GUI initialization to handle already loaded playlists (via --command-no-exit...
W. Trevor King [Tue, 10 Aug 2010 20:16:37 +0000 (16:16 -0400)]
Adjust GUI initialization to handle already loaded playlists (via --command-no-exit, etc.)

11 years agoFix tree method exposure in playlist GUI pansl
W. Trevor King [Tue, 10 Aug 2010 20:15:50 +0000 (16:15 -0400)]
Fix tree method exposure in playlist GUI pansl

11 years agoAdd --command-no-exit to bin/hooke, making hardcoded testing calls to execute_command...
W. Trevor King [Tue, 10 Aug 2010 19:49:48 +0000 (15:49 -0400)]
Add --command-no-exit to bin/hooke, making hardcoded testing calls to execute_command() in gui superfluous.

11 years agoLog execution debug messages from the commandline UI (matching the GUI).
W. Trevor King [Tue, 10 Aug 2010 19:42:35 +0000 (15:42 -0400)]
Log execution debug messages from the commandline UI (matching the GUI).

11 years agoSet hand1 logging handler level to WARN by default (avoids DEBUG clutter, etc.)
W. Trevor King [Tue, 10 Aug 2010 19:41:53 +0000 (15:41 -0400)]
Set hand1 logging handler level to WARN by default (avoids DEBUG clutter, etc.)

11 years agoLog warning for invalid section/option settings
W. Trevor King [Tue, 10 Aug 2010 19:23:10 +0000 (15:23 -0400)]
Log warning for invalid section/option settings

11 years agoUse numpy.nan to hide unfit portions of polymer tension columns.
W. Trevor King [Tue, 10 Aug 2010 17:10:40 +0000 (13:10 -0400)]
Use numpy.nan to hide unfit portions of polymer tension columns.

11 years agoMake ModelFitter._data_scale_factor determination more robust with wierd data.
W. Trevor King [Tue, 10 Aug 2010 17:09:44 +0000 (13:09 -0400)]
Make ModelFitter._data_scale_factor determination more robust with wierd data.

11 years agoAdd 'polymer fit' error reporting to PolymerFitPeaksCommand
W. Trevor King [Tue, 10 Aug 2010 15:57:04 +0000 (11:57 -0400)]
Add 'polymer fit' error reporting to PolymerFitPeaksCommand

11 years agoAdded PolymerFitPeaksCommand to hooke.plugin.polymer_fit
W. Trevor King [Tue, 10 Aug 2010 15:49:13 +0000 (11:49 -0400)]
Added PolymerFitPeaksCommand to hooke.plugin.polymer_fit