source: sasview/sansmodels/docs/sphinx/html/api/LorentzModel.html @ 650fd318

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 650fd318 was 512573a, checked in by Jessica Tumarkin <jtumarki@…>, 13 years ago

HTML folder generated by Sphinx

  • Property mode set to 100644
File size: 12.9 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<html xmlns="http://www.w3.org/1999/xhtml">
7  <head>
8    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9   
10    <title>LorentzModel &mdash; sansmodels v0.1.0 documentation</title>
11    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
12    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13    <script type="text/javascript">
14      var DOCUMENTATION_OPTIONS = {
15        URL_ROOT:    '../',
16        VERSION:     '0.1.0',
17        COLLAPSE_INDEX: false,
18        FILE_SUFFIX: '.html',
19        HAS_SOURCE:  true
20      };
21    </script>
22    <script type="text/javascript" src="../_static/jquery.js"></script>
23    <script type="text/javascript" src="../_static/underscore.js"></script>
24    <script type="text/javascript" src="../_static/doctools.js"></script>
25    <link rel="top" title="sansmodels v0.1.0 documentation" href="../index.html" />
26    <link rel="up" title="Reference" href="index.html" />
27    <link rel="next" title="ModelAdaptor" href="ModelAdaptor.html" />
28    <link rel="prev" title="Lorentzian" href="Lorentzian.html" /> 
29  </head>
30  <body>
31    <div class="related">
32      <h3>Navigation</h3>
33      <ul>
34        <li class="right" style="margin-right: 10px">
35          <a href="../genindex.html" title="General Index"
36             accesskey="I">index</a></li>
37        <li class="right" >
38          <a href="../py-modindex.html" title="Python Module Index"
39             >modules</a> |</li>
40        <li class="right" >
41          <a href="ModelAdaptor.html" title="ModelAdaptor"
42             accesskey="N">next</a> |</li>
43        <li class="right" >
44          <a href="Lorentzian.html" title="Lorentzian"
45             accesskey="P">previous</a> |</li>
46        <li><a href="../index.html">sansmodels v0.1.0 documentation</a> &raquo;</li>
47          <li><a href="index.html" accesskey="U">Reference</a> &raquo;</li> 
48      </ul>
49    </div> 
50
51    <div class="document">
52      <div class="documentwrapper">
53        <div class="bodywrapper">
54          <div class="body">
55           
56  <div class="section" id="lorentzmodel">
57<h1>LorentzModel<a class="headerlink" href="#lorentzmodel" title="Permalink to this headline">¶</a></h1>
58<div class="section" id="module-sans.models.LorentzModel">
59<span id="sans-models-lorentzmodel"></span><h2><a class="reference internal" href="#module-sans.models.LorentzModel" title="sans.models.LorentzModel"><tt class="xref py py-mod docutils literal"><span class="pre">sans.models.LorentzModel</span></tt></a><a class="headerlink" href="#module-sans.models.LorentzModel" title="Permalink to this headline">¶</a></h2>
60<p>Provide F(x) = scale/( 1 + (x*L)^2 ) + bkd
61Lorentz (Ornstein-Zernicke) function as a BaseComponent model</p>
62<dl class="class">
63<dt id="sans.models.LorentzModel.LorentzModel">
64<em class="property">class </em><tt class="descclassname">sans.models.LorentzModel.</tt><tt class="descname">LorentzModel</tt><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel" title="Permalink to this definition">¶</a></dt>
65<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>
66<p>Class that evaluates a Lorentz (Ornstein-Zernicke) model.</p>
67<p>F(x) = scale/( 1 + (x*L)^2 ) + bkd</p>
68<dl class="docutils">
69<dt>The model has three parameters: </dt>
70<dd>L     =  screen Length
71scale  =  scale factor
72bkd    =  incoherent background</dd>
73</dl>
74<dl class="method">
75<dt id="sans.models.LorentzModel.LorentzModel.calculate_ER">
76<tt class="descname">calculate_ER</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.calculate_ER" title="Permalink to this definition">¶</a></dt>
77<dd></dd></dl>
78
79<dl class="method">
80<dt id="sans.models.LorentzModel.LorentzModel.clone">
81<tt class="descname">clone</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.clone" title="Permalink to this definition">¶</a></dt>
82<dd><p>Returns a new object identical to the current object</p>
83</dd></dl>
84
85<dl class="method">
86<dt id="sans.models.LorentzModel.LorentzModel.evalDistribution">
87<tt class="descname">evalDistribution</tt><big>(</big><em>qdist</em><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.evalDistribution" title="Permalink to this definition">¶</a></dt>
88<dd><p>Evaluate a distribution of q-values.</p>
89<ul>
90<li><p class="first">For 1D, a numpy array is expected as input:</p>
91<blockquote>
92<div><p>evalDistribution(q)</p>
93</div></blockquote>
94</li>
95</ul>
96<p>where q is a numpy array.</p>
97<ul class="simple">
98<li>For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime],
99where 1D arrays,</li>
100</ul>
101<p>qx_prime = [ qx[0], qx[1], qx[2], ....]
102and
103qy_prime = [ qy[0], qy[1], qy[2], ....]</p>
104<p>Then get
105q = numpy.sqrt(qx_prime^2+qy_prime^2)</p>
106<p>that is a qr in 1D array;
107q = [q[0], q[1], q[2], ....]</p>
108<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"><th class="field-name">Note :</th><td class="field-body"><p class="first">Due to 2D speed issue, no anisotropic scattering
113is supported for python models, thus C-models should have</p>
114<blockquote class="last">
115<div><p>their own evalDistribution methods.</p>
116</div></blockquote>
117</td>
118</tr>
119</tbody>
120</table>
121<p>The method is then called the following way:</p>
122<p>evalDistribution(q)
123where q is a numpy array.</p>
124<table class="docutils field-list" frame="void" rules="none">
125<col class="field-name" />
126<col class="field-body" />
127<tbody valign="top">
128<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>qdist</strong> &#8211; ndarray of scalar q-values or list [qx,qy]
129where qx,qy are 1D ndarrays</td>
130</tr>
131</tbody>
132</table>
133</dd></dl>
134
135<dl class="method">
136<dt id="sans.models.LorentzModel.LorentzModel.getDispParamList">
137<tt class="descname">getDispParamList</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.getDispParamList" title="Permalink to this definition">¶</a></dt>
138<dd><p>Return a list of all available parameters for the model</p>
139</dd></dl>
140
141<dl class="method">
142<dt id="sans.models.LorentzModel.LorentzModel.getParam">
143<tt class="descname">getParam</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.getParam" title="Permalink to this definition">¶</a></dt>
144<dd><p>Set the value of a model parameter</p>
145<table class="docutils field-list" frame="void" rules="none">
146<col class="field-name" />
147<col class="field-body" />
148<tbody valign="top">
149<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> &#8211; name of the parameter</td>
150</tr>
151</tbody>
152</table>
153</dd></dl>
154
155<dl class="method">
156<dt id="sans.models.LorentzModel.LorentzModel.getParamList">
157<tt class="descname">getParamList</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.getParamList" title="Permalink to this definition">¶</a></dt>
158<dd><p>Return a list of all available parameters for the model</p>
159</dd></dl>
160
161<dl class="method">
162<dt id="sans.models.LorentzModel.LorentzModel.getParamListWithToken">
163<tt class="descname">getParamListWithToken</tt><big>(</big><em>token</em>, <em>member</em><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.getParamListWithToken" title="Permalink to this definition">¶</a></dt>
164<dd></dd></dl>
165
166<dl class="method">
167<dt id="sans.models.LorentzModel.LorentzModel.getParamWithToken">
168<tt class="descname">getParamWithToken</tt><big>(</big><em>name</em>, <em>token</em>, <em>member</em><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.getParamWithToken" title="Permalink to this definition">¶</a></dt>
169<dd></dd></dl>
170
171<dl class="method">
172<dt id="sans.models.LorentzModel.LorentzModel.is_fittable">
173<tt class="descname">is_fittable</tt><big>(</big><em>par_name</em><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.is_fittable" title="Permalink to this definition">¶</a></dt>
174<dd><p>Check if a given parameter is fittable or not</p>
175<table class="docutils field-list" frame="void" rules="none">
176<col class="field-name" />
177<col class="field-body" />
178<tbody valign="top">
179<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>par_name</strong> &#8211; the parameter name to check</td>
180</tr>
181</tbody>
182</table>
183</dd></dl>
184
185<dl class="method">
186<dt id="sans.models.LorentzModel.LorentzModel.run">
187<tt class="descname">run</tt><big>(</big><em>x=0.0</em><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.run" title="Permalink to this definition">¶</a></dt>
188<dd><p>Evaluate the model
189&#64;param x: input q-value (float or [float, float] as [r, theta])
190&#64;return: (Lorentz value)</p>
191</dd></dl>
192
193<dl class="method">
194<dt id="sans.models.LorentzModel.LorentzModel.runXY">
195<tt class="descname">runXY</tt><big>(</big><em>x=0.0</em><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.runXY" title="Permalink to this definition">¶</a></dt>
196<dd><p>Evaluate the model
197&#64;param x: input q-value (float or [float, float] as [qx, qy])
198&#64;return: Lorentz value</p>
199</dd></dl>
200
201<dl class="method">
202<dt id="sans.models.LorentzModel.LorentzModel.setParam">
203<tt class="descname">setParam</tt><big>(</big><em>name</em>, <em>value</em><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.setParam" 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"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
210<li><strong>name</strong> &#8211; name of the parameter</li>
211<li><strong>value</strong> &#8211; value of the parameter</li>
212</ul>
213</td>
214</tr>
215</tbody>
216</table>
217</dd></dl>
218
219<dl class="method">
220<dt id="sans.models.LorentzModel.LorentzModel.setParamWithToken">
221<tt class="descname">setParamWithToken</tt><big>(</big><em>name</em>, <em>value</em>, <em>token</em>, <em>member</em><big>)</big><a class="headerlink" href="#sans.models.LorentzModel.LorentzModel.setParamWithToken" title="Permalink to this definition">¶</a></dt>
222<dd></dd></dl>
223
224</dd></dl>
225
226</div>
227</div>
228
229
230          </div>
231        </div>
232      </div>
233      <div class="sphinxsidebar">
234        <div class="sphinxsidebarwrapper">
235  <h3><a href="../index.html">Table Of Contents</a></h3>
236  <ul>
237<li><a class="reference internal" href="#">LorentzModel</a><ul>
238<li><a class="reference internal" href="#module-sans.models.LorentzModel"><tt class="docutils literal"><span class="pre">sans.models.LorentzModel</span></tt></a></li>
239</ul>
240</li>
241</ul>
242
243  <h4>Previous topic</h4>
244  <p class="topless"><a href="Lorentzian.html"
245                        title="previous chapter">Lorentzian</a></p>
246  <h4>Next topic</h4>
247  <p class="topless"><a href="ModelAdaptor.html"
248                        title="next chapter">ModelAdaptor</a></p>
249  <h3>This Page</h3>
250  <ul class="this-page-menu">
251    <li><a href="../_sources/api/LorentzModel.txt"
252           rel="nofollow">Show Source</a></li>
253  </ul>
254<div id="searchbox" style="display: none">
255  <h3>Quick search</h3>
256    <form class="search" action="../search.html" method="get">
257      <input type="text" name="q" size="18" />
258      <input type="submit" value="Go" />
259      <input type="hidden" name="check_keywords" value="yes" />
260      <input type="hidden" name="area" value="default" />
261    </form>
262    <p class="searchtip" style="font-size: 90%">
263    Enter search terms or a module, class or function name.
264    </p>
265</div>
266<script type="text/javascript">$('#searchbox').show(0);</script>
267        </div>
268      </div>
269      <div class="clearer"></div>
270    </div>
271    <div class="related">
272      <h3>Navigation</h3>
273      <ul>
274        <li class="right" style="margin-right: 10px">
275          <a href="../genindex.html" title="General Index"
276             >index</a></li>
277        <li class="right" >
278          <a href="../py-modindex.html" title="Python Module Index"
279             >modules</a> |</li>
280        <li class="right" >
281          <a href="ModelAdaptor.html" title="ModelAdaptor"
282             >next</a> |</li>
283        <li class="right" >
284          <a href="Lorentzian.html" title="Lorentzian"
285             >previous</a> |</li>
286        <li><a href="../index.html">sansmodels v0.1.0 documentation</a> &raquo;</li>
287          <li><a href="index.html" >Reference</a> &raquo;</li> 
288      </ul>
289    </div>
290    <div class="footer">
291        &copy; Copyright 2010, sans group.
292      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
293    </div>
294  </body>
295</html>
Note: See TracBrowser for help on using the repository browser.