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