source: sasview/sansmodels/docs/sphinx/html/api/AddComponent.html @ 01de557

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

edit docs for models

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