From c87c0a95649ed795ae15f343b5a7ce98645e4dc5 Mon Sep 17 00:00:00 2001 From: Blaise Thompson Date: Thu, 22 Mar 2018 22:11:26 -0500 Subject: 2018-03-22 22:11 --- processing/chapter.tex | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'processing') diff --git a/processing/chapter.tex b/processing/chapter.tex index 3225624..72d1d27 100644 --- a/processing/chapter.tex +++ b/processing/chapter.tex @@ -281,6 +281,51 @@ Also consider using the fit sub-package. % TODO: more info, link to section Chop is one of the most important methods of data, although it is typically not called directly by users of WrightTools. % +Chop takes n-dimensional data and ``chops'' it into all of it's lower dimensional components. % +Consider a 3D dataset in \python{('wm', 'w2', 'w1')}. % +This dataset can be chopped to it's component 2D \python{('wm', 'w1')} spectra. % +\begin{codefragment}{python, label=test_label} +>>> import WrightTools as wt; from WrightTools import datasets +>>> data = wt.data.from_PyCMDS(datasets.PyCMDS.wm_w2_w1_000) +data created at /tmp/lzyjg4au.wt5::/ + axes ('wm', 'w2', 'w1') + shape (35, 11, 11) +>>> chopped = data.chop('wm', 'w1') +chopped data into 11 piece(s) in ('wm', 'w1') +>>> chopped.chop000 + +\end{codefragment} +\python{chopped} is a collection containing 11 data objects: \python{chop000, chop001 ... + chop010}. % +Note that, by default, the collection is made at the root level of a new tempfile. % +An optional keyword argument \python{parent} allows users to specify the destination for this new +collection. % +These lower dimensional data objects can then be used in plotting routines, fitting routines etc. % + +By default, chop returns \emph{all} of the lower dimensional slices. % +Considering the same data object from \autoref{test_label}, we can choose to get all 1D wm +slices. % +\begin{codefragment}{python} +>>> chopped = data.chop('wm') +chopped data into 121 piece(s) in ('wm',) +>>> chopped.chop000 + +\end{codefragment} + +If desired, users may use the \python{at} keyword argument to specify a particular coordinate in +the un-retained dimensions. % +For example, suppose that you want to plot the data from \ref{test_label} as an wm, w1 plot at +w2 = 1580 wn. % +\begin{codefragment}{python} +>>> chopped = data.chop('wm', 'w1', at={'w2': [1580, 'wn']})[0] +chopped data into 1 piece(s) in ('wm', 'w1') +>>> chopped + +>>> chopped.w2.points +array([1580.0]) +\end{codefragment} +Note the [0]... % TODO +This same syntax used in artists... % TODO \subsubsection{Collapse} -- cgit v1.2.3