source: sasview/sansmodels/docs/sphinx/html/api/PeakLorentzModel.html @ dcbd084f

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

edit docs for models

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