[512573a] | 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 | |
---|
[c0d873f] | 6 | |
---|
[512573a] | 7 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
| 8 | <head> |
---|
| 9 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
| 10 | |
---|
[c0d873f] | 11 | <title>Constant — sansmodels 0.1.0 documentation</title> |
---|
| 12 | |
---|
[512573a] | 13 | <link rel="stylesheet" href="../_static/default.css" type="text/css" /> |
---|
| 14 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
---|
[c0d873f] | 15 | |
---|
[512573a] | 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> |
---|
[c0d873f] | 28 | <link rel="top" title="sansmodels 0.1.0 documentation" href="../index.html" /> |
---|
[512573a] | 29 | <link rel="up" title="Reference" href="index.html" /> |
---|
| 30 | <link rel="next" title="CoreFourShellModel" href="CoreFourShellModel.html" /> |
---|
| 31 | <link rel="prev" title="CappedCylinderModel" href="CappedCylinderModel.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="CoreFourShellModel.html" title="CoreFourShellModel" |
---|
| 45 | accesskey="N">next</a> |</li> |
---|
| 46 | <li class="right" > |
---|
| 47 | <a href="CappedCylinderModel.html" title="CappedCylinderModel" |
---|
| 48 | accesskey="P">previous</a> |</li> |
---|
[c0d873f] | 49 | <li><a href="../index.html">sansmodels 0.1.0 documentation</a> »</li> |
---|
[512573a] | 50 | <li><a href="index.html" accesskey="U">Reference</a> »</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="constant"> |
---|
| 60 | <h1>Constant<a class="headerlink" href="#constant" title="Permalink to this headline">¶</a></h1> |
---|
[c0d873f] | 61 | <div class="section" id="sans-models-constant"> |
---|
| 62 | <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="#sans-models-constant" title="Permalink to this headline">¶</a></h2> |
---|
| 63 | <span class="target" id="module-sans.models.Constant"></span><p>Provide constant function as a BaseComponent model</p> |
---|
[512573a] | 64 | <dl class="class"> |
---|
| 65 | <dt id="sans.models.Constant.Constant"> |
---|
| 66 | <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> |
---|
| 67 | <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> |
---|
| 68 | <p>Class that evaluates a constant model. |
---|
| 69 | List of default parameters:</p> |
---|
| 70 | <blockquote> |
---|
| 71 | <div>value = 1.0</div></blockquote> |
---|
| 72 | <dl class="method"> |
---|
[c0d873f] | 73 | <dt id="sans.models.Constant.Constant.__add__"> |
---|
| 74 | <tt class="descname">__add__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.__add__" title="Permalink to this definition">¶</a></dt> |
---|
| 75 | <dd></dd></dl> |
---|
| 76 | |
---|
| 77 | <dl class="method"> |
---|
| 78 | <dt id="sans.models.Constant.Constant.__div__"> |
---|
| 79 | <tt class="descname">__div__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.__div__" title="Permalink to this definition">¶</a></dt> |
---|
| 80 | <dd></dd></dl> |
---|
| 81 | |
---|
| 82 | <dl class="method"> |
---|
| 83 | <dt id="sans.models.Constant.Constant.__init__"> |
---|
| 84 | <tt class="descname">__init__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.__init__" title="Permalink to this definition">¶</a></dt> |
---|
| 85 | <dd><p>Initialization</p> |
---|
| 86 | </dd></dl> |
---|
| 87 | |
---|
| 88 | <dl class="attribute"> |
---|
| 89 | <dt id="sans.models.Constant.Constant.__module__"> |
---|
| 90 | <tt class="descname">__module__</tt><em class="property"> = 'sans.models.Constant'</em><a class="headerlink" href="#sans.models.Constant.Constant.__module__" title="Permalink to this definition">¶</a></dt> |
---|
| 91 | <dd></dd></dl> |
---|
| 92 | |
---|
| 93 | <dl class="method"> |
---|
| 94 | <dt id="sans.models.Constant.Constant.__mul__"> |
---|
| 95 | <tt class="descname">__mul__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.__mul__" title="Permalink to this definition">¶</a></dt> |
---|
| 96 | <dd></dd></dl> |
---|
| 97 | |
---|
| 98 | <dl class="method"> |
---|
| 99 | <dt id="sans.models.Constant.Constant.__str__"> |
---|
| 100 | <tt class="descname">__str__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.__str__" title="Permalink to this definition">¶</a></dt> |
---|
| 101 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
| 102 | <col class="field-name" /> |
---|
| 103 | <col class="field-body" /> |
---|
| 104 | <tbody valign="top"> |
---|
| 105 | <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">string representatio</td> |
---|
| 106 | </tr> |
---|
| 107 | </tbody> |
---|
| 108 | </table> |
---|
| 109 | </dd></dl> |
---|
| 110 | |
---|
| 111 | <dl class="method"> |
---|
| 112 | <dt id="sans.models.Constant.Constant.__sub__"> |
---|
| 113 | <tt class="descname">__sub__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.__sub__" title="Permalink to this definition">¶</a></dt> |
---|
| 114 | <dd></dd></dl> |
---|
| 115 | |
---|
| 116 | <dl class="method"> |
---|
| 117 | <dt id="sans.models.Constant.Constant._clone"> |
---|
| 118 | <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> |
---|
| 119 | <dd><p>Internal utility function to copy the internal |
---|
| 120 | data members to a fresh copy.</p> |
---|
| 121 | </dd></dl> |
---|
| 122 | |
---|
| 123 | <dl class="method"> |
---|
[512573a] | 124 | <dt id="sans.models.Constant.Constant.calculate_ER"> |
---|
| 125 | <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> |
---|
| 126 | <dd></dd></dl> |
---|
| 127 | |
---|
| 128 | <dl class="method"> |
---|
| 129 | <dt id="sans.models.Constant.Constant.clone"> |
---|
| 130 | <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> |
---|
| 131 | <dd><p>Return a identical copy of self</p> |
---|
| 132 | </dd></dl> |
---|
| 133 | |
---|
| 134 | <dl class="method"> |
---|
| 135 | <dt id="sans.models.Constant.Constant.evalDistribution"> |
---|
[c0d873f] | 136 | <tt class="descname">evalDistribution</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.evalDistribution" title="Permalink to this definition">¶</a></dt> |
---|
[512573a] | 137 | <dd><p>Evaluate a distribution of q-values.</p> |
---|
| 138 | <ul> |
---|
| 139 | <li><p class="first">For 1D, a numpy array is expected as input:</p> |
---|
| 140 | <blockquote> |
---|
| 141 | <div><p>evalDistribution(q)</p> |
---|
| 142 | </div></blockquote> |
---|
| 143 | </li> |
---|
| 144 | </ul> |
---|
| 145 | <p>where q is a numpy array.</p> |
---|
| 146 | <ul class="simple"> |
---|
| 147 | <li>For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], |
---|
| 148 | where 1D arrays,</li> |
---|
| 149 | </ul> |
---|
| 150 | <p>qx_prime = [ qx[0], qx[1], qx[2], ....] |
---|
| 151 | and |
---|
| 152 | qy_prime = [ qy[0], qy[1], qy[2], ....]</p> |
---|
| 153 | <p>Then get |
---|
| 154 | q = numpy.sqrt(qx_prime^2+qy_prime^2)</p> |
---|
| 155 | <p>that is a qr in 1D array; |
---|
| 156 | q = [q[0], q[1], q[2], ....]</p> |
---|
| 157 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 158 | <col class="field-name" /> |
---|
| 159 | <col class="field-body" /> |
---|
| 160 | <tbody valign="top"> |
---|
[c0d873f] | 161 | <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 |
---|
[512573a] | 162 | is supported for python models, thus C-models should have</p> |
---|
| 163 | <blockquote class="last"> |
---|
| 164 | <div><p>their own evalDistribution methods.</p> |
---|
| 165 | </div></blockquote> |
---|
| 166 | </td> |
---|
| 167 | </tr> |
---|
| 168 | </tbody> |
---|
| 169 | </table> |
---|
| 170 | <p>The method is then called the following way:</p> |
---|
| 171 | <p>evalDistribution(q) |
---|
| 172 | where q is a numpy array.</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"> |
---|
[c0d873f] | 177 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>qdist</strong> – ndarray of scalar q-values or list [qx,qy] |
---|
[512573a] | 178 | where qx,qy are 1D ndarrays</td> |
---|
| 179 | </tr> |
---|
| 180 | </tbody> |
---|
| 181 | </table> |
---|
| 182 | </dd></dl> |
---|
| 183 | |
---|
| 184 | <dl class="method"> |
---|
| 185 | <dt id="sans.models.Constant.Constant.getDispParamList"> |
---|
| 186 | <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> |
---|
| 187 | <dd><p>Return a list of all available parameters for the model</p> |
---|
| 188 | </dd></dl> |
---|
| 189 | |
---|
| 190 | <dl class="method"> |
---|
| 191 | <dt id="sans.models.Constant.Constant.getParam"> |
---|
[c0d873f] | 192 | <tt class="descname">getParam</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.getParam" title="Permalink to this definition">¶</a></dt> |
---|
[512573a] | 193 | <dd><p>Set the value of a model parameter</p> |
---|
| 194 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 195 | <col class="field-name" /> |
---|
| 196 | <col class="field-body" /> |
---|
| 197 | <tbody valign="top"> |
---|
[c0d873f] | 198 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> – name of the parameter</td> |
---|
[512573a] | 199 | </tr> |
---|
| 200 | </tbody> |
---|
| 201 | </table> |
---|
| 202 | </dd></dl> |
---|
| 203 | |
---|
| 204 | <dl class="method"> |
---|
| 205 | <dt id="sans.models.Constant.Constant.getParamList"> |
---|
| 206 | <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> |
---|
| 207 | <dd><p>Return a list of all available parameters for the model</p> |
---|
| 208 | </dd></dl> |
---|
| 209 | |
---|
| 210 | <dl class="method"> |
---|
| 211 | <dt id="sans.models.Constant.Constant.getParamListWithToken"> |
---|
[c0d873f] | 212 | <tt class="descname">getParamListWithToken</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.getParamListWithToken" title="Permalink to this definition">¶</a></dt> |
---|
[512573a] | 213 | <dd></dd></dl> |
---|
| 214 | |
---|
| 215 | <dl class="method"> |
---|
| 216 | <dt id="sans.models.Constant.Constant.getParamWithToken"> |
---|
[c0d873f] | 217 | <tt class="descname">getParamWithToken</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.getParamWithToken" title="Permalink to this definition">¶</a></dt> |
---|
[512573a] | 218 | <dd></dd></dl> |
---|
| 219 | |
---|
| 220 | <dl class="method"> |
---|
| 221 | <dt id="sans.models.Constant.Constant.is_fittable"> |
---|
[c0d873f] | 222 | <tt class="descname">is_fittable</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.is_fittable" title="Permalink to this definition">¶</a></dt> |
---|
[512573a] | 223 | <dd><p>Check if a given parameter is fittable or not</p> |
---|
| 224 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 225 | <col class="field-name" /> |
---|
| 226 | <col class="field-body" /> |
---|
| 227 | <tbody valign="top"> |
---|
[c0d873f] | 228 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>par_name</strong> – the parameter name to check</td> |
---|
[512573a] | 229 | </tr> |
---|
| 230 | </tbody> |
---|
| 231 | </table> |
---|
| 232 | </dd></dl> |
---|
| 233 | |
---|
| 234 | <dl class="method"> |
---|
| 235 | <dt id="sans.models.Constant.Constant.run"> |
---|
[c0d873f] | 236 | <tt class="descname">run</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.run" title="Permalink to this definition">¶</a></dt> |
---|
[512573a] | 237 | <dd><p>Evaluate the model |
---|
| 238 | @param x: unused |
---|
| 239 | @return: (constant value)</p> |
---|
| 240 | </dd></dl> |
---|
| 241 | |
---|
| 242 | <dl class="method"> |
---|
| 243 | <dt id="sans.models.Constant.Constant.runXY"> |
---|
[c0d873f] | 244 | <tt class="descname">runXY</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.runXY" title="Permalink to this definition">¶</a></dt> |
---|
[512573a] | 245 | <dd><p>Evaluate the model |
---|
| 246 | @param x: unused |
---|
| 247 | @return: constant value</p> |
---|
| 248 | </dd></dl> |
---|
| 249 | |
---|
| 250 | <dl class="method"> |
---|
| 251 | <dt id="sans.models.Constant.Constant.setParam"> |
---|
[c0d873f] | 252 | <tt class="descname">setParam</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.setParam" title="Permalink to this definition">¶</a></dt> |
---|
[512573a] | 253 | <dd><p>Set the value of a model parameter</p> |
---|
| 254 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 255 | <col class="field-name" /> |
---|
| 256 | <col class="field-body" /> |
---|
| 257 | <tbody valign="top"> |
---|
[c0d873f] | 258 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
[512573a] | 259 | <li><strong>name</strong> – name of the parameter</li> |
---|
| 260 | <li><strong>value</strong> – value of the parameter</li> |
---|
| 261 | </ul> |
---|
| 262 | </td> |
---|
| 263 | </tr> |
---|
| 264 | </tbody> |
---|
| 265 | </table> |
---|
| 266 | </dd></dl> |
---|
| 267 | |
---|
| 268 | <dl class="method"> |
---|
| 269 | <dt id="sans.models.Constant.Constant.setParamWithToken"> |
---|
[c0d873f] | 270 | <tt class="descname">setParamWithToken</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.models.Constant.Constant.setParamWithToken" title="Permalink to this definition">¶</a></dt> |
---|
[512573a] | 271 | <dd></dd></dl> |
---|
| 272 | |
---|
| 273 | </dd></dl> |
---|
| 274 | |
---|
| 275 | </div> |
---|
| 276 | </div> |
---|
| 277 | |
---|
| 278 | |
---|
| 279 | </div> |
---|
| 280 | </div> |
---|
| 281 | </div> |
---|
| 282 | <div class="sphinxsidebar"> |
---|
| 283 | <div class="sphinxsidebarwrapper"> |
---|
| 284 | <h3><a href="../index.html">Table Of Contents</a></h3> |
---|
| 285 | <ul> |
---|
| 286 | <li><a class="reference internal" href="#">Constant</a><ul> |
---|
[c0d873f] | 287 | <li><a class="reference internal" href="#sans-models-constant"><tt class="docutils literal"><span class="pre">sans.models.Constant</span></tt></a></li> |
---|
[512573a] | 288 | </ul> |
---|
| 289 | </li> |
---|
| 290 | </ul> |
---|
| 291 | |
---|
| 292 | <h4>Previous topic</h4> |
---|
| 293 | <p class="topless"><a href="CappedCylinderModel.html" |
---|
| 294 | title="previous chapter">CappedCylinderModel</a></p> |
---|
| 295 | <h4>Next topic</h4> |
---|
| 296 | <p class="topless"><a href="CoreFourShellModel.html" |
---|
| 297 | title="next chapter">CoreFourShellModel</a></p> |
---|
| 298 | <h3>This Page</h3> |
---|
| 299 | <ul class="this-page-menu"> |
---|
| 300 | <li><a href="../_sources/api/Constant.txt" |
---|
| 301 | rel="nofollow">Show Source</a></li> |
---|
| 302 | </ul> |
---|
| 303 | <div id="searchbox" style="display: none"> |
---|
| 304 | <h3>Quick search</h3> |
---|
| 305 | <form class="search" action="../search.html" method="get"> |
---|
[c0d873f] | 306 | <input type="text" name="q" /> |
---|
[512573a] | 307 | <input type="submit" value="Go" /> |
---|
| 308 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
| 309 | <input type="hidden" name="area" value="default" /> |
---|
| 310 | </form> |
---|
| 311 | <p class="searchtip" style="font-size: 90%"> |
---|
| 312 | Enter search terms or a module, class or function name. |
---|
| 313 | </p> |
---|
| 314 | </div> |
---|
| 315 | <script type="text/javascript">$('#searchbox').show(0);</script> |
---|
| 316 | </div> |
---|
| 317 | </div> |
---|
| 318 | <div class="clearer"></div> |
---|
| 319 | </div> |
---|
| 320 | <div class="related"> |
---|
| 321 | <h3>Navigation</h3> |
---|
| 322 | <ul> |
---|
| 323 | <li class="right" style="margin-right: 10px"> |
---|
| 324 | <a href="../genindex.html" title="General Index" |
---|
| 325 | >index</a></li> |
---|
| 326 | <li class="right" > |
---|
| 327 | <a href="../py-modindex.html" title="Python Module Index" |
---|
| 328 | >modules</a> |</li> |
---|
| 329 | <li class="right" > |
---|
| 330 | <a href="CoreFourShellModel.html" title="CoreFourShellModel" |
---|
| 331 | >next</a> |</li> |
---|
| 332 | <li class="right" > |
---|
| 333 | <a href="CappedCylinderModel.html" title="CappedCylinderModel" |
---|
| 334 | >previous</a> |</li> |
---|
[c0d873f] | 335 | <li><a href="../index.html">sansmodels 0.1.0 documentation</a> »</li> |
---|
[512573a] | 336 | <li><a href="index.html" >Reference</a> »</li> |
---|
| 337 | </ul> |
---|
| 338 | </div> |
---|
| 339 | <div class="footer"> |
---|
| 340 | © Copyright 2010, sans group. |
---|
[c0d873f] | 341 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1. |
---|
[512573a] | 342 | </div> |
---|
| 343 | </body> |
---|
| 344 | </html> |
---|