source: sasview/sansmodels/docs/sphinx/html/api/TwoPowerLawModel.html @ 6232a6f

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 6232a6f was c0d873f, checked in by Gervaise Alina <gervyh@…>, 13 years ago

edit docs for models

  • Property mode set to 100644
File size: 16.3 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
7<html xmlns="http://www.w3.org/1999/xhtml">
8  <head>
9    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10   
11    <title>TwoPowerLawModel &mdash; sansmodels 0.1.0 documentation</title>
12   
13    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
14    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
15   
16    <script type="text/javascript">
17      var DOCUMENTATION_OPTIONS = {
18        URL_ROOT:    '../',
19        VERSION:     '0.1.0',
20        COLLAPSE_INDEX: false,
21        FILE_SUFFIX: '.html',
22        HAS_SOURCE:  true
23      };
24    </script>
25    <script type="text/javascript" src="../_static/jquery.js"></script>
26    <script type="text/javascript" src="../_static/underscore.js"></script>
27    <script type="text/javascript" src="../_static/doctools.js"></script>
28    <link rel="top" title="sansmodels 0.1.0 documentation" href="../index.html" />
29    <link rel="up" title="Reference" href="index.html" />
30    <link rel="next" title="UnifiedPowerRgModel" href="UnifiedPowerRgModel.html" />
31    <link rel="prev" title="TwoLorentzianModel" href="TwoLorentzianModel.html" /> 
32  </head>
33  <body>
34    <div class="related">
35      <h3>Navigation</h3>
36      <ul>
37        <li class="right" style="margin-right: 10px">
38          <a href="../genindex.html" title="General Index"
39             accesskey="I">index</a></li>
40        <li class="right" >
41          <a href="../py-modindex.html" title="Python Module Index"
42             >modules</a> |</li>
43        <li class="right" >
44          <a href="UnifiedPowerRgModel.html" title="UnifiedPowerRgModel"
45             accesskey="N">next</a> |</li>
46        <li class="right" >
47          <a href="TwoLorentzianModel.html" title="TwoLorentzianModel"
48             accesskey="P">previous</a> |</li>
49        <li><a href="../index.html">sansmodels 0.1.0 documentation</a> &raquo;</li>
50          <li><a href="index.html" accesskey="U">Reference</a> &raquo;</li> 
51      </ul>
52    </div> 
53
54    <div class="document">
55      <div class="documentwrapper">
56        <div class="bodywrapper">
57          <div class="body">
58           
59  <div class="section" id="twopowerlawmodel">
60<h1>TwoPowerLawModel<a class="headerlink" href="#twopowerlawmodel" title="Permalink to this headline">¶</a></h1>
61<div class="section" id="sans-models-twopowerlawmodel">
62<h2><a class="reference internal" href="#module-sans.models.TwoPowerLawModel" title="sans.models.TwoPowerLawModel"><tt class="xref py py-mod docutils literal"><span class="pre">sans.models.TwoPowerLawModel</span></tt></a><a class="headerlink" href="#sans-models-twopowerlawmodel" title="Permalink to this headline">¶</a></h2>
63<span class="target" id="module-sans.models.TwoPowerLawModel"></span><dl class="docutils">
64<dt>Provide I(q) = A*pow(qval,-1.0*m1) for q&lt;=qc</dt>
65<dd>=scale*pow(qval,-1.0*m2) for q&gt;qc</dd>
66</dl>
67<p>TwoPowerLaw function as a BaseComponent model</p>
68<dl class="class">
69<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel">
70<em class="property">class </em><tt class="descclassname">sans.models.TwoPowerLawModel.</tt><tt class="descname">TwoPowerLawModel</tt><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel" title="Permalink to this definition">¶</a></dt>
71<dd><p>Bases: <a class="reference internal" href="BaseComponent.html#sans.models.BaseComponent.BaseComponent" title="sans.models.BaseComponent.BaseComponent"><tt class="xref py py-class docutils literal"><span class="pre">sans.models.BaseComponent.BaseComponent</span></tt></a></p>
72<p>Class that evaluates a TwoPowerLawModel.</p>
73<dl class="docutils">
74<dt>I(q) = coef_A*pow(qval,-1.0*power1) for q&lt;=qc</dt>
75<dd>=C*pow(qval,-1.0*power2) for q&gt;qc</dd>
76</dl>
77<p>where C=coef_A*pow(qc,-1.0*power1)/pow(qc,-1.0*power2).
78List of default parameters:</p>
79<blockquote>
80<div>coef_A = coefficient
81power1 = (-) Power &#64; low Q
82power2 = (-) Power &#64; high Q
83qc = crossover Q-value
84background = incoherent background</div></blockquote>
85<dl class="method">
86<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.__add__">
87<tt class="descname">__add__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.__add__" title="Permalink to this definition">¶</a></dt>
88<dd></dd></dl>
89
90<dl class="method">
91<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.__div__">
92<tt class="descname">__div__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.__div__" title="Permalink to this definition">¶</a></dt>
93<dd></dd></dl>
94
95<dl class="method">
96<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.__init__">
97<tt class="descname">__init__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.__init__" title="Permalink to this definition">¶</a></dt>
98<dd><p>Initialization</p>
99</dd></dl>
100
101<dl class="attribute">
102<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.__module__">
103<tt class="descname">__module__</tt><em class="property"> = 'sans.models.TwoPowerLawModel'</em><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.__module__" title="Permalink to this definition">¶</a></dt>
104<dd></dd></dl>
105
106<dl class="method">
107<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.__mul__">
108<tt class="descname">__mul__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.__mul__" title="Permalink to this definition">¶</a></dt>
109<dd></dd></dl>
110
111<dl class="method">
112<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.__str__">
113<tt class="descname">__str__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.__str__" title="Permalink to this definition">¶</a></dt>
114<dd><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-odd field"><th class="field-name">Returns:</th><td class="field-body">string representatio</td>
119</tr>
120</tbody>
121</table>
122</dd></dl>
123
124<dl class="method">
125<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.__sub__">
126<tt class="descname">__sub__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.__sub__" title="Permalink to this definition">¶</a></dt>
127<dd></dd></dl>
128
129<dl class="method">
130<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel._clone">
131<tt class="descname">_clone</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel._clone" title="Permalink to this definition">¶</a></dt>
132<dd><p>Internal utility function to copy the internal
133data members to a fresh copy.</p>
134</dd></dl>
135
136<dl class="method">
137<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel._twopowerlaw">
138<tt class="descname">_twopowerlaw</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel._twopowerlaw" title="Permalink to this definition">¶</a></dt>
139<dd><p>Model definition</p>
140</dd></dl>
141
142<dl class="method">
143<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.calculate_ER">
144<tt class="descname">calculate_ER</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.calculate_ER" title="Permalink to this definition">¶</a></dt>
145<dd></dd></dl>
146
147<dl class="method">
148<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.clone">
149<tt class="descname">clone</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.clone" title="Permalink to this definition">¶</a></dt>
150<dd><p>Returns a new object identical to the current object</p>
151</dd></dl>
152
153<dl class="method">
154<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.evalDistribution">
155<tt class="descname">evalDistribution</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.evalDistribution" title="Permalink to this definition">¶</a></dt>
156<dd><p>Evaluate a distribution of q-values.</p>
157<ul>
158<li><p class="first">For 1D, a numpy array is expected as input:</p>
159<blockquote>
160<div><p>evalDistribution(q)</p>
161</div></blockquote>
162</li>
163</ul>
164<p>where q is a numpy array.</p>
165<ul class="simple">
166<li>For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime],
167where 1D arrays,</li>
168</ul>
169<p>qx_prime = [ qx[0], qx[1], qx[2], ....]
170and
171qy_prime = [ qy[0], qy[1], qy[2], ....]</p>
172<p>Then get
173q = numpy.sqrt(qx_prime^2+qy_prime^2)</p>
174<p>that is a qr in 1D array;
175q = [q[0], q[1], q[2], ....]</p>
176<table class="docutils field-list" frame="void" rules="none">
177<col class="field-name" />
178<col class="field-body" />
179<tbody valign="top">
180<tr class="field-odd field"><th class="field-name">Note :</th><td class="field-body"><p class="first">Due to 2D speed issue, no anisotropic scattering
181is supported for python models, thus C-models should have</p>
182<blockquote class="last">
183<div><p>their own evalDistribution methods.</p>
184</div></blockquote>
185</td>
186</tr>
187</tbody>
188</table>
189<p>The method is then called the following way:</p>
190<p>evalDistribution(q)
191where q is a numpy array.</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-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>qdist</strong> &#8211; ndarray of scalar q-values or list [qx,qy]
197where qx,qy are 1D ndarrays</td>
198</tr>
199</tbody>
200</table>
201</dd></dl>
202
203<dl class="method">
204<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.getDispParamList">
205<tt class="descname">getDispParamList</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.getDispParamList" title="Permalink to this definition">¶</a></dt>
206<dd><p>Return a list of all available parameters for the model</p>
207</dd></dl>
208
209<dl class="method">
210<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.getParam">
211<tt class="descname">getParam</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.getParam" title="Permalink to this definition">¶</a></dt>
212<dd><p>Set the value of a model parameter</p>
213<table class="docutils field-list" frame="void" rules="none">
214<col class="field-name" />
215<col class="field-body" />
216<tbody valign="top">
217<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> &#8211; name of the parameter</td>
218</tr>
219</tbody>
220</table>
221</dd></dl>
222
223<dl class="method">
224<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.getParamList">
225<tt class="descname">getParamList</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.getParamList" title="Permalink to this definition">¶</a></dt>
226<dd><p>Return a list of all available parameters for the model</p>
227</dd></dl>
228
229<dl class="method">
230<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.getParamListWithToken">
231<tt class="descname">getParamListWithToken</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.getParamListWithToken" title="Permalink to this definition">¶</a></dt>
232<dd></dd></dl>
233
234<dl class="method">
235<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.getParamWithToken">
236<tt class="descname">getParamWithToken</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.getParamWithToken" title="Permalink to this definition">¶</a></dt>
237<dd></dd></dl>
238
239<dl class="method">
240<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.is_fittable">
241<tt class="descname">is_fittable</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.is_fittable" title="Permalink to this definition">¶</a></dt>
242<dd><p>Check if a given parameter is fittable or not</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-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>par_name</strong> &#8211; the parameter name to check</td>
248</tr>
249</tbody>
250</table>
251</dd></dl>
252
253<dl class="method">
254<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.run">
255<tt class="descname">run</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.run" title="Permalink to this definition">¶</a></dt>
256<dd><p>Evaluate the model
257&#64;param x: input q-value (float or [float, float] as [r, theta])
258&#64;return: (guinier value)</p>
259</dd></dl>
260
261<dl class="method">
262<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.runXY">
263<tt class="descname">runXY</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.runXY" title="Permalink to this definition">¶</a></dt>
264<dd><p>Evaluate the model
265&#64;param x: input q-value (float or [float, float] as [qx, qy])
266&#64;return: guinier value</p>
267</dd></dl>
268
269<dl class="method">
270<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.setParam">
271<tt class="descname">setParam</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.setParam" title="Permalink to this definition">¶</a></dt>
272<dd><p>Set the value of a model parameter</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-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
278<li><strong>name</strong> &#8211; name of the parameter</li>
279<li><strong>value</strong> &#8211; value of the parameter</li>
280</ul>
281</td>
282</tr>
283</tbody>
284</table>
285</dd></dl>
286
287<dl class="method">
288<dt id="sans.models.TwoPowerLawModel.TwoPowerLawModel.setParamWithToken">
289<tt class="descname">setParamWithToken</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.TwoPowerLawModel.TwoPowerLawModel.setParamWithToken" title="Permalink to this definition">¶</a></dt>
290<dd></dd></dl>
291
292</dd></dl>
293
294</div>
295</div>
296
297
298          </div>
299        </div>
300      </div>
301      <div class="sphinxsidebar">
302        <div class="sphinxsidebarwrapper">
303  <h3><a href="../index.html">Table Of Contents</a></h3>
304  <ul>
305<li><a class="reference internal" href="#">TwoPowerLawModel</a><ul>
306<li><a class="reference internal" href="#sans-models-twopowerlawmodel"><tt class="docutils literal"><span class="pre">sans.models.TwoPowerLawModel</span></tt></a></li>
307</ul>
308</li>
309</ul>
310
311  <h4>Previous topic</h4>
312  <p class="topless"><a href="TwoLorentzianModel.html"
313                        title="previous chapter">TwoLorentzianModel</a></p>
314  <h4>Next topic</h4>
315  <p class="topless"><a href="UnifiedPowerRgModel.html"
316                        title="next chapter">UnifiedPowerRgModel</a></p>
317  <h3>This Page</h3>
318  <ul class="this-page-menu">
319    <li><a href="../_sources/api/TwoPowerLawModel.txt"
320           rel="nofollow">Show Source</a></li>
321  </ul>
322<div id="searchbox" style="display: none">
323  <h3>Quick search</h3>
324    <form class="search" action="../search.html" method="get">
325      <input type="text" name="q" />
326      <input type="submit" value="Go" />
327      <input type="hidden" name="check_keywords" value="yes" />
328      <input type="hidden" name="area" value="default" />
329    </form>
330    <p class="searchtip" style="font-size: 90%">
331    Enter search terms or a module, class or function name.
332    </p>
333</div>
334<script type="text/javascript">$('#searchbox').show(0);</script>
335        </div>
336      </div>
337      <div class="clearer"></div>
338    </div>
339    <div class="related">
340      <h3>Navigation</h3>
341      <ul>
342        <li class="right" style="margin-right: 10px">
343          <a href="../genindex.html" title="General Index"
344             >index</a></li>
345        <li class="right" >
346          <a href="../py-modindex.html" title="Python Module Index"
347             >modules</a> |</li>
348        <li class="right" >
349          <a href="UnifiedPowerRgModel.html" title="UnifiedPowerRgModel"
350             >next</a> |</li>
351        <li class="right" >
352          <a href="TwoLorentzianModel.html" title="TwoLorentzianModel"
353             >previous</a> |</li>
354        <li><a href="../index.html">sansmodels 0.1.0 documentation</a> &raquo;</li>
355          <li><a href="index.html" >Reference</a> &raquo;</li> 
356      </ul>
357    </div>
358    <div class="footer">
359        &copy; Copyright 2010, sans group.
360      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.
361    </div>
362  </body>
363</html>
Note: See TracBrowser for help on using the repository browser.