source: sasview/sansmodels/docs/sphinx/_build/html/api/LineModel.html @ 0b12abb5

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 0b12abb5 was 79ac6f8, checked in by Gervaise Alina <gervyh@…>, 15 years ago

working on documentation

  • Property mode set to 100644
File size: 12.5 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>LineModel &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="LogNormal" href="LogNormal.html" />
28    <link rel="prev" title="LamellarPSModel" href="LamellarPSModel.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="LogNormal.html" title="LogNormal"
42             accesskey="N">next</a> |</li>
43        <li class="right" >
44          <a href="LamellarPSModel.html" title="LamellarPSModel"
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="linemodel">
57<h1>LineModel<a class="headerlink" href="#linemodel" title="Permalink to this headline">¶</a></h1>
58<div class="section" id="module-sans.models.LineModel">
59<span id="sans-models-linemodel"></span><h2><a class="reference internal" href="#module-sans.models.LineModel"><tt class="xref py py-mod docutils literal"><span class="pre">sans.models.LineModel</span></tt></a><a class="headerlink" href="#module-sans.models.LineModel" title="Permalink to this headline">¶</a></h2>
60<p>Provide Line function (y= A + Bx) as a BaseComponent model</p>
61<dl class="class">
62<dt id="sans.models.LineModel.LineModel">
63<em class="property">class </em><tt class="descclassname">sans.models.LineModel.</tt><tt class="descname">LineModel</tt><a class="headerlink" href="#sans.models.LineModel.LineModel" title="Permalink to this definition">¶</a></dt>
64<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>
65<p>Class that evaluates a linear model.</p>
66<p>f(x) = A + Bx</p>
67<dl class="docutils">
68<dt>List of default parameters:</dt>
69<dd>A = 1.0
70B = 1.0</dd>
71</dl>
72<dl class="method">
73<dt id="sans.models.LineModel.LineModel.calculate_ER">
74<tt class="descname">calculate_ER</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.calculate_ER" title="Permalink to this definition">¶</a></dt>
75<dd></dd></dl>
76
77<dl class="method">
78<dt id="sans.models.LineModel.LineModel.clone">
79<tt class="descname">clone</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.clone" title="Permalink to this definition">¶</a></dt>
80<dd>Returns a new object identical to the current object</dd></dl>
81
82<dl class="method">
83<dt id="sans.models.LineModel.LineModel.evalDistribution">
84<tt class="descname">evalDistribution</tt><big>(</big><em>qdist</em><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.evalDistribution" title="Permalink to this definition">¶</a></dt>
85<dd><p>Evaluate a distribution of q-values.</p>
86<ul>
87<li><p class="first">For 1D, a numpy array is expected as input:</p>
88<blockquote>
89<p>evalDistribution(q)</p>
90</blockquote>
91</li>
92</ul>
93<p>where q is a numpy array.</p>
94<ul class="simple">
95<li>For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime],
96where 1D arrays,</li>
97</ul>
98<p>qx_prime = [ qx[0], qx[1], qx[2], ....]
99and
100qy_prime = [ qy[0], qy[1], qy[2], ....]</p>
101<p>Then get
102q = numpy.sqrt(qx_prime^2+qy_prime^2)</p>
103<p>that is a qr in 1D array;
104q = [q[0], q[1], q[2], ....]</p>
105<table class="docutils field-list" frame="void" rules="none">
106<col class="field-name" />
107<col class="field-body" />
108<tbody valign="top">
109<tr class="field"><th class="field-name">Note :</th><td class="field-body"><p class="first">Due to 2D speed issue, no anisotropic scattering
110is supported for python models, thus C-models should have</p>
111<blockquote class="last">
112<p>their own evalDistribution methods.</p>
113</blockquote>
114</td>
115</tr>
116</tbody>
117</table>
118<p>The method is then called the following way:</p>
119<p>evalDistribution(q)
120where q is a numpy array.</p>
121<table class="docutils field-list" frame="void" rules="none">
122<col class="field-name" />
123<col class="field-body" />
124<tbody valign="top">
125<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
126<li><strong>qdist</strong> &#8211; ndarray of scalar q-values or list [qx,qy]
127where qx,qy are 1D ndarrays</li>
128</ul>
129</td>
130</tr>
131</tbody>
132</table>
133</dd></dl>
134
135<dl class="method">
136<dt id="sans.models.LineModel.LineModel.getDispParamList">
137<tt class="descname">getDispParamList</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.getDispParamList" title="Permalink to this definition">¶</a></dt>
138<dd>Return a list of all available parameters for the model</dd></dl>
139
140<dl class="method">
141<dt id="sans.models.LineModel.LineModel.getParam">
142<tt class="descname">getParam</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.getParam" title="Permalink to this definition">¶</a></dt>
143<dd><p>Set the value of a model parameter</p>
144<table class="docutils field-list" frame="void" rules="none">
145<col class="field-name" />
146<col class="field-body" />
147<tbody valign="top">
148<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
149<li><strong>name</strong> &#8211; name of the parameter</li>
150</ul>
151</td>
152</tr>
153</tbody>
154</table>
155</dd></dl>
156
157<dl class="method">
158<dt id="sans.models.LineModel.LineModel.getParamList">
159<tt class="descname">getParamList</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.getParamList" title="Permalink to this definition">¶</a></dt>
160<dd>Return a list of all available parameters for the model</dd></dl>
161
162<dl class="method">
163<dt id="sans.models.LineModel.LineModel.getParamListWithToken">
164<tt class="descname">getParamListWithToken</tt><big>(</big><em>token</em>, <em>member</em><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.getParamListWithToken" title="Permalink to this definition">¶</a></dt>
165<dd></dd></dl>
166
167<dl class="method">
168<dt id="sans.models.LineModel.LineModel.getParamWithToken">
169<tt class="descname">getParamWithToken</tt><big>(</big><em>name</em>, <em>token</em>, <em>member</em><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.getParamWithToken" title="Permalink to this definition">¶</a></dt>
170<dd></dd></dl>
171
172<dl class="method">
173<dt id="sans.models.LineModel.LineModel.is_fittable">
174<tt class="descname">is_fittable</tt><big>(</big><em>par_name</em><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.is_fittable" title="Permalink to this definition">¶</a></dt>
175<dd><p>Check if a given parameter is fittable or not</p>
176<table class="docutils field-list" frame="void" rules="none">
177<col class="field-name" />
178<col class="field-body" />
179<tbody valign="top">
180<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
181<li><strong>par_name</strong> &#8211; the parameter name to check</li>
182</ul>
183</td>
184</tr>
185</tbody>
186</table>
187</dd></dl>
188
189<dl class="method">
190<dt id="sans.models.LineModel.LineModel.run">
191<tt class="descname">run</tt><big>(</big><em>x=0.0</em><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.run" title="Permalink to this definition">¶</a></dt>
192<dd>Evaluate the model
193&#64;param x: simple value
194&#64;return: (Line value)</dd></dl>
195
196<dl class="method">
197<dt id="sans.models.LineModel.LineModel.runXY">
198<tt class="descname">runXY</tt><big>(</big><em>x=0.0</em><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.runXY" title="Permalink to this definition">¶</a></dt>
199<dd>Evaluate the model
200&#64;param x: simple value
201&#64;return: Line value</dd></dl>
202
203<dl class="method">
204<dt id="sans.models.LineModel.LineModel.setParam">
205<tt class="descname">setParam</tt><big>(</big><em>name</em>, <em>value</em><big>)</big><a class="headerlink" href="#sans.models.LineModel.LineModel.setParam" 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"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
212<li><strong>name</strong> &#8211; name of the parameter</li>
213<li><strong>value</strong> &#8211; value of the parameter</li>
214</ul>
215</td>
216</tr>
217</tbody>
218</table>
219</dd></dl>
220
221<dl class="method">
222<dt id="sans.models.LineModel.LineModel.setParamWithToken">
223<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.LineModel.LineModel.setParamWithToken" title="Permalink to this definition">¶</a></dt>
224<dd></dd></dl>
225
226</dd></dl>
227
228</div>
229</div>
230
231
232          </div>
233        </div>
234      </div>
235      <div class="sphinxsidebar">
236        <div class="sphinxsidebarwrapper">
237  <h3><a href="../index.html">Table Of Contents</a></h3>
238  <ul>
239<li><a class="reference internal" href="#">LineModel</a><ul>
240<li><a class="reference internal" href="#module-sans.models.LineModel"><tt class="docutils literal"><span class="pre">sans.models.LineModel</span></tt></a></li>
241</ul>
242</li>
243</ul>
244
245  <h4>Previous topic</h4>
246  <p class="topless"><a href="LamellarPSModel.html"
247                        title="previous chapter">LamellarPSModel</a></p>
248  <h4>Next topic</h4>
249  <p class="topless"><a href="LogNormal.html"
250                        title="next chapter">LogNormal</a></p>
251  <h3>This Page</h3>
252  <ul class="this-page-menu">
253    <li><a href="../_sources/api/LineModel.txt"
254           rel="nofollow">Show Source</a></li>
255  </ul>
256<div id="searchbox" style="display: none">
257  <h3>Quick search</h3>
258    <form class="search" action="../search.html" method="get">
259      <input type="text" name="q" size="18" />
260      <input type="submit" value="Go" />
261      <input type="hidden" name="check_keywords" value="yes" />
262      <input type="hidden" name="area" value="default" />
263    </form>
264    <p class="searchtip" style="font-size: 90%">
265    Enter search terms or a module, class or function name.
266    </p>
267</div>
268<script type="text/javascript">$('#searchbox').show(0);</script>
269        </div>
270      </div>
271      <div class="clearer"></div>
272    </div>
273    <div class="related">
274      <h3>Navigation</h3>
275      <ul>
276        <li class="right" style="margin-right: 10px">
277          <a href="../genindex.html" title="General Index"
278             >index</a></li>
279        <li class="right" >
280          <a href="../py-modindex.html" title="Python Module Index"
281             >modules</a> |</li>
282        <li class="right" >
283          <a href="LogNormal.html" title="LogNormal"
284             >next</a> |</li>
285        <li class="right" >
286          <a href="LamellarPSModel.html" title="LamellarPSModel"
287             >previous</a> |</li>
288        <li><a href="../index.html">sansmodels v0.1.0 documentation</a> &raquo;</li>
289          <li><a href="index.html" >Reference</a> &raquo;</li> 
290      </ul>
291    </div>
292    <div class="footer">
293        &copy; Copyright 2010, sans group.
294      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0b1.
295    </div>
296  </body>
297</html>
Note: See TracBrowser for help on using the repository browser.