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