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