source: sasview/sansdataloader/docs/sphinx/html/api/manipulations.html @ fe10df5

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 fe10df5 was fc5d49e3, checked in by Jessica Tumarkin <jtumarki@…>, 13 years ago
  • Property mode set to 100644
File size: 18.4 KB
Line 
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="loader" href="loader.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="loader.html" title="loader"
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" 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>
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
146and left lines wrt central line.</p>
147<p>Phi_min and phi_max are given in units of radian
148and (phi_max-phi_min) should not be larger than pi</p>
149</dd></dl>
150
151<dl class="class">
152<dt id="DataLoader.manipulations.SlabX">
153<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>
154<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Slab</span></tt></p>
155<p>Compute average I(Qx) for a region of interest</p>
156</dd></dl>
157
158<dl class="class">
159<dt id="DataLoader.manipulations.SlabY">
160<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>
161<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">DataLoader.manipulations._Slab</span></tt></p>
162<p>Compute average I(Qy) for a region of interest</p>
163</dd></dl>
164
165<dl class="function">
166<dt id="DataLoader.manipulations.flip_phi">
167<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>
168<dd><p>Correct phi to within the 0 &lt;= to &lt;= 2pi range</p>
169<table class="docutils field-list" frame="void" rules="none">
170<col class="field-name" />
171<col class="field-body" />
172<tbody valign="top">
173<tr class="field"><th class="field-name">Returns:</th><td class="field-body">phi in &gt;=0 and &lt;=2Pi</td>
174</tr>
175</tbody>
176</table>
177</dd></dl>
178
179<dl class="function">
180<dt id="DataLoader.manipulations.get_intercept">
181<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>
182<dd><p>Returns the fraction of the side at which the
183q-value intercept the pixel, None otherwise.
184The values returned is the fraction ON THE SIDE
185OF THE LOWEST Q.</p>
186<div class="highlight-python"><pre>    A           B   
187+-----------+--------+    &lt;--- pixel size
1880                    1     
189Q_0 -------- Q ----- Q_1   &lt;--- equivalent Q range
190if Q_1 &gt; Q_0, A is returned
191if Q_1 &lt; Q_0, B is returned
192if Q is outside the range of [Q_0, Q_1], None is returned</pre>
193</div>
194</dd></dl>
195
196<dl class="function">
197<dt id="DataLoader.manipulations.get_pixel_fraction">
198<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>
199<dd><p>Returns the fraction of the pixel defined by
200the four corners (q_00, q_01, q_10, q_11) that
201has q &lt; qmax.:</p>
202<div class="highlight-python"><pre>        q_01                q_11
203y=1         +--------------+
204            |              |
205            |              |
206            |              |
207y=0         +--------------+
208        q_00                q_10
209
210            x=0            x=1</pre>
211</div>
212</dd></dl>
213
214<dl class="function">
215<dt id="DataLoader.manipulations.get_pixel_fraction_square">
216<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>
217<dd><p>Return the fraction of the length
218from xmin to x.:</p>
219<div class="highlight-python"><pre>    A            B
220+-----------+---------+
221xmin        x         xmax</pre>
222</div>
223<table class="docutils field-list" frame="void" rules="none">
224<col class="field-name" />
225<col class="field-body" />
226<tbody valign="top">
227<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
228<li><strong>x</strong> &#8211; x-value</li>
229<li><strong>xmin</strong> &#8211; minimum x for the length considered</li>
230<li><strong>xmax</strong> &#8211; minimum x for the length considered</li>
231</ul>
232</td>
233</tr>
234<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>
235</td>
236</tr>
237</tbody>
238</table>
239</dd></dl>
240
241<dl class="function">
242<dt id="DataLoader.manipulations.get_q">
243<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>
244<dd><table class="docutils field-list" frame="void" rules="none">
245<col class="field-name" />
246<col class="field-body" />
247<tbody valign="top">
248<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
249<li><strong>dx</strong> &#8211; x-distance from beam center [mm]</li>
250<li><strong>dy</strong> &#8211; y-distance from beam center [mm]</li>
251</ul>
252</td>
253</tr>
254<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">q-value at the given position</p>
255</td>
256</tr>
257</tbody>
258</table>
259</dd></dl>
260
261<dl class="function">
262<dt id="DataLoader.manipulations.get_q_compo">
263<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>
264<dd><p>This reduces tiny error at very large q.
265Implementation of this func is not started yet.&lt;&#8211;ToDo</p>
266</dd></dl>
267
268<dl class="function">
269<dt id="DataLoader.manipulations.reader2D_converter">
270<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>
271<dd><p>convert old 2d format opened by IhorReader or danse_reader
272to new Data2D format</p>
273<table class="docutils field-list" frame="void" rules="none">
274<col class="field-name" />
275<col class="field-body" />
276<tbody valign="top">
277<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data2d</strong> &#8211; 2d array of Data2D object</td>
278</tr>
279<tr class="field"><th class="field-name">Returns:</th><td class="field-body">1d arrays of Data2D object</td>
280</tr>
281</tbody>
282</table>
283</dd></dl>
284
285</div>
286</div>
287
288
289          </div>
290        </div>
291      </div>
292      <div class="sphinxsidebar">
293        <div class="sphinxsidebarwrapper">
294  <h3><a href="../index.html">Table Of Contents</a></h3>
295  <ul>
296<li><a class="reference internal" href="#">manipulations</a><ul>
297<li><a class="reference internal" href="#module-DataLoader.manipulations"><tt class="docutils literal"><span class="pre">DataLoader.manipulations</span></tt></a></li>
298</ul>
299</li>
300</ul>
301
302  <h4>Previous topic</h4>
303  <p class="topless"><a href="loader.html"
304                        title="previous chapter">loader</a></p>
305  <h4>Next topic</h4>
306  <p class="topless"><a href="qsmearing.html"
307                        title="next chapter">qsmearing</a></p>
308  <h3>This Page</h3>
309  <ul class="this-page-menu">
310    <li><a href="../_sources/api/manipulations.txt"
311           rel="nofollow">Show Source</a></li>
312  </ul>
313<div id="searchbox" style="display: none">
314  <h3>Quick search</h3>
315    <form class="search" action="../search.html" method="get">
316      <input type="text" name="q" size="18" />
317      <input type="submit" value="Go" />
318      <input type="hidden" name="check_keywords" value="yes" />
319      <input type="hidden" name="area" value="default" />
320    </form>
321    <p class="searchtip" style="font-size: 90%">
322    Enter search terms or a module, class or function name.
323    </p>
324</div>
325<script type="text/javascript">$('#searchbox').show(0);</script>
326        </div>
327      </div>
328      <div class="clearer"></div>
329    </div>
330    <div class="related">
331      <h3>Navigation</h3>
332      <ul>
333        <li class="right" style="margin-right: 10px">
334          <a href="../genindex.html" title="General Index"
335             >index</a></li>
336        <li class="right" >
337          <a href="../py-modindex.html" title="Python Module Index"
338             >modules</a> |</li>
339        <li class="right" >
340          <a href="qsmearing.html" title="qsmearing"
341             >next</a> |</li>
342        <li class="right" >
343          <a href="loader.html" title="loader"
344             >previous</a> |</li>
345        <li><a href="../index.html">DataLoader v0.1.0 documentation</a> &raquo;</li>
346          <li><a href="index.html" >Reference</a> &raquo;</li> 
347      </ul>
348    </div>
349    <div class="footer">
350        &copy; Copyright 2010, sans group.
351      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
352    </div>
353  </body>
354</html>
Note: See TracBrowser for help on using the repository browser.