source: sasview/Invariant/docs/sphinx/_build/html/api/invariant.html @ 74755ff

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 74755ff was a45622a, checked in by Gervaise Alina <gervyh@…>, 14 years ago

working on docs invariant

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