source: sasview/sansmodels/docs/sphinx/html/api/AddComponent.html @ 017e0390

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

HTML folder generated by Sphinx

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