source: sasview/park_integration/docs/sphinx/html/api/ScipyFitting.html @ 846c724

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 846c724 was 6b1588b, checked in by Jessica Tumarkin <jtumarki@…>, 13 years ago

HTML folder generated by Sphinx

  • Property mode set to 100644
File size: 13.2 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>, <em>ftol=1.49012e-008</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>id</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"><strong>id</strong> &#8211; id is key in the dictionary containing the model to return</td>
101</tr>
102<tr class="field"><th class="field-name">Returns:</th><td class="field-body">a model at this id or None if no FitArrange element was
103created with this id</td>
104</tr>
105</tbody>
106</table>
107</dd></dl>
108
109<dl class="method">
110<dt id="sans.fit.ScipyFitting.ScipyFit.get_problem_to_fit">
111<tt class="descname">get_problem_to_fit</tt><big>(</big><em>id</em><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.get_problem_to_fit" title="Permalink to this definition">¶</a></dt>
112<dd><p>return the self.selected value of the fit problem of id</p>
113<table class="docutils field-list" frame="void" rules="none">
114<col class="field-name" />
115<col class="field-body" />
116<tbody valign="top">
117<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>id</strong> &#8211; the id of the problem</td>
118</tr>
119</tbody>
120</table>
121</dd></dl>
122
123<dl class="method">
124<dt id="sans.fit.ScipyFitting.ScipyFit.remove_fit_problem">
125<tt class="descname">remove_fit_problem</tt><big>(</big><em>id</em><big>)</big><a class="headerlink" href="#sans.fit.ScipyFitting.ScipyFit.remove_fit_problem" title="Permalink to this definition">¶</a></dt>
126<dd><p>remove   fitarrange in id</p>
127</dd></dl>
128
129<dl class="method">
130<dt id="sans.fit.ScipyFitting.ScipyFit.select_problem_for_fit">
131<tt class="descname">select_problem_for_fit</tt><big>(</big><em>id</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>
132<dd><p>select a couple of model and data at the id position in dictionary
133and set in self.selected value to value</p>
134<table class="docutils field-list" frame="void" rules="none">
135<col class="field-name" />
136<col class="field-body" />
137<tbody valign="top">
138<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> &#8211; the value to allow fitting.
139can only have the value one or zero</td>
140</tr>
141</tbody>
142</table>
143</dd></dl>
144
145<dl class="method">
146<dt id="sans.fit.ScipyFitting.ScipyFit.set_data">
147<tt class="descname">set_data</tt><big>(</big><em>data</em>, <em>id</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>
148<dd><p>Receives plottable, creates a list of data to fit,set data
149in a FitArrange object and adds that object in a dictionary
150with key id.</p>
151<table class="docutils field-list" frame="void" rules="none">
152<col class="field-name" />
153<col class="field-body" />
154<tbody valign="top">
155<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
156<li><strong>data</strong> &#8211; data added</li>
157<li><strong>id</strong> &#8211; unique key corresponding to a fitArrange object with data</li>
158</ul>
159</td>
160</tr>
161</tbody>
162</table>
163</dd></dl>
164
165<dl class="method">
166<dt id="sans.fit.ScipyFitting.ScipyFit.set_model">
167<tt class="descname">set_model</tt><big>(</big><em>model</em>, <em>id</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>
168<dd><p>set a model on a given  in the fit engine.</p>
169<table class="docutils field-list" frame="void" rules="none">
170<col class="field-name" />
171<col class="field-body" />
172<tbody valign="top">
173<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>model</strong> &#8211; sans.models type</td>
174</tr>
175</tbody>
176</table>
177<dl class="docutils">
178<dt>:param <span class="classifier-delimiter">:</span> <span class="classifier">is the key of the fitArrange dictionary where model is </span></dt>
179<dd>saved as a value</dd>
180</dl>
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"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
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>
195<div>constraints = [(M1.A, M2.B+2), (M1.B= M2.A <a href="#id1"><span class="problematic" id="id2">*</span></a>5),...,]</div></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>param_list=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</div>
232</div>
233
234
235          </div>
236        </div>
237      </div>
238      <div class="sphinxsidebar">
239        <div class="sphinxsidebarwrapper">
240  <h3><a href="../index.html">Table Of Contents</a></h3>
241  <ul>
242<li><a class="reference internal" href="#">ScipyFitting</a><ul>
243<li><a class="reference internal" href="#module-sans.fit.ScipyFitting">:mod:` sans.fit.ScipyFitting`</a></li>
244</ul>
245</li>
246</ul>
247
248  <h4>Previous topic</h4>
249  <p class="topless"><a href="ParkFitting.html"
250                        title="previous chapter">ParkFitting</a></p>
251  <h3>This Page</h3>
252  <ul class="this-page-menu">
253    <li><a href="../_sources/api/ScipyFitting.txt"
254           rel="nofollow">Show Source</a></li>
255  </ul>
256<div id="searchbox" style="display: none">
257  <h3>Quick search</h3>
258    <form class="search" action="../search.html" method="get">
259      <input type="text" name="q" size="18" />
260      <input type="submit" value="Go" />
261      <input type="hidden" name="check_keywords" value="yes" />
262      <input type="hidden" name="area" value="default" />
263    </form>
264    <p class="searchtip" style="font-size: 90%">
265    Enter search terms or a module, class or function name.
266    </p>
267</div>
268<script type="text/javascript">$('#searchbox').show(0);</script>
269        </div>
270      </div>
271      <div class="clearer"></div>
272    </div>
273    <div class="related">
274      <h3>Navigation</h3>
275      <ul>
276        <li class="right" style="margin-right: 10px">
277          <a href="../genindex.html" title="General Index"
278             >index</a></li>
279        <li class="right" >
280          <a href="../py-modindex.html" title="Python Module Index"
281             >modules</a> |</li>
282        <li class="right" >
283          <a href="ParkFitting.html" title="ParkFitting"
284             >previous</a> |</li>
285        <li><a href="../index.html">park_integration v0.1.0 documentation</a> &raquo;</li>
286          <li><a href="index.html" >Reference</a> &raquo;</li> 
287      </ul>
288    </div>
289    <div class="footer">
290        &copy; Copyright 2010, sans group.
291      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
292    </div>
293  </body>
294</html>
Note: See TracBrowser for help on using the repository browser.