source: sasview/park_integration/docs/sphinx/html/api/ScipyFitting.html @ 9a945a2

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 9a945a2 was f696e2a, checked in by Gervaise Alina <gervyh@…>, 13 years ago

edit doc

  • Property mode set to 100644
File size: 13.0 KB
Line 
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
7<html xmlns="http://www.w3.org/1999/xhtml">
8  <head>
9    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10   
11    <title>ScipyFitting &mdash; park_integration 0.1.0 documentation</title>
12   
13    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
14    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
15   
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>
28    <link rel="top" title="park_integration 0.1.0 documentation" href="../index.html" />
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>
45        <li><a href="../index.html">park_integration 0.1.0 documentation</a> &raquo;</li>
46          <li><a href="index.html" accesskey="U">Reference</a> &raquo;</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>
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,
60Parameter classes.All listed classes work together to perform a
61simple 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
68create an engine: engine = ScipyFit()
69Use data must be of type plottable
70Use a sans model</p>
71<p>Add data with a dictionnary of FitArrangeDict where Uid is a key and data
72is saved in FitArrange object.
73engine.set_data(data,Uid)</p>
74<p>Set model parameter &#8220;M1&#8221;= 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">
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()
80for the fit to be performed.In case of Scipyfit set_param is called in
81fit () automatically.</td>
82</tr>
83</tbody>
84</table>
85<p>engine.set_param( model,&#8221;M1&#8221;, {&#8216;A&#8217;:2,&#8217;B&#8217;:4})</p>
86<p>Add model with a dictionnary of FitArrangeDict{} where Uid is a key and model
87is save in FitArrange object.
88engine.set_model(model,Uid)</p>
89<p>engine.fit return chisqr,[model.parameter 1,2,..],[[err1....][..err2...]]
90chisqr1, out1, cov1=engine.fit({model.parameter.name:value},qmin,qmax)</p>
91<dl class="method">
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
95with 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
107if 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">
119<dt id="sans.fit.ScipyFitting.ScipyFit.fit">
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>
121<dd></dd></dl>
122
123<dl class="method">
124<dt id="sans.fit.ScipyFitting.ScipyFit.get_model">
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>
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">
130<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>id</strong> &#8211; id is key in the dictionary containing the model to return</td>
131</tr>
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
133created 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">
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>
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">
147<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>id</strong> &#8211; the id of the problem</td>
148</tr>
149</tbody>
150</table>
151</dd></dl>
152
153<dl class="method">
154<dt id="sans.fit.ScipyFitting.ScipyFit.remove_fit_problem">
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>
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">
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>
162<dd><p>select a couple of model and data at the id position in dictionary
163and 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">
168<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> &#8211; the value to allow fitting.
169can 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">
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>
178<dd><p>Receives plottable, creates a list of data to fit,set data
179in a FitArrange object and adds that object in a dictionary
180with 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">
185<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
186<li><strong>data</strong> &#8211; data added</li>
187<li><strong>id</strong> &#8211; 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">
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>
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">
203<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>model</strong> &#8211; sans.models type</td>
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">
215<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
216<li><strong>pars</strong> &#8211; the list of parameters to fit</li>
217<li><strong>constraints</strong> &#8211; <p>list of
218tuple (name of parameter, value of parameters)
219the value of parameter must be a string to constraint 2 different
220parameters.
221Example: 
222we want to fit 2 model M1 and M2 both have parameters A and B.
223constraints 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>
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&#8217;s parameters</p>
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>
251<li><a class="reference internal" href="#mod-sans-fit-scipyfitting">:mod:` sans.fit.ScipyFitting`</a></li>
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">
267      <input type="text" name="q" />
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>
293        <li><a href="../index.html">park_integration 0.1.0 documentation</a> &raquo;</li>
294          <li><a href="index.html" >Reference</a> &raquo;</li> 
295      </ul>
296    </div>
297    <div class="footer">
298        &copy; Copyright 2010, sans group.
299      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.
300    </div>
301  </body>
302</html>
Note: See TracBrowser for help on using the repository browser.