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