source: sasview/_modules/sas/models/PowerLawAbsModel.html @ a462c6a

gh-pages
Last change on this file since a462c6a was a462c6a, checked in by ajj, 9 years ago

Rebuild to fix index and modules docs

  • Property mode set to 100644
File size: 6.6 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4
5<html xmlns="http://www.w3.org/1999/xhtml">
6  <head>
7    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8   
9    <title>sas.models.PowerLawAbsModel &mdash; SasView 3.0.0 documentation</title>
10   
11    <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
12    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
13   
14    <script type="text/javascript">
15      var DOCUMENTATION_OPTIONS = {
16        URL_ROOT:    '../../../',
17        VERSION:     '3.0.0',
18        COLLAPSE_INDEX: false,
19        FILE_SUFFIX: '.html',
20        HAS_SOURCE:  true
21      };
22    </script>
23    <script type="text/javascript" src="../../../_static/jquery.js"></script>
24    <script type="text/javascript" src="../../../_static/underscore.js"></script>
25    <script type="text/javascript" src="../../../_static/doctools.js"></script>
26    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
27    <link rel="top" title="SasView 3.0.0 documentation" href="../../../index.html" />
28    <link rel="up" title="sas.models" href="../models.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><a href="../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
41          <li><a href="../../index.html" >Module code</a> &raquo;</li>
42          <li><a href="../models.html" accesskey="U">sas.models</a> &raquo;</li> 
43      </ul>
44    </div> 
45
46    <div class="document">
47      <div class="documentwrapper">
48        <div class="bodywrapper">
49          <div class="body">
50           
51  <h1>Source code for sas.models.PowerLawAbsModel</h1><div class="highlight"><pre>
52<span class="sd">&quot;&quot;&quot; </span>
53<span class="sd">    Provide F(x) = scale* (\|x\|)^(-m) + bkd</span>
54<span class="sd">    Power law function as a BaseComponent model</span>
55<span class="sd">&quot;&quot;&quot;</span>
56<span class="kn">from</span> <span class="nn">sas.models.PowerLawModel</span> <span class="kn">import</span> <span class="n">PowerLawModel</span>
57<span class="kn">import</span> <span class="nn">math</span>
58
59<div class="viewcode-block" id="PowerLawAbsModel"><a class="viewcode-back" href="../../../dev/api/sas.models.html#sas.models.PowerLawAbsModel.PowerLawAbsModel">[docs]</a><span class="k">class</span> <span class="nc">PowerLawAbsModel</span><span class="p">(</span><span class="n">PowerLawModel</span><span class="p">):</span>
60    <span class="sd">&quot;&quot;&quot;</span>
61<span class="sd">    Class that evaluates a absolute Power_Law model. ::</span>
62<span class="sd">    </span>
63<span class="sd">        F(x) = scale* (|x|)^(-m) + bkd</span>
64<span class="sd">    </span>
65<span class="sd">    The model has three parameters:</span>
66
67<span class="sd">    * m     =  power</span>
68<span class="sd">    * scale  =  scale factor</span>
69<span class="sd">    * bkd    =  incoherent background</span>
70<span class="sd">    &quot;&quot;&quot;</span>
71   
72    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
73        <span class="sd">&quot;&quot;&quot; Initialization &quot;&quot;&quot;</span>
74        <span class="c"># Initialize PowerLawAbsModel </span>
75        <span class="n">PowerLawModel</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
76        <span class="c">## Name of the model</span>
77        <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s">&quot;Absolute Power_Law&quot;</span>
78        <span class="bp">self</span><span class="o">.</span><span class="n">description</span> <span class="o">=</span> <span class="s">&quot;&quot;&quot; The Power_Law model.</span>
79<span class="s">        F(x) = scale* (|x|)^(-m) + bkd</span>
80<span class="s">        </span>
81<span class="s">        The model has three parameters: </span>
82<span class="s">        m     =  power</span>
83<span class="s">        scale  =  scale factor</span>
84<span class="s">        bkd    =  incoherent background&quot;&quot;&quot;</span>
85       
86       
87    <span class="k">def</span> <span class="nf">_PowerLaw</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">):</span>
88        <span class="k">return</span> <span class="n">PowerLawModel</span><span class="o">.</span><span class="n">_PowerLaw</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
89       </div>
90</pre></div>
91
92          </div>
93        </div>
94      </div>
95      <div class="sphinxsidebar">
96        <div class="sphinxsidebarwrapper">
97<div id="searchbox" style="display: none">
98  <h3>Quick search</h3>
99    <form class="search" action="../../../search.html" method="get">
100      <input type="text" name="q" />
101      <input type="submit" value="Go" />
102      <input type="hidden" name="check_keywords" value="yes" />
103      <input type="hidden" name="area" value="default" />
104    </form>
105    <p class="searchtip" style="font-size: 90%">
106    Enter search terms or a module, class or function name.
107    </p>
108</div>
109<script type="text/javascript">$('#searchbox').show(0);</script>
110        </div>
111      </div>
112      <div class="clearer"></div>
113    </div>
114    <div class="related">
115      <h3>Navigation</h3>
116      <ul>
117        <li class="right" style="margin-right: 10px">
118          <a href="../../../genindex.html" title="General Index"
119             >index</a></li>
120        <li class="right" >
121          <a href="../../../py-modindex.html" title="Python Module Index"
122             >modules</a> |</li>
123        <li><a href="../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
124          <li><a href="../../index.html" >Module code</a> &raquo;</li>
125          <li><a href="../models.html" >sas.models</a> &raquo;</li> 
126      </ul>
127    </div>
128    <div class="footer">
129        &copy; Copyright 2013, The SasView Project.
130      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
131    </div>
132  </body>
133</html>
Note: See TracBrowser for help on using the repository browser.