source: sasview/park_integration/docs/sphinx/_build/html/api/ScipyFitting.html @ aa36f96

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 aa36f96 was aa36f96, checked in by Gervaise Alina <gervyh@…>, 14 years ago

working on documentation

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