source: sasview/sansmodels/docs/sphinx/html/api/DebyeModel.html @ 8d70c0a

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

edit docs for models

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