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