source: sasview/sansmodels/docs/sphinx/html/api/pluginmodel.html @ dbdff5e

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

edit docs for models

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