source: sasview/sansmodels/docs/sphinx/_build/html/api/DisperseModel.html @ 5062bbf

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

working on documentation

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