Index: sansdataloader/docs/sphinx/html/api/manipulations.html
===================================================================
--- sansdataloader/docs/sphinx/html/api/manipulations.html	(revision fc5d49e32e7ffb99bb9ff1bece362a93d660306b)
+++ sansdataloader/docs/sphinx/html/api/manipulations.html	(revision fc5d49e32e7ffb99bb9ff1bece362a93d660306b)
@@ -0,0 +1,354 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>manipulations &mdash; DataLoader v0.1.0 documentation</title>
+    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../',
+        VERSION:     '0.1.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../_static/jquery.js"></script>
+    <script type="text/javascript" src="../_static/underscore.js"></script>
+    <script type="text/javascript" src="../_static/doctools.js"></script>
+    <link rel="top" title="DataLoader v0.1.0 documentation" href="../index.html" />
+    <link rel="up" title="Reference" href="index.html" />
+    <link rel="next" title="qsmearing" href="qsmearing.html" />
+    <link rel="prev" title="loader" href="loader.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li class="right" >
+          <a href="qsmearing.html" title="qsmearing"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="loader.html" title="loader"
+             accesskey="P">previous</a> |</li>
+        <li><a href="../index.html">DataLoader v0.1.0 documentation</a> &raquo;</li>
+          <li><a href="index.html" accesskey="U">Reference</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <div class="section" id="manipulations">
+<h1>manipulations<a class="headerlink" href="#manipulations" title="Permalink to this headline">Â¶</a></h1>
+<div class="section" id="module-DataLoader.manipulations">
+<span id="dataloader-manipulations"></span><h2><a class="reference internal" href="#module-DataLoader.manipulations" title="DataLoader.manipulations"><tt class="xref py py-mod docutils literal"><span class="pre">DataLoader.manipulations</span></tt></a><a class="headerlink" href="#module-DataLoader.manipulations" title="Permalink to this headline">Â¶</a></h2>
+<p>Data manipulations for 2D data sets.
+Using the meta data information, various types of averaging
+are performed in Q-space</p>
+<dl class="class">
+<dt id="DataLoader.manipulations.Boxavg">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">Boxavg</tt><big>(</big><em>x_min=0.0</em>, <em>x_max=0.0</em>, <em>y_min=0.0</em>, <em>y_max=0.0</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.Boxavg" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <a class="reference internal" href="#DataLoader.manipulations.Boxsum" title="DataLoader.manipulations.Boxsum"><tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations.Boxsum</span></tt></a></p>
+<p>Perform the average of counts in a 2D region of interest.</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.Boxcut">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">Boxcut</tt><big>(</big><em>x_min=0.0</em>, <em>x_max=0.0</em>, <em>y_min=0.0</em>, <em>y_max=0.0</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.Boxcut" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Find a rectangular 2D region of interest.</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.Boxsum">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">Boxsum</tt><big>(</big><em>x_min=0.0</em>, <em>x_max=0.0</em>, <em>y_min=0.0</em>, <em>y_max=0.0</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.Boxsum" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Perform the sum of counts in a 2D region of interest.</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.CircularAverage">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">CircularAverage</tt><big>(</big><em>r_min=0.0</em>, <em>r_max=0.0</em>, <em>bin_width=0.00050000000000000001</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.CircularAverage" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Perform circular averaging on 2D data</p>
+<p>The data returned is the distribution of counts
+as a function of Q</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.Ring">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">Ring</tt><big>(</big><em>r_min=0</em>, <em>r_max=0</em>, <em>center_x=0</em>, <em>center_y=0</em>, <em>nbins=20</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.Ring" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Defines a ring on a 2D data set.
+The ring is defined by r_min, r_max, and
+the position of the center of the ring.</p>
+<p>The data returned is the distribution of counts
+around the ring as a function of phi.</p>
+<p>Phi_min and phi_max should be defined between 0 and 2*pi 
+in anti-clockwise starting from the x- axis on the left-hand side</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.Ringcut">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">Ringcut</tt><big>(</big><em>r_min=0</em>, <em>r_max=0</em>, <em>center_x=0</em>, <em>center_y=0</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.Ringcut" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Defines a ring on a 2D data set.
+The ring is defined by r_min, r_max, and
+the position of the center of the ring.</p>
+<p>The data returned is the region inside the ring</p>
+<p>Phi_min and phi_max should be defined between 0 and 2*pi 
+in anti-clockwise starting from the x- axis on the left-hand side</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.SectorPhi">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">SectorPhi</tt><big>(</big><em>r_min</em>, <em>r_max</em>, <em>phi_min=0</em>, <em>phi_max=6.2831853071795862</em>, <em>nbins=20</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.SectorPhi" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Sector</span></tt></p>
+<p>Sector average as a function of phi.
+I(phi) is return and the data is averaged over Q.</p>
+<p>A sector is defined by r_min, r_max, phi_min, phi_max.
+The number of bin in phi also has to be defined.</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.SectorQ">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">SectorQ</tt><big>(</big><em>r_min</em>, <em>r_max</em>, <em>phi_min=0</em>, <em>phi_max=6.2831853071795862</em>, <em>nbins=20</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.SectorQ" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Sector</span></tt></p>
+<p>Sector average as a function of Q for both symatric wings.
+I(Q) is return and the data is averaged over phi.</p>
+<p>A sector is defined by r_min, r_max, phi_min, phi_max.
+r_min, r_max, phi_min, phi_max &gt;0.  
+The number of bin in Q also has to be defined.</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.Sectorcut">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">Sectorcut</tt><big>(</big><em>phi_min=0</em>, <em>phi_max=3.1415926535897931</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.Sectorcut" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Defines a sector (major + minor) region on a 2D data set.
+The sector is defined by phi_min, phi_max,
+where phi_min and phi_max are defined by the right 
+and left lines wrt central line.</p>
+<p>Phi_min and phi_max are given in units of radian 
+and (phi_max-phi_min) should not be larger than pi</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.SlabX">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">SlabX</tt><big>(</big><em>x_min=0.0</em>, <em>x_max=0.0</em>, <em>y_min=0.0</em>, <em>y_max=0.0</em>, <em>bin_width=0.001</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.SlabX" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Slab</span></tt></p>
+<p>Compute average I(Qx) for a region of interest</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="DataLoader.manipulations.SlabY">
+<em class="property">class </em><tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">SlabY</tt><big>(</big><em>x_min=0.0</em>, <em>x_max=0.0</em>, <em>y_min=0.0</em>, <em>y_max=0.0</em>, <em>bin_width=0.001</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.SlabY" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Slab</span></tt></p>
+<p>Compute average I(Qy) for a region of interest</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="DataLoader.manipulations.flip_phi">
+<tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">flip_phi</tt><big>(</big><em>phi</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.flip_phi" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Correct phi to within the 0 &lt;= to &lt;= 2pi range</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Returns:</th><td class="field-body">phi in &gt;=0 and &lt;=2Pi</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="DataLoader.manipulations.get_intercept">
+<tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">get_intercept</tt><big>(</big><em>q</em>, <em>q_0</em>, <em>q_1</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.get_intercept" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Returns the fraction of the side at which the
+q-value intercept the pixel, None otherwise.
+The values returned is the fraction ON THE SIDE
+OF THE LOWEST Q.</p>
+<div class="highlight-python"><pre>    A           B    
++-----------+--------+    &lt;--- pixel size
+0                    1     
+Q_0 -------- Q ----- Q_1   &lt;--- equivalent Q range
+if Q_1 &gt; Q_0, A is returned
+if Q_1 &lt; Q_0, B is returned
+if Q is outside the range of [Q_0, Q_1], None is returned</pre>
+</div>
+</dd></dl>
+
+<dl class="function">
+<dt id="DataLoader.manipulations.get_pixel_fraction">
+<tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">get_pixel_fraction</tt><big>(</big><em>qmax</em>, <em>q_00</em>, <em>q_01</em>, <em>q_10</em>, <em>q_11</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.get_pixel_fraction" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Returns the fraction of the pixel defined by
+the four corners (q_00, q_01, q_10, q_11) that 
+has q &lt; qmax.:</p>
+<div class="highlight-python"><pre>        q_01                q_11
+y=1         +--------------+
+            |              |
+            |              |
+            |              |
+y=0         +--------------+
+        q_00                q_10
+
+            x=0            x=1</pre>
+</div>
+</dd></dl>
+
+<dl class="function">
+<dt id="DataLoader.manipulations.get_pixel_fraction_square">
+<tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">get_pixel_fraction_square</tt><big>(</big><em>x</em>, <em>xmin</em>, <em>xmax</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.get_pixel_fraction_square" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>Return the fraction of the length 
+from xmin to x.:</p>
+<div class="highlight-python"><pre>    A            B
++-----------+---------+
+xmin        x         xmax</pre>
+</div>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>x</strong> &#8211; x-value</li>
+<li><strong>xmin</strong> &#8211; minimum x for the length considered</li>
+<li><strong>xmax</strong> &#8211; minimum x for the length considered</li>
+</ul>
+</td>
+</tr>
+<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">(x-xmin)/(xmax-xmin) when xmin &lt; x &lt; xmax</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="DataLoader.manipulations.get_q">
+<tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">get_q</tt><big>(</big><em>dx</em>, <em>dy</em>, <em>det_dist</em>, <em>wavelength</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.get_q" title="Permalink to this definition">Â¶</a></dt>
+<dd><table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>dx</strong> &#8211; x-distance from beam center [mm]</li>
+<li><strong>dy</strong> &#8211; y-distance from beam center [mm]</li>
+</ul>
+</td>
+</tr>
+<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">q-value at the given position</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="DataLoader.manipulations.get_q_compo">
+<tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">get_q_compo</tt><big>(</big><em>dx</em>, <em>dy</em>, <em>det_dist</em>, <em>wavelength</em>, <em>compo=None</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.get_q_compo" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>This reduces tiny error at very large q.
+Implementation of this func is not started yet.&lt;&#8211;ToDo</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="DataLoader.manipulations.reader2D_converter">
+<tt class="descclassname">DataLoader.manipulations.</tt><tt class="descname">reader2D_converter</tt><big>(</big><em>data2d=None</em><big>)</big><a class="headerlink" href="#DataLoader.manipulations.reader2D_converter" title="Permalink to this definition">Â¶</a></dt>
+<dd><p>convert old 2d format opened by IhorReader or danse_reader
+to new Data2D format</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data2d</strong> &#8211; 2d array of Data2D object</td>
+</tr>
+<tr class="field"><th class="field-name">Returns:</th><td class="field-body">1d arrays of Data2D object</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</div>
+</div>
+
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+  <h3><a href="../index.html">Table Of Contents</a></h3>
+  <ul>
+<li><a class="reference internal" href="#">manipulations</a><ul>
+<li><a class="reference internal" href="#module-DataLoader.manipulations"><tt class="docutils literal"><span class="pre">DataLoader.manipulations</span></tt></a></li>
+</ul>
+</li>
+</ul>
+
+  <h4>Previous topic</h4>
+  <p class="topless"><a href="loader.html"
+                        title="previous chapter">loader</a></p>
+  <h4>Next topic</h4>
+  <p class="topless"><a href="qsmearing.html"
+                        title="next chapter">qsmearing</a></p>
+  <h3>This Page</h3>
+  <ul class="this-page-menu">
+    <li><a href="../_sources/api/manipulations.txt"
+           rel="nofollow">Show Source</a></li>
+  </ul>
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../search.html" method="get">
+      <input type="text" name="q" size="18" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li class="right" >
+          <a href="qsmearing.html" title="qsmearing"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="loader.html" title="loader"
+             >previous</a> |</li>
+        <li><a href="../index.html">DataLoader v0.1.0 documentation</a> &raquo;</li>
+          <li><a href="index.html" >Reference</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2010, sans group.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
+    </div>
+  </body>
+</html>
