source: sasview/sansmodels/docs/sphinx/html/api/FractalMode_pymodell.html @ dcbd084f

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

edit docs for models

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