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 — 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> »</li> |
---|
47 | <li><a href="index.html" accesskey="U">Reference</a> »</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" title="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.doucet%40nist.gov">mathieu<span>.</span>doucet<span>@</span>nist<span>.</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 |
---|
76 | Python class that takes a model and averages its output |
---|
77 | for a distribution of its parameters.</p> |
---|
78 | <p>The parameters to be varied are specified at instantiation time. |
---|
79 | The distributions are Gaussian, with std deviations specified for |
---|
80 | each 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">"CylinderModel"</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">'cyl_phi'</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><p>Return a identical copy of self</p> |
---|
96 | </dd></dl> |
---|
97 | |
---|
98 | <dl class="method"> |
---|
99 | <dt id="sans.models.DisperseModel.DisperseModel.evalDistribution"> |
---|
100 | <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> |
---|
101 | <dd><p>Evaluate a distribution of q-values.</p> |
---|
102 | <ul> |
---|
103 | <li><p class="first">For 1D, a numpy array is expected as input:</p> |
---|
104 | <blockquote> |
---|
105 | <div><p>evalDistribution(q)</p> |
---|
106 | </div></blockquote> |
---|
107 | </li> |
---|
108 | </ul> |
---|
109 | <p>where q is a numpy array.</p> |
---|
110 | <ul class="simple"> |
---|
111 | <li>For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], |
---|
112 | where 1D arrays,</li> |
---|
113 | </ul> |
---|
114 | <p>qx_prime = [ qx[0], qx[1], qx[2], ....] |
---|
115 | and |
---|
116 | qy_prime = [ qy[0], qy[1], qy[2], ....]</p> |
---|
117 | <p>Then get |
---|
118 | q = numpy.sqrt(qx_prime^2+qy_prime^2)</p> |
---|
119 | <p>that is a qr in 1D array; |
---|
120 | q = [q[0], q[1], q[2], ....]</p> |
---|
121 | <table class="docutils field-list" frame="void" rules="none"> |
---|
122 | <col class="field-name" /> |
---|
123 | <col class="field-body" /> |
---|
124 | <tbody valign="top"> |
---|
125 | <tr class="field"><th class="field-name">Note :</th><td class="field-body"><p class="first">Due to 2D speed issue, no anisotropic scattering |
---|
126 | is supported for python models, thus C-models should have</p> |
---|
127 | <blockquote class="last"> |
---|
128 | <div><p>their own evalDistribution methods.</p> |
---|
129 | </div></blockquote> |
---|
130 | </td> |
---|
131 | </tr> |
---|
132 | </tbody> |
---|
133 | </table> |
---|
134 | <p>The method is then called the following way:</p> |
---|
135 | <p>evalDistribution(q) |
---|
136 | where q is a numpy array.</p> |
---|
137 | <table class="docutils field-list" frame="void" rules="none"> |
---|
138 | <col class="field-name" /> |
---|
139 | <col class="field-body" /> |
---|
140 | <tbody valign="top"> |
---|
141 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>qdist</strong> – ndarray of scalar q-values or list [qx,qy] |
---|
142 | where qx,qy are 1D ndarrays</td> |
---|
143 | </tr> |
---|
144 | </tbody> |
---|
145 | </table> |
---|
146 | </dd></dl> |
---|
147 | |
---|
148 | <dl class="method"> |
---|
149 | <dt id="sans.models.DisperseModel.DisperseModel.getDispParamList"> |
---|
150 | <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> |
---|
151 | <dd><p>Return a list of all available parameters for the model</p> |
---|
152 | </dd></dl> |
---|
153 | |
---|
154 | <dl class="method"> |
---|
155 | <dt id="sans.models.DisperseModel.DisperseModel.getParam"> |
---|
156 | <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> |
---|
157 | <dd></dd></dl> |
---|
158 | |
---|
159 | <dl class="method"> |
---|
160 | <dt id="sans.models.DisperseModel.DisperseModel.getParamList"> |
---|
161 | <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> |
---|
162 | <dd><p>Return a list of all available parameters for the model</p> |
---|
163 | </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"><strong>par_name</strong> – the parameter name to check</td> |
---|
184 | </tr> |
---|
185 | </tbody> |
---|
186 | </table> |
---|
187 | </dd></dl> |
---|
188 | |
---|
189 | <dl class="attribute"> |
---|
190 | <dt id="sans.models.DisperseModel.DisperseModel.model"> |
---|
191 | <tt class="descname">model</tt><a class="headerlink" href="#sans.models.DisperseModel.DisperseModel.model" title="Permalink to this definition">¶</a></dt> |
---|
192 | <dd><p>Model to disperse</p> |
---|
193 | </dd></dl> |
---|
194 | |
---|
195 | <dl class="attribute"> |
---|
196 | <dt id="sans.models.DisperseModel.DisperseModel.params"> |
---|
197 | <tt class="descname">params</tt><a class="headerlink" href="#sans.models.DisperseModel.DisperseModel.params" title="Permalink to this definition">¶</a></dt> |
---|
198 | <dd><p>Parameters</p> |
---|
199 | </dd></dl> |
---|
200 | |
---|
201 | <dl class="method"> |
---|
202 | <dt id="sans.models.DisperseModel.DisperseModel.run"> |
---|
203 | <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> |
---|
204 | <dd><p>Evaluate the model</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"><th class="field-name">Parameters:</th><td class="field-body"><strong>x</strong> – input q, or [q,phi]</td> |
---|
210 | </tr> |
---|
211 | <tr class="field"><th class="field-name">Returns:</th><td class="field-body">scattering function P(q)</td> |
---|
212 | </tr> |
---|
213 | </tbody> |
---|
214 | </table> |
---|
215 | </dd></dl> |
---|
216 | |
---|
217 | <dl class="method"> |
---|
218 | <dt id="sans.models.DisperseModel.DisperseModel.runXY"> |
---|
219 | <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> |
---|
220 | <dd><p>Evaluate the model</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"><th class="field-name">Parameters:</th><td class="field-body"><strong>x</strong> – input q, or [q,phi]</td> |
---|
226 | </tr> |
---|
227 | <tr class="field"><th class="field-name">Returns:</th><td class="field-body">scattering function P(q)</td> |
---|
228 | </tr> |
---|
229 | </tbody> |
---|
230 | </table> |
---|
231 | </dd></dl> |
---|
232 | |
---|
233 | <dl class="method"> |
---|
234 | <dt id="sans.models.DisperseModel.DisperseModel.setParam"> |
---|
235 | <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> |
---|
236 | <dd></dd></dl> |
---|
237 | |
---|
238 | <dl class="method"> |
---|
239 | <dt id="sans.models.DisperseModel.DisperseModel.setParamWithToken"> |
---|
240 | <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> |
---|
241 | <dd></dd></dl> |
---|
242 | |
---|
243 | </dd></dl> |
---|
244 | |
---|
245 | </div> |
---|
246 | </div> |
---|
247 | |
---|
248 | |
---|
249 | </div> |
---|
250 | </div> |
---|
251 | </div> |
---|
252 | <div class="sphinxsidebar"> |
---|
253 | <div class="sphinxsidebarwrapper"> |
---|
254 | <h3><a href="../index.html">Table Of Contents</a></h3> |
---|
255 | <ul> |
---|
256 | <li><a class="reference internal" href="#">DisperseModel</a><ul> |
---|
257 | <li><a class="reference internal" href="#module-sans.models.DisperseModel"><tt class="docutils literal"><span class="pre">sans.models.DisperseModel</span></tt></a></li> |
---|
258 | </ul> |
---|
259 | </li> |
---|
260 | </ul> |
---|
261 | |
---|
262 | <h4>Previous topic</h4> |
---|
263 | <p class="topless"><a href="DiamEllipFunc.html" |
---|
264 | title="previous chapter">DiamEllipFunc</a></p> |
---|
265 | <h4>Next topic</h4> |
---|
266 | <p class="topless"><a href="dispersion_models.html" |
---|
267 | title="next chapter">dispersion_models</a></p> |
---|
268 | <h3>This Page</h3> |
---|
269 | <ul class="this-page-menu"> |
---|
270 | <li><a href="../_sources/api/DisperseModel.txt" |
---|
271 | rel="nofollow">Show Source</a></li> |
---|
272 | </ul> |
---|
273 | <div id="searchbox" style="display: none"> |
---|
274 | <h3>Quick search</h3> |
---|
275 | <form class="search" action="../search.html" method="get"> |
---|
276 | <input type="text" name="q" size="18" /> |
---|
277 | <input type="submit" value="Go" /> |
---|
278 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
279 | <input type="hidden" name="area" value="default" /> |
---|
280 | </form> |
---|
281 | <p class="searchtip" style="font-size: 90%"> |
---|
282 | Enter search terms or a module, class or function name. |
---|
283 | </p> |
---|
284 | </div> |
---|
285 | <script type="text/javascript">$('#searchbox').show(0);</script> |
---|
286 | </div> |
---|
287 | </div> |
---|
288 | <div class="clearer"></div> |
---|
289 | </div> |
---|
290 | <div class="related"> |
---|
291 | <h3>Navigation</h3> |
---|
292 | <ul> |
---|
293 | <li class="right" style="margin-right: 10px"> |
---|
294 | <a href="../genindex.html" title="General Index" |
---|
295 | >index</a></li> |
---|
296 | <li class="right" > |
---|
297 | <a href="../py-modindex.html" title="Python Module Index" |
---|
298 | >modules</a> |</li> |
---|
299 | <li class="right" > |
---|
300 | <a href="dispersion_models.html" title="dispersion_models" |
---|
301 | >next</a> |</li> |
---|
302 | <li class="right" > |
---|
303 | <a href="DiamEllipFunc.html" title="DiamEllipFunc" |
---|
304 | >previous</a> |</li> |
---|
305 | <li><a href="../index.html">sansmodels v0.1.0 documentation</a> »</li> |
---|
306 | <li><a href="index.html" >Reference</a> »</li> |
---|
307 | </ul> |
---|
308 | </div> |
---|
309 | <div class="footer"> |
---|
310 | © Copyright 2010, sans group. |
---|
311 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. |
---|
312 | </div> |
---|
313 | </body> |
---|
314 | </html> |
---|