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

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 b94945d was 79ac6f8, checked in by Gervaise Alina <gervyh@…>, 14 years ago

working on documentation

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