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

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

Added sphinx documentation for sansinvariant

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