[6b1588b] | 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 | |
---|
[f696e2a] | 6 | |
---|
[6b1588b] | 7 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
| 8 | <head> |
---|
| 9 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
| 10 | |
---|
[f696e2a] | 11 | <title>ScipyFitting — park_integration 0.1.0 documentation</title> |
---|
| 12 | |
---|
[6b1588b] | 13 | <link rel="stylesheet" href="../_static/default.css" type="text/css" /> |
---|
| 14 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
---|
[f696e2a] | 15 | |
---|
[6b1588b] | 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> |
---|
[f696e2a] | 28 | <link rel="top" title="park_integration 0.1.0 documentation" href="../index.html" /> |
---|
[6b1588b] | 29 | <link rel="up" title="Reference" href="index.html" /> |
---|
| 30 | <link rel="prev" title="ParkFitting" href="ParkFitting.html" /> |
---|
| 31 | </head> |
---|
| 32 | <body> |
---|
| 33 | <div class="related"> |
---|
| 34 | <h3>Navigation</h3> |
---|
| 35 | <ul> |
---|
| 36 | <li class="right" style="margin-right: 10px"> |
---|
| 37 | <a href="../genindex.html" title="General Index" |
---|
| 38 | accesskey="I">index</a></li> |
---|
| 39 | <li class="right" > |
---|
| 40 | <a href="../py-modindex.html" title="Python Module Index" |
---|
| 41 | >modules</a> |</li> |
---|
| 42 | <li class="right" > |
---|
| 43 | <a href="ParkFitting.html" title="ParkFitting" |
---|
| 44 | accesskey="P">previous</a> |</li> |
---|
[f696e2a] | 45 | <li><a href="../index.html">park_integration 0.1.0 documentation</a> »</li> |
---|
[6b1588b] | 46 | <li><a href="index.html" accesskey="U">Reference</a> »</li> |
---|
| 47 | </ul> |
---|
| 48 | </div> |
---|
| 49 | |
---|
| 50 | <div class="document"> |
---|
| 51 | <div class="documentwrapper"> |
---|
| 52 | <div class="bodywrapper"> |
---|
| 53 | <div class="body"> |
---|
| 54 | |
---|
| 55 | <div class="section" id="scipyfitting"> |
---|
| 56 | <h1>ScipyFitting<a class="headerlink" href="#scipyfitting" title="Permalink to this headline">¶</a></h1> |
---|
[f696e2a] | 57 | <div class="section" id="mod-sans-fit-scipyfitting"> |
---|
| 58 | <h2>:mod:` sans.fit.ScipyFitting`<a class="headerlink" href="#mod-sans-fit-scipyfitting" title="Permalink to this headline">¶</a></h2> |
---|
| 59 | <span class="target" id="module-sans.fit.ScipyFitting"></span><p>ScipyFitting module contains FitArrange , ScipyFit, |
---|
[6b1588b] | 60 | Parameter classes.All listed classes work together to perform a |
---|
| 61 | simple fit with scipy optimizer.</p> |
---|
| 62 | <dl class="class"> |
---|
| 63 | <dt id="sans.fit.ScipyFitting.ScipyFit"> |
---|
| 64 | <em class="property">class </em><tt class="descclassname">sans.fit.ScipyFitting.</tt><tt class="descname">ScipyFit</tt><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit" title="Permalink to this definition">¶</a></dt> |
---|
| 65 | <dd><p>Bases: <a class="reference internal" href="AbstractFitEngine.html#sans.fit.AbstractFitEngine.FitEngine" title="sans.fit.AbstractFitEngine.FitEngine"><tt class="xref py py-class docutils literal"><span class="pre">sans.fit.AbstractFitEngine.FitEngine</span></tt></a></p> |
---|
| 66 | <p>ScipyFit performs the Fit.This class can be used as follow: |
---|
| 67 | #Do the fit SCIPY |
---|
| 68 | create an engine: engine = ScipyFit() |
---|
| 69 | Use data must be of type plottable |
---|
| 70 | Use a sans model</p> |
---|
| 71 | <p>Add data with a dictionnary of FitArrangeDict where Uid is a key and data |
---|
| 72 | is saved in FitArrange object. |
---|
| 73 | engine.set_data(data,Uid)</p> |
---|
| 74 | <p>Set model parameter “M1”= model.name add {model.parameter.name:value}.</p> |
---|
| 75 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 76 | <col class="field-name" /> |
---|
| 77 | <col class="field-body" /> |
---|
| 78 | <tbody valign="top"> |
---|
[f696e2a] | 79 | <tr class="field-odd field"><th class="field-name">Note :</th><td class="field-body">Set_param() if used must always preceded set_model() |
---|
[6b1588b] | 80 | for the fit to be performed.In case of Scipyfit set_param is called in |
---|
| 81 | fit () automatically.</td> |
---|
| 82 | </tr> |
---|
| 83 | </tbody> |
---|
| 84 | </table> |
---|
| 85 | <p>engine.set_param( model,”M1”, {‘A’:2,’B’:4})</p> |
---|
| 86 | <p>Add model with a dictionnary of FitArrangeDict{} where Uid is a key and model |
---|
| 87 | is save in FitArrange object. |
---|
| 88 | engine.set_model(model,Uid)</p> |
---|
| 89 | <p>engine.fit return chisqr,[model.parameter 1,2,..],[[err1....][..err2...]] |
---|
| 90 | chisqr1, out1, cov1=engine.fit({model.parameter.name:value},qmin,qmax)</p> |
---|
| 91 | <dl class="method"> |
---|
[f696e2a] | 92 | <dt id="sans.fit.ScipyFitting.ScipyFit.__init__"> |
---|
| 93 | <tt class="descname">__init__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.__init__" title="Permalink to this definition">¶</a></dt> |
---|
| 94 | <dd><p>Creates a dictionary (self.fit_arrange_dict={})of FitArrange elements |
---|
| 95 | with Uid as keys</p> |
---|
| 96 | </dd></dl> |
---|
| 97 | |
---|
| 98 | <dl class="attribute"> |
---|
| 99 | <dt id="sans.fit.ScipyFitting.ScipyFit.__module__"> |
---|
| 100 | <tt class="descname">__module__</tt><em class="property"> = 'sans.fit.ScipyFitting'</em><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.__module__" title="Permalink to this definition">¶</a></dt> |
---|
| 101 | <dd></dd></dl> |
---|
| 102 | |
---|
| 103 | <dl class="method"> |
---|
| 104 | <dt id="sans.fit.ScipyFitting.ScipyFit._check_param_range"> |
---|
| 105 | <tt class="descname">_check_param_range</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit._check_param_range" title="Permalink to this definition">¶</a></dt> |
---|
| 106 | <dd><p>Check parameter range and set the initial value inside |
---|
| 107 | if it is out of range.</p> |
---|
| 108 | <p>: model: park model object</p> |
---|
| 109 | </dd></dl> |
---|
| 110 | |
---|
| 111 | <dl class="method"> |
---|
| 112 | <dt id="sans.fit.ScipyFitting.ScipyFit._get_zero_shift"> |
---|
| 113 | <tt class="descname">_get_zero_shift</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit._get_zero_shift" title="Permalink to this definition">¶</a></dt> |
---|
| 114 | <dd><p>Get 10% shift of the param value = 0 based on the range value</p> |
---|
| 115 | <p>: param range: min or max value of the bounds</p> |
---|
| 116 | </dd></dl> |
---|
| 117 | |
---|
| 118 | <dl class="method"> |
---|
[6b1588b] | 119 | <dt id="sans.fit.ScipyFitting.ScipyFit.fit"> |
---|
[f696e2a] | 120 | <tt class="descname">fit</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.fit" title="Permalink to this definition">¶</a></dt> |
---|
[6b1588b] | 121 | <dd></dd></dl> |
---|
| 122 | |
---|
| 123 | <dl class="method"> |
---|
| 124 | <dt id="sans.fit.ScipyFitting.ScipyFit.get_model"> |
---|
[f696e2a] | 125 | <tt class="descname">get_model</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.get_model" title="Permalink to this definition">¶</a></dt> |
---|
[6b1588b] | 126 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
| 127 | <col class="field-name" /> |
---|
| 128 | <col class="field-body" /> |
---|
| 129 | <tbody valign="top"> |
---|
[f696e2a] | 130 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>id</strong> – id is key in the dictionary containing the model to return</td> |
---|
[6b1588b] | 131 | </tr> |
---|
[f696e2a] | 132 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a model at this id or None if no FitArrange element was |
---|
[6b1588b] | 133 | created with this id</td> |
---|
| 134 | </tr> |
---|
| 135 | </tbody> |
---|
| 136 | </table> |
---|
| 137 | </dd></dl> |
---|
| 138 | |
---|
| 139 | <dl class="method"> |
---|
| 140 | <dt id="sans.fit.ScipyFitting.ScipyFit.get_problem_to_fit"> |
---|
[f696e2a] | 141 | <tt class="descname">get_problem_to_fit</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.get_problem_to_fit" title="Permalink to this definition">¶</a></dt> |
---|
[6b1588b] | 142 | <dd><p>return the self.selected value of the fit problem of id</p> |
---|
| 143 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 144 | <col class="field-name" /> |
---|
| 145 | <col class="field-body" /> |
---|
| 146 | <tbody valign="top"> |
---|
[f696e2a] | 147 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>id</strong> – the id of the problem</td> |
---|
[6b1588b] | 148 | </tr> |
---|
| 149 | </tbody> |
---|
| 150 | </table> |
---|
| 151 | </dd></dl> |
---|
| 152 | |
---|
| 153 | <dl class="method"> |
---|
| 154 | <dt id="sans.fit.ScipyFitting.ScipyFit.remove_fit_problem"> |
---|
[f696e2a] | 155 | <tt class="descname">remove_fit_problem</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.remove_fit_problem" title="Permalink to this definition">¶</a></dt> |
---|
[6b1588b] | 156 | <dd><p>remove fitarrange in id</p> |
---|
| 157 | </dd></dl> |
---|
| 158 | |
---|
| 159 | <dl class="method"> |
---|
| 160 | <dt id="sans.fit.ScipyFitting.ScipyFit.select_problem_for_fit"> |
---|
[f696e2a] | 161 | <tt class="descname">select_problem_for_fit</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.select_problem_for_fit" title="Permalink to this definition">¶</a></dt> |
---|
[6b1588b] | 162 | <dd><p>select a couple of model and data at the id position in dictionary |
---|
| 163 | and set in self.selected value to value</p> |
---|
| 164 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 165 | <col class="field-name" /> |
---|
| 166 | <col class="field-body" /> |
---|
| 167 | <tbody valign="top"> |
---|
[f696e2a] | 168 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> – the value to allow fitting. |
---|
[6b1588b] | 169 | can only have the value one or zero</td> |
---|
| 170 | </tr> |
---|
| 171 | </tbody> |
---|
| 172 | </table> |
---|
| 173 | </dd></dl> |
---|
| 174 | |
---|
| 175 | <dl class="method"> |
---|
| 176 | <dt id="sans.fit.ScipyFitting.ScipyFit.set_data"> |
---|
[f696e2a] | 177 | <tt class="descname">set_data</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.set_data" title="Permalink to this definition">¶</a></dt> |
---|
[6b1588b] | 178 | <dd><p>Receives plottable, creates a list of data to fit,set data |
---|
| 179 | in a FitArrange object and adds that object in a dictionary |
---|
| 180 | with key id.</p> |
---|
| 181 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 182 | <col class="field-name" /> |
---|
| 183 | <col class="field-body" /> |
---|
| 184 | <tbody valign="top"> |
---|
[f696e2a] | 185 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
[6b1588b] | 186 | <li><strong>data</strong> – data added</li> |
---|
| 187 | <li><strong>id</strong> – unique key corresponding to a fitArrange object with data</li> |
---|
| 188 | </ul> |
---|
| 189 | </td> |
---|
| 190 | </tr> |
---|
| 191 | </tbody> |
---|
| 192 | </table> |
---|
| 193 | </dd></dl> |
---|
| 194 | |
---|
| 195 | <dl class="method"> |
---|
| 196 | <dt id="sans.fit.ScipyFitting.ScipyFit.set_model"> |
---|
[f696e2a] | 197 | <tt class="descname">set_model</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.set_model" title="Permalink to this definition">¶</a></dt> |
---|
[6b1588b] | 198 | <dd><p>set a model on a given in the fit engine.</p> |
---|
| 199 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 200 | <col class="field-name" /> |
---|
| 201 | <col class="field-body" /> |
---|
| 202 | <tbody valign="top"> |
---|
[f696e2a] | 203 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>model</strong> – sans.models type</td> |
---|
[6b1588b] | 204 | </tr> |
---|
| 205 | </tbody> |
---|
| 206 | </table> |
---|
| 207 | <dl class="docutils"> |
---|
| 208 | <dt>:param <span class="classifier-delimiter">:</span> <span class="classifier">is the key of the fitArrange dictionary where model is </span></dt> |
---|
| 209 | <dd>saved as a value</dd> |
---|
| 210 | </dl> |
---|
| 211 | <table class="docutils field-list" frame="void" rules="none"> |
---|
| 212 | <col class="field-name" /> |
---|
| 213 | <col class="field-body" /> |
---|
| 214 | <tbody valign="top"> |
---|
[f696e2a] | 215 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
[6b1588b] | 216 | <li><strong>pars</strong> – the list of parameters to fit</li> |
---|
| 217 | <li><strong>constraints</strong> – <p>list of |
---|
| 218 | tuple (name of parameter, value of parameters) |
---|
| 219 | the value of parameter must be a string to constraint 2 different |
---|
| 220 | parameters. |
---|
| 221 | Example: |
---|
| 222 | we want to fit 2 model M1 and M2 both have parameters A and B. |
---|
| 223 | constraints can be:</p> |
---|
| 224 | <blockquote> |
---|
| 225 | <div>constraints = [(M1.A, M2.B+2), (M1.B= M2.A <a href="#id1"><span class="problematic" id="id2">*</span></a>5),...,]</div></blockquote> |
---|
| 226 | </li> |
---|
| 227 | </ul> |
---|
| 228 | </td> |
---|
| 229 | </tr> |
---|
[f696e2a] | 230 | <tr class="field-even field"><th class="field-name">Note :</th><td class="field-body"><p class="first last">pars must contains only name of existing model’s parameters</p> |
---|
[6b1588b] | 231 | </td> |
---|
| 232 | </tr> |
---|
| 233 | </tbody> |
---|
| 234 | </table> |
---|
| 235 | </dd></dl> |
---|
| 236 | |
---|
| 237 | </dd></dl> |
---|
| 238 | |
---|
| 239 | </div> |
---|
| 240 | </div> |
---|
| 241 | |
---|
| 242 | |
---|
| 243 | </div> |
---|
| 244 | </div> |
---|
| 245 | </div> |
---|
| 246 | <div class="sphinxsidebar"> |
---|
| 247 | <div class="sphinxsidebarwrapper"> |
---|
| 248 | <h3><a href="../index.html">Table Of Contents</a></h3> |
---|
| 249 | <ul> |
---|
| 250 | <li><a class="reference internal" href="#">ScipyFitting</a><ul> |
---|
[f696e2a] | 251 | <li><a class="reference internal" href="#mod-sans-fit-scipyfitting">:mod:` sans.fit.ScipyFitting`</a></li> |
---|
[6b1588b] | 252 | </ul> |
---|
| 253 | </li> |
---|
| 254 | </ul> |
---|
| 255 | |
---|
| 256 | <h4>Previous topic</h4> |
---|
| 257 | <p class="topless"><a href="ParkFitting.html" |
---|
| 258 | title="previous chapter">ParkFitting</a></p> |
---|
| 259 | <h3>This Page</h3> |
---|
| 260 | <ul class="this-page-menu"> |
---|
| 261 | <li><a href="../_sources/api/ScipyFitting.txt" |
---|
| 262 | rel="nofollow">Show Source</a></li> |
---|
| 263 | </ul> |
---|
| 264 | <div id="searchbox" style="display: none"> |
---|
| 265 | <h3>Quick search</h3> |
---|
| 266 | <form class="search" action="../search.html" method="get"> |
---|
[f696e2a] | 267 | <input type="text" name="q" /> |
---|
[6b1588b] | 268 | <input type="submit" value="Go" /> |
---|
| 269 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
| 270 | <input type="hidden" name="area" value="default" /> |
---|
| 271 | </form> |
---|
| 272 | <p class="searchtip" style="font-size: 90%"> |
---|
| 273 | Enter search terms or a module, class or function name. |
---|
| 274 | </p> |
---|
| 275 | </div> |
---|
| 276 | <script type="text/javascript">$('#searchbox').show(0);</script> |
---|
| 277 | </div> |
---|
| 278 | </div> |
---|
| 279 | <div class="clearer"></div> |
---|
| 280 | </div> |
---|
| 281 | <div class="related"> |
---|
| 282 | <h3>Navigation</h3> |
---|
| 283 | <ul> |
---|
| 284 | <li class="right" style="margin-right: 10px"> |
---|
| 285 | <a href="../genindex.html" title="General Index" |
---|
| 286 | >index</a></li> |
---|
| 287 | <li class="right" > |
---|
| 288 | <a href="../py-modindex.html" title="Python Module Index" |
---|
| 289 | >modules</a> |</li> |
---|
| 290 | <li class="right" > |
---|
| 291 | <a href="ParkFitting.html" title="ParkFitting" |
---|
| 292 | >previous</a> |</li> |
---|
[f696e2a] | 293 | <li><a href="../index.html">park_integration 0.1.0 documentation</a> »</li> |
---|
[6b1588b] | 294 | <li><a href="index.html" >Reference</a> »</li> |
---|
| 295 | </ul> |
---|
| 296 | </div> |
---|
| 297 | <div class="footer"> |
---|
| 298 | © Copyright 2010, sans group. |
---|
[f696e2a] | 299 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1. |
---|
[6b1588b] | 300 | </div> |
---|
| 301 | </body> |
---|
| 302 | </html> |
---|