Added 'block info' to retrieve and export portions of Curve.data[*].info.
[hooke.git] / doc / tutorial.txt
index e24358fa08e9e2f5988b43f9321efc47d43520f2..13e06944eec3bccfaa3c887dabf62bc80cc3053f 100644 (file)
@@ -308,69 +308,24 @@ ways.::
     hooke> remove_cantilever_from_extension --block retract
     hooke> flat_peaks_to_polymer_peaks --block retract
     hooke> polymer_fit_peaks --block retract
+    hooke> block_info --block retract --output data.yaml name 'polymer peak [0-9]*'
 
 This stores the fit parameters in the block's
-:attr:`~hooke.curve.Data.info` dictionary (see each command's `Help`_
-for details).  To access the parameters, save the playlist,::
-
-    hooke> save_playlist --output mylist.hkp
-
-load it with PyYAML_::
+:attr:`~hooke.curve.Data.info` dictionary and also appends them to
+:file:`data.yaml` (see each command's `Help`_ for details).  To access
+the parameters, load :file:`data.yaml` with PyYAML_::
 
     $ python
     >>> import yaml
     >>> import hooke.util.yaml
-    >>> mylist = yaml.load(open('mylist.hkp', 'r'))
-
-navigate to your curve,::
-
-    >>> mylist.jump(1234)
+    >>> data = yaml.load(open('data.yaml', 'r'))
 
-and extract your parameter.::
+and extract your parameter::
 
-    >>> mylist.current().data[1].info['polymer peak 0']['contour length (m)']
+    >>> data['20071120a_i27_t33.100']['retract']['polymer peak 0']['contour length (m)']
     2.124...e-08
 
-You can also get a list of all available parameters::
-
-    >>> mylist.current().data[1].info['polymer peak 0'].keys()
-    ['model', 'contour length (m)', 'temperature (K)', 'fit',
-     'persistence length (m)']
-
-or just pprint_ the whole thing::
-
-    >>> from pprint import pprint
-    >>> pprint(mylist.current().data[1].info['polymer peak 0'])
-    {'contour length (m)': 2.1248220207858103e-08,
-     'fit': {'active fitted parameters': 3.7024307200788127,
-             'active parameters': 3.7024307200788127,
-             'convergence flag': 1,
-             'covariance matrix': None,
-             'data scale factor': 5.2716380732198972e-10,
-             'fitted parameters': -2.5663294148411571,
-             'info': {'fjac': None,
-                      'fvec': None,
-                      'ipvt': None,
-                      'nfev': 16,
-                      'qtf': None},
-             'initial parameters': [-0.69314718055994529],
-             'message': 'Both actual and predicted relative reductions in the sum of squares\n  are at most 0.000000',
-             'rescaled': True,
-             'scale': None},
-     'model': u'WLC',
-     'persistence length (m)': 4.0000000000000001e-10,
-     'temperature (K)': 301.0}
-
 .. _PyYAML: http://pyyaml.org/
-.. _pprint: http://docs.python.org/library/pprint.html
-
-.. todo:: UI access to block (and curve?) info dicts.  Someone should
-   make a tree-based object browser ;).
-
-.. todo:: Playlists currently drop all :class:`~hooke.curve.Data`
-   instances when they are unloaded, so you can't extract the fitted
-   parameters from unloaded curves.  We'll need a way to export chosen
-   curve attributes to file.
 
 Command stacks
 ~~~~~~~~~~~~~~
@@ -428,7 +383,7 @@ freely jointed chain fitting`_ and `Command stacks`_.::
     hooke> remove_cantilever_from_extension --block retract
     hooke> flat_peaks_to_polymer_peaks --block retract
     hooke> polymer_fit_peaks --block retract
-    hooke> export_block --block retract --output myblock.dat
+    hooke> block_info --block retract --output data.yaml name 'polymer peak [0-9]*'
     hooke> stop_command_capture
     hooke> apply_command_stack_to_playlist