source: sasview/sansmodels/docs/sphinx/html/api/PowerLawModel.html @ 43cc1ad2

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

edit docs for models

  • Property mode set to 100644
File size: 15.6 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>PowerLawModel &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="ProlateModel" href="ProlateModel.html" />
31    <link rel="prev" title="PowerLawAbsModel" href="PowerLawAbsModel.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="ProlateModel.html" title="ProlateModel"
45             accesskey="N">next</a> |</li>
46        <li class="right" >
47          <a href="PowerLawAbsModel.html" title="PowerLawAbsModel"
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="powerlawmodel">
60<h1>PowerLawModel<a class="headerlink" href="#powerlawmodel" title="Permalink to this headline">¶</a></h1>
61<div class="section" id="sans-models-powerlawmodel">
62<h2><a class="reference internal" href="#module-sans.models.PowerLawModel" title="sans.models.PowerLawModel"><tt class="xref py py-mod docutils literal"><span class="pre">sans.models.PowerLawModel</span></tt></a><a class="headerlink" href="#sans-models-powerlawmodel" title="Permalink to this headline">¶</a></h2>
63<span class="target" id="module-sans.models.PowerLawModel"></span><p>Provide F(x) = scale* (x)^(-m) + bkd
64Power law function as a BaseComponent model</p>
65<dl class="class">
66<dt id="sans.models.PowerLawModel.PowerLawModel">
67<em class="property">class </em><tt class="descclassname">sans.models.PowerLawModel.</tt><tt class="descname">PowerLawModel</tt><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel" title="Permalink to this definition">¶</a></dt>
68<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>
69<p>Class that evaluates a Power_Law model.</p>
70<p>F(x) = scale* (x)^(-m) + bkd</p>
71<dl class="docutils">
72<dt>The model has three parameters: </dt>
73<dd>m     =  power
74scale  =  scale factor
75bkd    =  incoherent background</dd>
76</dl>
77<dl class="method">
78<dt id="sans.models.PowerLawModel.PowerLawModel._PowerLaw">
79<tt class="descname">_PowerLaw</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel._PowerLaw" title="Permalink to this definition">¶</a></dt>
80<dd><p>Evaluate  F(x) = scale* (x)^(-m) + bkd</p>
81</dd></dl>
82
83<dl class="method">
84<dt id="sans.models.PowerLawModel.PowerLawModel.__add__">
85<tt class="descname">__add__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.__add__" title="Permalink to this definition">¶</a></dt>
86<dd></dd></dl>
87
88<dl class="method">
89<dt id="sans.models.PowerLawModel.PowerLawModel.__div__">
90<tt class="descname">__div__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.__div__" title="Permalink to this definition">¶</a></dt>
91<dd></dd></dl>
92
93<dl class="method">
94<dt id="sans.models.PowerLawModel.PowerLawModel.__init__">
95<tt class="descname">__init__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.__init__" title="Permalink to this definition">¶</a></dt>
96<dd><p>Initialization</p>
97</dd></dl>
98
99<dl class="attribute">
100<dt id="sans.models.PowerLawModel.PowerLawModel.__module__">
101<tt class="descname">__module__</tt><em class="property"> = 'sans.models.PowerLawModel'</em><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.__module__" title="Permalink to this definition">¶</a></dt>
102<dd></dd></dl>
103
104<dl class="method">
105<dt id="sans.models.PowerLawModel.PowerLawModel.__mul__">
106<tt class="descname">__mul__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.__mul__" title="Permalink to this definition">¶</a></dt>
107<dd></dd></dl>
108
109<dl class="method">
110<dt id="sans.models.PowerLawModel.PowerLawModel.__str__">
111<tt class="descname">__str__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.__str__" title="Permalink to this definition">¶</a></dt>
112<dd><table class="docutils field-list" frame="void" rules="none">
113<col class="field-name" />
114<col class="field-body" />
115<tbody valign="top">
116<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">string representatio</td>
117</tr>
118</tbody>
119</table>
120</dd></dl>
121
122<dl class="method">
123<dt id="sans.models.PowerLawModel.PowerLawModel.__sub__">
124<tt class="descname">__sub__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.__sub__" title="Permalink to this definition">¶</a></dt>
125<dd></dd></dl>
126
127<dl class="method">
128<dt id="sans.models.PowerLawModel.PowerLawModel._clone">
129<tt class="descname">_clone</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel._clone" title="Permalink to this definition">¶</a></dt>
130<dd><p>Internal utility function to copy the internal
131data members to a fresh copy.</p>
132</dd></dl>
133
134<dl class="method">
135<dt id="sans.models.PowerLawModel.PowerLawModel.calculate_ER">
136<tt class="descname">calculate_ER</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.calculate_ER" title="Permalink to this definition">¶</a></dt>
137<dd></dd></dl>
138
139<dl class="method">
140<dt id="sans.models.PowerLawModel.PowerLawModel.clone">
141<tt class="descname">clone</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.clone" title="Permalink to this definition">¶</a></dt>
142<dd><p>Returns a new object identical to the current object</p>
143</dd></dl>
144
145<dl class="method">
146<dt id="sans.models.PowerLawModel.PowerLawModel.evalDistribution">
147<tt class="descname">evalDistribution</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.evalDistribution" title="Permalink to this definition">¶</a></dt>
148<dd><p>Evaluate a distribution of q-values.</p>
149<ul>
150<li><p class="first">For 1D, a numpy array is expected as input:</p>
151<blockquote>
152<div><p>evalDistribution(q)</p>
153</div></blockquote>
154</li>
155</ul>
156<p>where q is a numpy array.</p>
157<ul class="simple">
158<li>For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime],
159where 1D arrays,</li>
160</ul>
161<p>qx_prime = [ qx[0], qx[1], qx[2], ....]
162and
163qy_prime = [ qy[0], qy[1], qy[2], ....]</p>
164<p>Then get
165q = numpy.sqrt(qx_prime^2+qy_prime^2)</p>
166<p>that is a qr in 1D array;
167q = [q[0], q[1], q[2], ....]</p>
168<table class="docutils field-list" frame="void" rules="none">
169<col class="field-name" />
170<col class="field-body" />
171<tbody valign="top">
172<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
173is supported for python models, thus C-models should have</p>
174<blockquote class="last">
175<div><p>their own evalDistribution methods.</p>
176</div></blockquote>
177</td>
178</tr>
179</tbody>
180</table>
181<p>The method is then called the following way:</p>
182<p>evalDistribution(q)
183where q is a numpy array.</p>
184<table class="docutils field-list" frame="void" rules="none">
185<col class="field-name" />
186<col class="field-body" />
187<tbody valign="top">
188<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]
189where qx,qy are 1D ndarrays</td>
190</tr>
191</tbody>
192</table>
193</dd></dl>
194
195<dl class="method">
196<dt id="sans.models.PowerLawModel.PowerLawModel.getDispParamList">
197<tt class="descname">getDispParamList</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.getDispParamList" title="Permalink to this definition">¶</a></dt>
198<dd><p>Return a list of all available parameters for the model</p>
199</dd></dl>
200
201<dl class="method">
202<dt id="sans.models.PowerLawModel.PowerLawModel.getParam">
203<tt class="descname">getParam</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.getParam" title="Permalink to this definition">¶</a></dt>
204<dd><p>Set the value of a model parameter</p>
205<table class="docutils field-list" frame="void" rules="none">
206<col class="field-name" />
207<col class="field-body" />
208<tbody valign="top">
209<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> &#8211; name of the parameter</td>
210</tr>
211</tbody>
212</table>
213</dd></dl>
214
215<dl class="method">
216<dt id="sans.models.PowerLawModel.PowerLawModel.getParamList">
217<tt class="descname">getParamList</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.getParamList" title="Permalink to this definition">¶</a></dt>
218<dd><p>Return a list of all available parameters for the model</p>
219</dd></dl>
220
221<dl class="method">
222<dt id="sans.models.PowerLawModel.PowerLawModel.getParamListWithToken">
223<tt class="descname">getParamListWithToken</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.getParamListWithToken" title="Permalink to this definition">¶</a></dt>
224<dd></dd></dl>
225
226<dl class="method">
227<dt id="sans.models.PowerLawModel.PowerLawModel.getParamWithToken">
228<tt class="descname">getParamWithToken</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.getParamWithToken" title="Permalink to this definition">¶</a></dt>
229<dd></dd></dl>
230
231<dl class="method">
232<dt id="sans.models.PowerLawModel.PowerLawModel.is_fittable">
233<tt class="descname">is_fittable</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.is_fittable" title="Permalink to this definition">¶</a></dt>
234<dd><p>Check if a given parameter is fittable or not</p>
235<table class="docutils field-list" frame="void" rules="none">
236<col class="field-name" />
237<col class="field-body" />
238<tbody valign="top">
239<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>
240</tr>
241</tbody>
242</table>
243</dd></dl>
244
245<dl class="method">
246<dt id="sans.models.PowerLawModel.PowerLawModel.run">
247<tt class="descname">run</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.run" title="Permalink to this definition">¶</a></dt>
248<dd><p>Evaluate the model
249&#64;param x: input q-value (float or [float, float] as [r, theta])
250&#64;return: (PowerLaw value)</p>
251</dd></dl>
252
253<dl class="method">
254<dt id="sans.models.PowerLawModel.PowerLawModel.runXY">
255<tt class="descname">runXY</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.runXY" 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 [qx, qy])
258&#64;return: PowerLaw value</p>
259</dd></dl>
260
261<dl class="method">
262<dt id="sans.models.PowerLawModel.PowerLawModel.setParam">
263<tt class="descname">setParam</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.setParam" title="Permalink to this definition">¶</a></dt>
264<dd><p>Set the value of a model parameter</p>
265<table class="docutils field-list" frame="void" rules="none">
266<col class="field-name" />
267<col class="field-body" />
268<tbody valign="top">
269<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
270<li><strong>name</strong> &#8211; name of the parameter</li>
271<li><strong>value</strong> &#8211; value of the parameter</li>
272</ul>
273</td>
274</tr>
275</tbody>
276</table>
277</dd></dl>
278
279<dl class="method">
280<dt id="sans.models.PowerLawModel.PowerLawModel.setParamWithToken">
281<tt class="descname">setParamWithToken</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.PowerLawModel.PowerLawModel.setParamWithToken" title="Permalink to this definition">¶</a></dt>
282<dd></dd></dl>
283
284</dd></dl>
285
286</div>
287</div>
288
289
290          </div>
291        </div>
292      </div>
293      <div class="sphinxsidebar">
294        <div class="sphinxsidebarwrapper">
295  <h3><a href="../index.html">Table Of Contents</a></h3>
296  <ul>
297<li><a class="reference internal" href="#">PowerLawModel</a><ul>
298<li><a class="reference internal" href="#sans-models-powerlawmodel"><tt class="docutils literal"><span class="pre">sans.models.PowerLawModel</span></tt></a></li>
299</ul>
300</li>
301</ul>
302
303  <h4>Previous topic</h4>
304  <p class="topless"><a href="PowerLawAbsModel.html"
305                        title="previous chapter">PowerLawAbsModel</a></p>
306  <h4>Next topic</h4>
307  <p class="topless"><a href="ProlateModel.html"
308                        title="next chapter">ProlateModel</a></p>
309  <h3>This Page</h3>
310  <ul class="this-page-menu">
311    <li><a href="../_sources/api/PowerLawModel.txt"
312           rel="nofollow">Show Source</a></li>
313  </ul>
314<div id="searchbox" style="display: none">
315  <h3>Quick search</h3>
316    <form class="search" action="../search.html" method="get">
317      <input type="text" name="q" />
318      <input type="submit" value="Go" />
319      <input type="hidden" name="check_keywords" value="yes" />
320      <input type="hidden" name="area" value="default" />
321    </form>
322    <p class="searchtip" style="font-size: 90%">
323    Enter search terms or a module, class or function name.
324    </p>
325</div>
326<script type="text/javascript">$('#searchbox').show(0);</script>
327        </div>
328      </div>
329      <div class="clearer"></div>
330    </div>
331    <div class="related">
332      <h3>Navigation</h3>
333      <ul>
334        <li class="right" style="margin-right: 10px">
335          <a href="../genindex.html" title="General Index"
336             >index</a></li>
337        <li class="right" >
338          <a href="../py-modindex.html" title="Python Module Index"
339             >modules</a> |</li>
340        <li class="right" >
341          <a href="ProlateModel.html" title="ProlateModel"
342             >next</a> |</li>
343        <li class="right" >
344          <a href="PowerLawAbsModel.html" title="PowerLawAbsModel"
345             >previous</a> |</li>
346        <li><a href="../index.html">sansmodels 0.1.0 documentation</a> &raquo;</li>
347          <li><a href="index.html" >Reference</a> &raquo;</li> 
348      </ul>
349    </div>
350    <div class="footer">
351        &copy; Copyright 2010, sans group.
352      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.
353    </div>
354  </body>
355</html>
Note: See TracBrowser for help on using the repository browser.