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