source: sasview/sansinvariant/docs/sphinx/_build/html/api/invariant.html @ e8f7c47

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 e8f7c47 was 1679f2f, checked in by Jessica Tumarkin <jtumarki@…>, 13 years ago

new html files for sphinx docs

  • Property mode set to 100644
File size: 33.7 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>invariant &mdash; invariant 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="invariant v0.1.0 documentation" href="../index.html" />
26    <link rel="up" title="Reference" href="index.html" />
27    <link rel="next" title="invariant_mapper" href="invariant_mapper.html" />
28    <link rel="prev" title="Reference" href="index.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="invariant_mapper.html" title="invariant_mapper"
42             accesskey="N">next</a> |</li>
43        <li class="right" >
44          <a href="index.html" title="Reference"
45             accesskey="P">previous</a> |</li>
46        <li><a href="../index.html">invariant 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="invariant">
57<h1>invariant<a class="headerlink" href="#invariant" title="Permalink to this headline">¶</a></h1>
58<div class="section" id="module-sans.invariant.invariant">
59<span id="sans-invariant-invariant"></span><h2><a class="reference internal" href="#module-sans.invariant.invariant" title="sans.invariant.invariant"><tt class="xref py py-mod docutils literal"><span class="pre">sans.invariant.invariant</span></tt></a><a class="headerlink" href="#module-sans.invariant.invariant" title="Permalink to this headline">¶</a></h2>
60<p>This module implements invariant and its related computations.</p>
61<table class="docutils field-list" frame="void" rules="none">
62<col class="field-name" />
63<col class="field-body" />
64<tbody valign="top">
65<tr class="field"><th class="field-name">author:</th><td class="field-body">Gervaise B. Alina/UTK</td>
66</tr>
67<tr class="field"><th class="field-name">author:</th><td class="field-body">Mathieu Doucet/UTK</td>
68</tr>
69<tr class="field"><th class="field-name">author:</th><td class="field-body">Jae Cho/UTK</td>
70</tr>
71</tbody>
72</table>
73<dl class="class">
74<dt id="sans.invariant.invariant.Extrapolator">
75<em class="property">class </em><tt class="descclassname">sans.invariant.invariant.</tt><tt class="descname">Extrapolator</tt><big>(</big><em>data</em>, <em>model=None</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Extrapolator" title="Permalink to this definition">¶</a></dt>
76<dd><p>Extrapolate I(q) distribution using a given model</p>
77<dl class="method">
78<dt id="sans.invariant.invariant.Extrapolator.fit">
79<tt class="descname">fit</tt><big>(</big><em>power=None</em>, <em>qmin=None</em>, <em>qmax=None</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Extrapolator.fit" title="Permalink to this definition">¶</a></dt>
80<dd><p>Fit data for y = ax + b  return a and b</p>
81<table class="docutils field-list" frame="void" rules="none">
82<col class="field-name" />
83<col class="field-body" />
84<tbody valign="top">
85<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
86<li><strong>power</strong> &#8211; a fixed, otherwise None</li>
87<li><strong>qmin</strong> &#8211; Minimum Q-value</li>
88<li><strong>qmax</strong> &#8211; Maximum Q-value</li>
89</ul>
90</td>
91</tr>
92</tbody>
93</table>
94</dd></dl>
95
96</dd></dl>
97
98<dl class="class">
99<dt id="sans.invariant.invariant.Guinier">
100<em class="property">class </em><tt class="descclassname">sans.invariant.invariant.</tt><tt class="descname">Guinier</tt><big>(</big><em>scale=1</em>, <em>radius=60</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Guinier" title="Permalink to this definition">¶</a></dt>
101<dd><p>Bases: <a class="reference internal" href="#sans.invariant.invariant.Transform" title="sans.invariant.invariant.Transform"><tt class="xref py py-class docutils literal"><span class="pre">sans.invariant.invariant.Transform</span></tt></a></p>
102<p>class of type Transform that performs operations related to guinier
103function</p>
104<dl class="method">
105<dt id="sans.invariant.invariant.Guinier.evaluate_model">
106<tt class="descname">evaluate_model</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Guinier.evaluate_model" title="Permalink to this definition">¶</a></dt>
107<dd><p>return F(x)= scale* e-((radius*x)**2/3)</p>
108</dd></dl>
109
110<dl class="method">
111<dt id="sans.invariant.invariant.Guinier.evaluate_model_errors">
112<tt class="descname">evaluate_model_errors</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Guinier.evaluate_model_errors" title="Permalink to this definition">¶</a></dt>
113<dd><p>Returns the error on I(q) for the given array of q-values</p>
114<table class="docutils field-list" frame="void" rules="none">
115<col class="field-name" />
116<col class="field-body" />
117<tbody valign="top">
118<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>x</strong> &#8211; array of q-values</td>
119</tr>
120</tbody>
121</table>
122</dd></dl>
123
124<dl class="method">
125<dt id="sans.invariant.invariant.Guinier.extract_model_parameters">
126<tt class="descname">extract_model_parameters</tt><big>(</big><em>constant</em>, <em>slope</em>, <em>dconstant=0</em>, <em>dslope=0</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Guinier.extract_model_parameters" title="Permalink to this definition">¶</a></dt>
127<dd><p>assign new value to the scale and the radius</p>
128</dd></dl>
129
130<dl class="method">
131<dt id="sans.invariant.invariant.Guinier.get_allowed_bins">
132<tt class="descname">get_allowed_bins</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Guinier.get_allowed_bins" title="Permalink to this definition">¶</a></dt>
133<dd><p>Goes through the data points and returns a list of boolean values
134to indicate whether each points is allowed by the model or not.</p>
135<table class="docutils field-list" frame="void" rules="none">
136<col class="field-name" />
137<col class="field-body" />
138<tbody valign="top">
139<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> &#8211; Data1D object</td>
140</tr>
141</tbody>
142</table>
143</dd></dl>
144
145<dl class="method">
146<dt id="sans.invariant.invariant.Guinier.linearize_data">
147<tt class="descname">linearize_data</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Guinier.linearize_data" title="Permalink to this definition">¶</a></dt>
148<dd><p>Linearize data so that a linear fit can be performed.
149Filter out the data that can&#8217;t be transformed.</p>
150<table class="docutils field-list" frame="void" rules="none">
151<col class="field-name" />
152<col class="field-body" />
153<tbody valign="top">
154<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> &#8211; LoadData1D instance</td>
155</tr>
156</tbody>
157</table>
158</dd></dl>
159
160<dl class="method">
161<dt id="sans.invariant.invariant.Guinier.linearize_q_value">
162<tt class="descname">linearize_q_value</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Guinier.linearize_q_value" title="Permalink to this definition">¶</a></dt>
163<dd><p>Transform the input q-value for linearization</p>
164<table class="docutils field-list" frame="void" rules="none">
165<col class="field-name" />
166<col class="field-body" />
167<tbody valign="top">
168<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> &#8211; q-value</td>
169</tr>
170<tr class="field"><th class="field-name">Returns:</th><td class="field-body">q*q</td>
171</tr>
172</tbody>
173</table>
174</dd></dl>
175
176</dd></dl>
177
178<dl class="class">
179<dt id="sans.invariant.invariant.InvariantCalculator">
180<em class="property">class </em><tt class="descclassname">sans.invariant.invariant.</tt><tt class="descname">InvariantCalculator</tt><big>(</big><em>data</em>, <em>background=0</em>, <em>scale=1</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator" title="Permalink to this definition">¶</a></dt>
181<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
182<p>Compute invariant if data is given.
183Can provide volume fraction and surface area if the user provides
184Porod constant  and contrast values.</p>
185<table class="docutils field-list" frame="void" rules="none">
186<col class="field-name" />
187<col class="field-body" />
188<tbody valign="top">
189<tr class="field"><th class="field-name">Precondition :</th><td class="field-body">the user must send a data of type DataLoader.Data1D
190the user provide background and scale values.</td>
191</tr>
192<tr class="field"><th class="field-name">Note :</th><td class="field-body">Some computations depends on each others.</td>
193</tr>
194</tbody>
195</table>
196<dl class="method">
197<dt id="sans.invariant.invariant.InvariantCalculator.get_data">
198<tt class="descname">get_data</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_data" title="Permalink to this definition">¶</a></dt>
199<dd><table class="docutils field-list" frame="void" rules="none">
200<col class="field-name" />
201<col class="field-body" />
202<tbody valign="top">
203<tr class="field"><th class="field-name">Returns:</th><td class="field-body">self._data</td>
204</tr>
205</tbody>
206</table>
207</dd></dl>
208
209<dl class="method">
210<dt id="sans.invariant.invariant.InvariantCalculator.get_extra_data_high">
211<tt class="descname">get_extra_data_high</tt><big>(</big><em>npts_in=None</em>, <em>q_end=10</em>, <em>npts=20</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_extra_data_high" title="Permalink to this definition">¶</a></dt>
212<dd><p>Returns the extrapolated data used for the high-Q invariant calculation.
213By default, the distribution will cover the data points used for the
214extrapolation. The number of overlap points is a parameter (npts_in).
215By default, the maximum q-value of the distribution will be Q_MAXIMUM,
216the maximum q-value used when extrapolating for the purpose of the
217invariant calculation.</p>
218<table class="docutils field-list" frame="void" rules="none">
219<col class="field-name" />
220<col class="field-body" />
221<tbody valign="top">
222<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
223<li><strong>npts_in</strong> &#8211; number of data points for which the
224extrapolated data overlap</li>
225<li><strong>q_end</strong> &#8211; is the maximum value to uses for extrapolated data</li>
226<li><strong>npts</strong> &#8211; the number of points in the extrapolated distribution</li>
227</ul>
228</td>
229</tr>
230</tbody>
231</table>
232</dd></dl>
233
234<dl class="method">
235<dt id="sans.invariant.invariant.InvariantCalculator.get_extra_data_low">
236<tt class="descname">get_extra_data_low</tt><big>(</big><em>npts_in=None</em>, <em>q_start=None</em>, <em>npts=20</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_extra_data_low" title="Permalink to this definition">¶</a></dt>
237<dd><p>Returns the extrapolated data used for the loew-Q invariant calculation.
238By default, the distribution will cover the data points used for the
239extrapolation. The number of overlap points is a parameter (npts_in).
240By default, the maximum q-value of the distribution will be 
241the minimum q-value used when extrapolating for the purpose of the
242invariant calculation.</p>
243<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 last simple">
248<li><strong>npts_in</strong> &#8211; number of data points for which
249the extrapolated data overlap</li>
250<li><strong>q_start</strong> &#8211; is the minimum value to uses for extrapolated data</li>
251<li><strong>npts</strong> &#8211; the number of points in the extrapolated distribution</li>
252</ul>
253</td>
254</tr>
255</tbody>
256</table>
257</dd></dl>
258
259<dl class="method">
260<dt id="sans.invariant.invariant.InvariantCalculator.get_extrapolation_power">
261<tt class="descname">get_extrapolation_power</tt><big>(</big><em>range='high'</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_extrapolation_power" title="Permalink to this definition">¶</a></dt>
262<dd><table class="docutils field-list" frame="void" rules="none">
263<col class="field-name" />
264<col class="field-body" />
265<tbody valign="top">
266<tr class="field"><th class="field-name">Returns:</th><td class="field-body">the fitted power for power law function for a given
267extrapolation range</td>
268</tr>
269</tbody>
270</table>
271</dd></dl>
272
273<dl class="method">
274<dt id="sans.invariant.invariant.InvariantCalculator.get_qstar">
275<tt class="descname">get_qstar</tt><big>(</big><em>extrapolation=None</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_qstar" title="Permalink to this definition">¶</a></dt>
276<dd><p>Compute the invariant of the local copy of data.</p>
277<table class="docutils field-list" frame="void" rules="none">
278<col class="field-name" />
279<col class="field-body" />
280<tbody valign="top">
281<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>extrapolation</strong> &#8211; string to apply optional extrapolation</td>
282</tr>
283<tr class="field"><th class="field-name">Return q_star:</th><td class="field-body">invariant of the data within data&#8217;s q range</td>
284</tr>
285<tr class="field"><th class="field-name">Warning :</th><td class="field-body">When using setting data to Data1D ,
286the user is responsible of
287checking that the scale and the background are
288properly apply to the data</td>
289</tr>
290</tbody>
291</table>
292</dd></dl>
293
294<dl class="method">
295<dt id="sans.invariant.invariant.InvariantCalculator.get_qstar_high">
296<tt class="descname">get_qstar_high</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_qstar_high" title="Permalink to this definition">¶</a></dt>
297<dd><p>Compute the invariant for extrapolated data at high q range.</p>
298<dl class="docutils">
299<dt>Implementation:</dt>
300<dd>data = self._get_extra_data_high()
301return self._get_qstar()</dd>
302</dl>
303<table class="docutils field-list" frame="void" rules="none">
304<col class="field-name" />
305<col class="field-body" />
306<tbody valign="top">
307<tr class="field"><th class="field-name">Return q_star:</th><td class="field-body">the invariant for data extrapolated at high q.</td>
308</tr>
309</tbody>
310</table>
311</dd></dl>
312
313<dl class="method">
314<dt id="sans.invariant.invariant.InvariantCalculator.get_qstar_low">
315<tt class="descname">get_qstar_low</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_qstar_low" title="Permalink to this definition">¶</a></dt>
316<dd><p>Compute the invariant for extrapolated data at low q range.</p>
317<dl class="docutils">
318<dt>Implementation:</dt>
319<dd>data = self._get_extra_data_low()
320return self._get_qstar()</dd>
321</dl>
322<table class="docutils field-list" frame="void" rules="none">
323<col class="field-name" />
324<col class="field-body" />
325<tbody valign="top">
326<tr class="field"><th class="field-name">Return q_star:</th><td class="field-body">the invariant for data extrapolated at low q.</td>
327</tr>
328</tbody>
329</table>
330</dd></dl>
331
332<dl class="method">
333<dt id="sans.invariant.invariant.InvariantCalculator.get_qstar_with_error">
334<tt class="descname">get_qstar_with_error</tt><big>(</big><em>extrapolation=None</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_qstar_with_error" title="Permalink to this definition">¶</a></dt>
335<dd><p>Compute the invariant uncertainty.
336This uncertainty computation depends on whether or not the data is
337smeared.</p>
338<table class="docutils field-list" frame="void" rules="none">
339<col class="field-name" />
340<col class="field-body" />
341<tbody valign="top">
342<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>extrapolation</strong> &#8211; string to apply optional extrapolation</td>
343</tr>
344<tr class="field"><th class="field-name">Returns:</th><td class="field-body">invariant, the invariant uncertainty</td>
345</tr>
346</tbody>
347</table>
348</dd></dl>
349
350<dl class="method">
351<dt id="sans.invariant.invariant.InvariantCalculator.get_surface">
352<tt class="descname">get_surface</tt><big>(</big><em>contrast</em>, <em>porod_const</em>, <em>extrapolation=None</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_surface" title="Permalink to this definition">¶</a></dt>
353<dd><p>Compute the specific surface from the data.</p>
354<p>Implementation:</p>
355<div class="highlight-python"><pre>V =  self.get_volume_fraction(contrast, extrapolation)
356
357Compute the surface given by:
358  surface = (2*pi *V(1- V)*porod_const)/ q_star</pre>
359</div>
360<table class="docutils field-list" frame="void" rules="none">
361<col class="field-name" />
362<col class="field-body" />
363<tbody valign="top">
364<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
365<li><strong>contrast</strong> &#8211; contrast value to compute the volume</li>
366<li><strong>porod_const</strong> &#8211; Porod constant to compute the surface</li>
367<li><strong>extrapolation</strong> &#8211; string to apply optional extrapolation</li>
368</ul>
369</td>
370</tr>
371<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">specific surface</p>
372</td>
373</tr>
374</tbody>
375</table>
376</dd></dl>
377
378<dl class="method">
379<dt id="sans.invariant.invariant.InvariantCalculator.get_surface_with_error">
380<tt class="descname">get_surface_with_error</tt><big>(</big><em>contrast</em>, <em>porod_const</em>, <em>extrapolation=None</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_surface_with_error" title="Permalink to this definition">¶</a></dt>
381<dd><p>Compute uncertainty of the surface value as well as the surface value.
382The uncertainty is given as follow:</p>
383<div class="highlight-python"><pre>dS = porod_const *2*pi[( dV -2*V*dV)/q_star
384     + dq_star(v-v**2)
385     
386q_star: the invariant value
387dq_star: the invariant uncertainty
388V: the volume fraction value
389dV: the volume uncertainty</pre>
390</div>
391<table class="docutils field-list" frame="void" rules="none">
392<col class="field-name" />
393<col class="field-body" />
394<tbody valign="top">
395<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
396<li><strong>contrast</strong> &#8211; contrast value</li>
397<li><strong>porod_const</strong> &#8211; porod constant value</li>
398<li><strong>extrapolation</strong> &#8211; string to apply optional extrapolation</li>
399</ul>
400</td>
401</tr>
402<tr class="field"><th class="field-name">Return S, dS:</th><td class="field-body"><p class="first last">the surface, with its uncertainty</p>
403</td>
404</tr>
405</tbody>
406</table>
407</dd></dl>
408
409<dl class="method">
410<dt id="sans.invariant.invariant.InvariantCalculator.get_volume_fraction">
411<tt class="descname">get_volume_fraction</tt><big>(</big><em>contrast</em>, <em>extrapolation=None</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_volume_fraction" title="Permalink to this definition">¶</a></dt>
412<dd><p>Compute volume fraction is deduced as follow:</p>
413<div class="highlight-python"><pre>q_star = 2*(pi*contrast)**2* volume( 1- volume)
414for k = 10^(-8)*q_star/(2*(pi*|contrast|)**2)
415we get 2 values of volume:
416     with   1 - 4 * k &gt;= 0
417     volume1 = (1- sqrt(1- 4*k))/2
418     volume2 = (1+ sqrt(1- 4*k))/2
419
420q_star: the invariant value included extrapolation is applied
421             unit  1/A^(3)*1/cm
422        q_star = self.get_qstar()
423       
424the result returned will be 0 &lt;= volume &lt;= 1</pre>
425</div>
426<table class="docutils field-list" frame="void" rules="none">
427<col class="field-name" />
428<col class="field-body" />
429<tbody valign="top">
430<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
431<li><strong>contrast</strong> &#8211; contrast value provides by the user of type float.
432contrast unit is 1/A^(2)= 10^(16)cm^(2)</li>
433<li><strong>extrapolation</strong> &#8211; string to apply optional extrapolation</li>
434</ul>
435</td>
436</tr>
437<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">volume fraction</p>
438</td>
439</tr>
440<tr class="field"><th class="field-name">Note :</th><td class="field-body"><p class="first last">volume fraction must have no unit</p>
441</td>
442</tr>
443</tbody>
444</table>
445</dd></dl>
446
447<dl class="method">
448<dt id="sans.invariant.invariant.InvariantCalculator.get_volume_fraction_with_error">
449<tt class="descname">get_volume_fraction_with_error</tt><big>(</big><em>contrast</em>, <em>extrapolation=None</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.get_volume_fraction_with_error" title="Permalink to this definition">¶</a></dt>
450<dd><p>Compute uncertainty on volume value as well as the volume fraction
451This uncertainty is given by the following equation:</p>
452<div class="highlight-python"><pre>dV = 0.5 * (4*k* dq_star) /(2* math.sqrt(1-k* q_star))
453                     
454for k = 10^(-8)*q_star/(2*(pi*|contrast|)**2)
455
456q_star: the invariant value including extrapolated value if existing
457dq_star: the invariant uncertainty
458dV: the volume uncertainty</pre>
459</div>
460<p>The uncertainty will be set to -1 if it can&#8217;t be computed.</p>
461<table class="docutils field-list" frame="void" rules="none">
462<col class="field-name" />
463<col class="field-body" />
464<tbody valign="top">
465<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
466<li><strong>contrast</strong> &#8211; contrast value</li>
467<li><strong>extrapolation</strong> &#8211; string to apply optional extrapolation</li>
468</ul>
469</td>
470</tr>
471<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">V, dV = volume fraction, error on volume fraction</p>
472</td>
473</tr>
474</tbody>
475</table>
476</dd></dl>
477
478<dl class="method">
479<dt id="sans.invariant.invariant.InvariantCalculator.set_extrapolation">
480<tt class="descname">set_extrapolation</tt><big>(</big><em>range</em>, <em>npts=4</em>, <em>function=None</em>, <em>power=None</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.InvariantCalculator.set_extrapolation" title="Permalink to this definition">¶</a></dt>
481<dd><p>Set the extrapolation parameters for the high or low Q-range.
482Note that this does not turn extrapolation on or off.</p>
483<table class="docutils field-list" frame="void" rules="none">
484<col class="field-name" />
485<col class="field-body" />
486<tbody valign="top">
487<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
488<li><strong>range</strong> &#8211; a keyword set the type of extrapolation . type string</li>
489<li><strong>npts</strong> &#8211; the numbers of q points of data to consider
490for extrapolation</li>
491<li><strong>function</strong> &#8211; a keyword to select the function to use
492for extrapolation.
493of type string.</li>
494<li><strong>power</strong> &#8211; an power to apply power_low function</li>
495</ul>
496</td>
497</tr>
498</tbody>
499</table>
500</dd></dl>
501
502</dd></dl>
503
504<dl class="class">
505<dt id="sans.invariant.invariant.PowerLaw">
506<em class="property">class </em><tt class="descclassname">sans.invariant.invariant.</tt><tt class="descname">PowerLaw</tt><big>(</big><em>scale=1</em>, <em>power=4</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.PowerLaw" title="Permalink to this definition">¶</a></dt>
507<dd><p>Bases: <a class="reference internal" href="#sans.invariant.invariant.Transform" title="sans.invariant.invariant.Transform"><tt class="xref py py-class docutils literal"><span class="pre">sans.invariant.invariant.Transform</span></tt></a></p>
508<p>class of type transform that perform operation related to power_law
509function</p>
510<dl class="method">
511<dt id="sans.invariant.invariant.PowerLaw.evaluate_model">
512<tt class="descname">evaluate_model</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.PowerLaw.evaluate_model" title="Permalink to this definition">¶</a></dt>
513<dd><p>given a scale and a radius transform x, y using a power_law
514function</p>
515</dd></dl>
516
517<dl class="method">
518<dt id="sans.invariant.invariant.PowerLaw.evaluate_model_errors">
519<tt class="descname">evaluate_model_errors</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.PowerLaw.evaluate_model_errors" title="Permalink to this definition">¶</a></dt>
520<dd><p>Returns the error on I(q) for the given array of q-values
521:param x: array of q-values</p>
522</dd></dl>
523
524<dl class="method">
525<dt id="sans.invariant.invariant.PowerLaw.extract_model_parameters">
526<tt class="descname">extract_model_parameters</tt><big>(</big><em>constant</em>, <em>slope</em>, <em>dconstant=0</em>, <em>dslope=0</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.PowerLaw.extract_model_parameters" title="Permalink to this definition">¶</a></dt>
527<dd><p>Assign new value to the scale and the power</p>
528</dd></dl>
529
530<dl class="method">
531<dt id="sans.invariant.invariant.PowerLaw.get_allowed_bins">
532<tt class="descname">get_allowed_bins</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.PowerLaw.get_allowed_bins" title="Permalink to this definition">¶</a></dt>
533<dd><p>Goes through the data points and returns a list of boolean values
534to indicate whether each points is allowed by the model or not.</p>
535<table class="docutils field-list" frame="void" rules="none">
536<col class="field-name" />
537<col class="field-body" />
538<tbody valign="top">
539<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> &#8211; Data1D object</td>
540</tr>
541</tbody>
542</table>
543</dd></dl>
544
545<dl class="method">
546<dt id="sans.invariant.invariant.PowerLaw.linearize_data">
547<tt class="descname">linearize_data</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.PowerLaw.linearize_data" title="Permalink to this definition">¶</a></dt>
548<dd><p>Linearize data so that a linear fit can be performed.
549Filter out the data that can&#8217;t be transformed.</p>
550<table class="docutils field-list" frame="void" rules="none">
551<col class="field-name" />
552<col class="field-body" />
553<tbody valign="top">
554<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> &#8211; LoadData1D instance</td>
555</tr>
556</tbody>
557</table>
558</dd></dl>
559
560<dl class="method">
561<dt id="sans.invariant.invariant.PowerLaw.linearize_q_value">
562<tt class="descname">linearize_q_value</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.PowerLaw.linearize_q_value" title="Permalink to this definition">¶</a></dt>
563<dd><p>Transform the input q-value for linearization</p>
564<table class="docutils field-list" frame="void" rules="none">
565<col class="field-name" />
566<col class="field-body" />
567<tbody valign="top">
568<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> &#8211; q-value</td>
569</tr>
570<tr class="field"><th class="field-name">Returns:</th><td class="field-body">log(q)</td>
571</tr>
572</tbody>
573</table>
574</dd></dl>
575
576</dd></dl>
577
578<dl class="class">
579<dt id="sans.invariant.invariant.Transform">
580<em class="property">class </em><tt class="descclassname">sans.invariant.invariant.</tt><tt class="descname">Transform</tt><a class="headerlink" href="#sans.invariant.invariant.Transform" title="Permalink to this definition">¶</a></dt>
581<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
582<p>Define interface that need to compute a function or an inverse
583function given some x, y</p>
584<dl class="method">
585<dt id="sans.invariant.invariant.Transform.evaluate_model">
586<tt class="descname">evaluate_model</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Transform.evaluate_model" title="Permalink to this definition">¶</a></dt>
587<dd><p>Returns an array f(x) values where f is the Transform function.</p>
588</dd></dl>
589
590<dl class="method">
591<dt id="sans.invariant.invariant.Transform.evaluate_model_errors">
592<tt class="descname">evaluate_model_errors</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Transform.evaluate_model_errors" title="Permalink to this definition">¶</a></dt>
593<dd><p>Returns an array of I(q) errors</p>
594</dd></dl>
595
596<dl class="method">
597<dt id="sans.invariant.invariant.Transform.extract_model_parameters">
598<tt class="descname">extract_model_parameters</tt><big>(</big><em>constant</em>, <em>slope</em>, <em>dconstant=0</em>, <em>dslope=0</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Transform.extract_model_parameters" title="Permalink to this definition">¶</a></dt>
599<dd><p>set private member</p>
600</dd></dl>
601
602<dl class="method">
603<dt id="sans.invariant.invariant.Transform.get_allowed_bins">
604<tt class="descname">get_allowed_bins</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Transform.get_allowed_bins" title="Permalink to this definition">¶</a></dt>
605<dd><p>Goes through the data points and returns a list of boolean values
606to indicate whether each points is allowed by the model or not.</p>
607<table class="docutils field-list" frame="void" rules="none">
608<col class="field-name" />
609<col class="field-body" />
610<tbody valign="top">
611<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> &#8211; Data1D object</td>
612</tr>
613</tbody>
614</table>
615</dd></dl>
616
617<dl class="method">
618<dt id="sans.invariant.invariant.Transform.linearize_data">
619<tt class="descname">linearize_data</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Transform.linearize_data" title="Permalink to this definition">¶</a></dt>
620<dd><p>Linearize data so that a linear fit can be performed.
621Filter out the data that can&#8217;t be transformed.</p>
622<table class="docutils field-list" frame="void" rules="none">
623<col class="field-name" />
624<col class="field-body" />
625<tbody valign="top">
626<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> &#8211; LoadData1D instance</td>
627</tr>
628</tbody>
629</table>
630</dd></dl>
631
632<dl class="method">
633<dt id="sans.invariant.invariant.Transform.linearize_q_value">
634<tt class="descname">linearize_q_value</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#sans.invariant.invariant.Transform.linearize_q_value" title="Permalink to this definition">¶</a></dt>
635<dd><p>Transform the input q-value for linearization</p>
636</dd></dl>
637
638</dd></dl>
639
640</div>
641</div>
642
643
644          </div>
645        </div>
646      </div>
647      <div class="sphinxsidebar">
648        <div class="sphinxsidebarwrapper">
649  <h3><a href="../index.html">Table Of Contents</a></h3>
650  <ul>
651<li><a class="reference internal" href="#">invariant</a><ul>
652<li><a class="reference internal" href="#module-sans.invariant.invariant"><tt class="docutils literal"><span class="pre">sans.invariant.invariant</span></tt></a></li>
653</ul>
654</li>
655</ul>
656
657  <h4>Previous topic</h4>
658  <p class="topless"><a href="index.html"
659                        title="previous chapter">Reference</a></p>
660  <h4>Next topic</h4>
661  <p class="topless"><a href="invariant_mapper.html"
662                        title="next chapter">invariant_mapper</a></p>
663  <h3>This Page</h3>
664  <ul class="this-page-menu">
665    <li><a href="../_sources/api/invariant.txt"
666           rel="nofollow">Show Source</a></li>
667  </ul>
668<div id="searchbox" style="display: none">
669  <h3>Quick search</h3>
670    <form class="search" action="../search.html" method="get">
671      <input type="text" name="q" size="18" />
672      <input type="submit" value="Go" />
673      <input type="hidden" name="check_keywords" value="yes" />
674      <input type="hidden" name="area" value="default" />
675    </form>
676    <p class="searchtip" style="font-size: 90%">
677    Enter search terms or a module, class or function name.
678    </p>
679</div>
680<script type="text/javascript">$('#searchbox').show(0);</script>
681        </div>
682      </div>
683      <div class="clearer"></div>
684    </div>
685    <div class="related">
686      <h3>Navigation</h3>
687      <ul>
688        <li class="right" style="margin-right: 10px">
689          <a href="../genindex.html" title="General Index"
690             >index</a></li>
691        <li class="right" >
692          <a href="../py-modindex.html" title="Python Module Index"
693             >modules</a> |</li>
694        <li class="right" >
695          <a href="invariant_mapper.html" title="invariant_mapper"
696             >next</a> |</li>
697        <li class="right" >
698          <a href="index.html" title="Reference"
699             >previous</a> |</li>
700        <li><a href="../index.html">invariant v0.1.0 documentation</a> &raquo;</li>
701          <li><a href="index.html" >Reference</a> &raquo;</li> 
702      </ul>
703    </div>
704    <div class="footer">
705        &copy; Copyright 2010, sans group.
706      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
707    </div>
708  </body>
709</html>
Note: See TracBrowser for help on using the repository browser.