source: sasview/DataLoader/docs/sphinx/_build/html/api/manipulations.html @ 6c79243

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 6c79243 was 0997158f, checked in by Gervaise Alina <gervyh@…>, 14 years ago

working on documentation

  • Property mode set to 100644
File size: 18.5 KB
RevLine 
[0997158f]1
2
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6<html xmlns="http://www.w3.org/1999/xhtml">
7  <head>
8    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9   
10    <title>manipulations &mdash; DataLoader v0.1.0 documentation</title>
11    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
12    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13    <script type="text/javascript">
14      var DOCUMENTATION_OPTIONS = {
15        URL_ROOT:    '../',
16        VERSION:     '0.1.0',
17        COLLAPSE_INDEX: false,
18        FILE_SUFFIX: '.html',
19        HAS_SOURCE:  true
20      };
21    </script>
22    <script type="text/javascript" src="../_static/jquery.js"></script>
23    <script type="text/javascript" src="../_static/underscore.js"></script>
24    <script type="text/javascript" src="../_static/doctools.js"></script>
25    <link rel="top" title="DataLoader v0.1.0 documentation" href="../index.html" />
26    <link rel="up" title="Reference" href="index.html" />
27    <link rel="next" title="qsmearing" href="qsmearing.html" />
28    <link rel="prev" title="data_info" href="data_info.html" /> 
29  </head>
30  <body>
31    <div class="related">
32      <h3>Navigation</h3>
33      <ul>
34        <li class="right" style="margin-right: 10px">
35          <a href="../genindex.html" title="General Index"
36             accesskey="I">index</a></li>
37        <li class="right" >
38          <a href="../py-modindex.html" title="Python Module Index"
39             >modules</a> |</li>
40        <li class="right" >
41          <a href="qsmearing.html" title="qsmearing"
42             accesskey="N">next</a> |</li>
43        <li class="right" >
44          <a href="data_info.html" title="data_info"
45             accesskey="P">previous</a> |</li>
46        <li><a href="../index.html">DataLoader v0.1.0 documentation</a> &raquo;</li>
47          <li><a href="index.html" accesskey="U">Reference</a> &raquo;</li> 
48      </ul>
49    </div> 
50
51    <div class="document">
52      <div class="documentwrapper">
53        <div class="bodywrapper">
54          <div class="body">
55           
56  <div class="section" id="manipulations">
57<h1>manipulations<a class="headerlink" href="#manipulations" title="Permalink to this headline">¶</a></h1>
58<div class="section" id="module-DataLoader.manipulations">
59<span id="dataloader-manipulations"></span><h2><a class="reference internal" href="#module-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>
60<p>Data manipulations for 2D data sets.
61Using the meta data information, various types of averaging
62are performed in Q-space</p>
63<dl class="class">
64<dt id="DataLoader.manipulations.Boxavg">
65<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>
66<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>
67<p>Perform the average of counts in a 2D region of interest.</p>
68</dd></dl>
69
70<dl class="class">
71<dt id="DataLoader.manipulations.Boxcut">
72<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>
73<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
74<p>Find a rectangular 2D region of interest.</p>
75</dd></dl>
76
77<dl class="class">
78<dt id="DataLoader.manipulations.Boxsum">
79<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>
80<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
81<p>Perform the sum of counts in a 2D region of interest.</p>
82</dd></dl>
83
84<dl class="class">
85<dt id="DataLoader.manipulations.CircularAverage">
86<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>
87<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
88<p>Perform circular averaging on 2D data</p>
89<p>The data returned is the distribution of counts
90as a function of Q</p>
91</dd></dl>
92
93<dl class="class">
94<dt id="DataLoader.manipulations.Ring">
95<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>
96<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
97<p>Defines a ring on a 2D data set.
98The ring is defined by r_min, r_max, and
99the position of the center of the ring.</p>
100<p>The data returned is the distribution of counts
101around the ring as a function of phi.</p>
102<p>Phi_min and phi_max should be defined between 0 and 2*pi
103in anti-clockwise starting from the x- axis on the left-hand side</p>
104</dd></dl>
105
106<dl class="class">
107<dt id="DataLoader.manipulations.Ringcut">
108<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>
109<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
110<p>Defines a ring on a 2D data set.
111The ring is defined by r_min, r_max, and
112the position of the center of the ring.</p>
113<p>The data returned is the region inside the ring</p>
114<p>Phi_min and phi_max should be defined between 0 and 2*pi
115in anti-clockwise starting from the x- axis on the left-hand side</p>
116</dd></dl>
117
118<dl class="class">
119<dt id="DataLoader.manipulations.SectorPhi">
120<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>
121<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Sector</span></tt></p>
122<p>Sector average as a function of phi.
123I(phi) is return and the data is averaged over Q.</p>
124<p>A sector is defined by r_min, r_max, phi_min, phi_max.
125The number of bin in phi also has to be defined.</p>
126</dd></dl>
127
128<dl class="class">
129<dt id="DataLoader.manipulations.SectorQ">
130<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>
131<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Sector</span></tt></p>
132<p>Sector average as a function of Q for both symatric wings.
133I(Q) is return and the data is averaged over phi.</p>
134<p>A sector is defined by r_min, r_max, phi_min, phi_max.
135r_min, r_max, phi_min, phi_max &gt;0. 
136The number of bin in Q also has to be defined.</p>
137</dd></dl>
138
139<dl class="class">
140<dt id="DataLoader.manipulations.Sectorcut">
141<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>
142<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
143<p>Defines a sector (major + minor) region on a 2D data set.
144The sector is defined by phi_min, phi_max,
145where phi_min and phi_max are defined by the right and left lines wrt central line.</p>
146<p>Phi_min and phi_max are given in units of radian
147and (phi_max-phi_min) should not be larger than pi</p>
148</dd></dl>
149
150<dl class="class">
151<dt id="DataLoader.manipulations.SlabX">
152<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>
153<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Slab</span></tt></p>
154<p>Compute average I(Qx) for a region of interest</p>
155</dd></dl>
156
157<dl class="class">
158<dt id="DataLoader.manipulations.SlabY">
159<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>
160<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Slab</span></tt></p>
161<p>Compute average I(Qy) for a region of interest</p>
162</dd></dl>
163
164<dl class="function">
165<dt id="DataLoader.manipulations.flip_phi">
166<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>
167<dd><p>Correct phi to within the 0 &lt;= to &lt;= 2pi range</p>
168<table class="docutils field-list" frame="void" rules="none">
169<col class="field-name" />
170<col class="field-body" />
171<tbody valign="top">
172<tr class="field"><th class="field-name">Returns:</th><td class="field-body">phi in &gt;=0 and &lt;=2Pi</td>
173</tr>
174</tbody>
175</table>
176</dd></dl>
177
178<dl class="function">
179<dt id="DataLoader.manipulations.get_intercept">
180<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>
181<dd><p>Returns the fraction of the side at which the
182q-value intercept the pixel, None otherwise.
183The values returned is the fraction ON THE SIDE
184OF THE LOWEST Q.</p>
185<div class="highlight-python"><pre>    A           B   
186+-----------+--------+    &lt;--- pixel size
1870                    1     
188Q_0 -------- Q ----- Q_1   &lt;--- equivalent Q range
189if Q_1 &gt; Q_0, A is returned
190if Q_1 &lt; Q_0, B is returned
191if Q is outside the range of [Q_0, Q_1], None is returned</pre>
192</div>
193</dd></dl>
194
195<dl class="function">
196<dt id="DataLoader.manipulations.get_pixel_fraction">
197<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>
198<dd><p>Returns the fraction of the pixel defined by
199the four corners (q_00, q_01, q_10, q_11) that
200has q &lt; qmax.:</p>
201<div class="highlight-python"><pre>        q_01                q_11
202y=1         +--------------+
203            |              |
204            |              |
205            |              |
206y=0         +--------------+
207        q_00                q_10
208
209            x=0            x=1</pre>
210</div>
211</dd></dl>
212
213<dl class="function">
214<dt id="DataLoader.manipulations.get_pixel_fraction_square">
215<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>
216<dd><p>Return the fraction of the length
217from xmin to x.:</p>
218<div class="highlight-python"><pre>    A            B
219+-----------+---------+
220xmin        x         xmax</pre>
221</div>
222<table class="docutils field-list" frame="void" rules="none">
223<col class="field-name" />
224<col class="field-body" />
225<tbody valign="top">
226<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
227<li><strong>x</strong> &#8211; x-value</li>
228<li><strong>xmin</strong> &#8211; minimum x for the length considered</li>
229<li><strong>xmax</strong> &#8211; minimum x for the length considered</li>
230</ul>
231</td>
232</tr>
233<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>
234</td>
235</tr>
236</tbody>
237</table>
238</dd></dl>
239
240<dl class="function">
241<dt id="DataLoader.manipulations.get_q">
242<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>
243<dd><table class="docutils field-list" frame="void" rules="none">
244<col class="field-name" />
245<col class="field-body" />
246<tbody valign="top">
247<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
248<li><strong>dx</strong> &#8211; x-distance from beam center [mm]</li>
249<li><strong>dy</strong> &#8211; y-distance from beam center [mm]</li>
250</ul>
251</td>
252</tr>
253<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">q-value at the given position</p>
254</td>
255</tr>
256</tbody>
257</table>
258</dd></dl>
259
260<dl class="function">
261<dt id="DataLoader.manipulations.get_q_compo">
262<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>
263<dd>This reduces tiny error at very large q.
264Implementation of this func is not started yet.&lt;&#8211;ToDo</dd></dl>
265
266<dl class="function">
267<dt id="DataLoader.manipulations.reader2D_converter">
268<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>
269<dd><p>convert old 2d format opened by IhorReader or danse_reader to new Data2D format</p>
270<table class="docutils field-list" frame="void" rules="none">
271<col class="field-name" />
272<col class="field-body" />
273<tbody valign="top">
274<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
275<li><strong>data2d</strong> &#8211; 2d array of Data2D object</li>
276</ul>
277</td>
278</tr>
279<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1d arrays of Data2D object</p>
280</td>
281</tr>
282</tbody>
283</table>
284</dd></dl>
285
286</div>
287</div>
288
289
290          </div>
291        </div>
292      </div>
293      <div class="sphinxsidebar">
294        <div class="sphinxsidebarwrapper">
295  <h3><a href="../index.html">Table Of Contents</a></h3>
296  <ul>
297<li><a class="reference internal" href="#">manipulations</a><ul>
298<li><a class="reference internal" href="#module-DataLoader.manipulations"><tt class="docutils literal"><span class="pre">DataLoader.manipulations</span></tt></a></li>
299</ul>
300</li>
301</ul>
302
303  <h4>Previous topic</h4>
304  <p class="topless"><a href="data_info.html"
305                        title="previous chapter">data_info</a></p>
306  <h4>Next topic</h4>
307  <p class="topless"><a href="qsmearing.html"
308                        title="next chapter">qsmearing</a></p>
309  <h3>This Page</h3>
310  <ul class="this-page-menu">
311    <li><a href="../_sources/api/manipulations.txt"
312           rel="nofollow">Show Source</a></li>
313  </ul>
314<div id="searchbox" style="display: none">
315  <h3>Quick search</h3>
316    <form class="search" action="../search.html" method="get">
317      <input type="text" name="q" size="18" />
318      <input type="submit" value="Go" />
319      <input type="hidden" name="check_keywords" value="yes" />
320      <input type="hidden" name="area" value="default" />
321    </form>
322    <p class="searchtip" style="font-size: 90%">
323    Enter search terms or a module, class or function name.
324    </p>
325</div>
326<script type="text/javascript">$('#searchbox').show(0);</script>
327        </div>
328      </div>
329      <div class="clearer"></div>
330    </div>
331    <div class="related">
332      <h3>Navigation</h3>
333      <ul>
334        <li class="right" style="margin-right: 10px">
335          <a href="../genindex.html" title="General Index"
336             >index</a></li>
337        <li class="right" >
338          <a href="../py-modindex.html" title="Python Module Index"
339             >modules</a> |</li>
340        <li class="right" >
341          <a href="qsmearing.html" title="qsmearing"
342             >next</a> |</li>
343        <li class="right" >
344          <a href="data_info.html" title="data_info"
345             >previous</a> |</li>
346        <li><a href="../index.html">DataLoader v0.1.0 documentation</a> &raquo;</li>
347          <li><a href="index.html" >Reference</a> &raquo;</li> 
348      </ul>
349    </div>
350    <div class="footer">
351        &copy; Copyright 2010, sans group.
352      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0b1.
353    </div>
354  </body>
355</html>
Note: See TracBrowser for help on using the repository browser.