source: sasview/park_integration/docs/sphinx/_build/html/api/ParkFitting.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: 14.3 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>ParkFitting &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="next" title="ScipyFitting" href="ScipyFitting.html" />
28    <link rel="prev" title="Fitting" href="Fitting.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 class="right" >
41          <a href="ScipyFitting.html" title="ScipyFitting"
42             accesskey="N">next</a> |</li>
43        <li class="right" >
44          <a href="Fitting.html" title="Fitting"
45             accesskey="P">previous</a> |</li>
46        <li><a href="../index.html">park_integration v0.1.0 documentation</a> &raquo;</li>
47          <li><a href="index.html" accesskey="U">Reference</a> &raquo;</li> 
48      </ul>
49    </div> 
50
51    <div class="document">
52      <div class="documentwrapper">
53        <div class="bodywrapper">
54          <div class="body">
55           
56  <div class="section" id="parkfitting">
57<h1>ParkFitting<a class="headerlink" href="#parkfitting" title="Permalink to this headline">¶</a></h1>
58<div class="section" id="module-sans.fit.ParkFitting">
59<span id="mod-sans-fit-parkfitting"></span><h2>:mod:` sans.fit.ParkFitting`<a class="headerlink" href="#module-sans.fit.ParkFitting" title="Permalink to this headline">¶</a></h2>
60<p>ParkFitting module contains SansParameter,Model,Data
61FitArrange, ParkFit,Parameter classes.All listed classes work together to perform a
62simple fit with park optimizer.</p>
63<dl class="class">
64<dt id="sans.fit.ParkFitting.ParkFit">
65<em class="property">class </em><tt class="descclassname">sans.fit.ParkFitting.</tt><tt class="descname">ParkFit</tt><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit" title="Permalink to this definition">¶</a></dt>
66<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>
67<p>ParkFit performs the Fit.This class can be used as follow:
68#Do the fit Park
69create an engine: engine = ParkFit()
70Use data must be of type plottable
71Use a sans model</p>
72<p>Add data with a dictionnary of FitArrangeList where Uid is a key and data
73is saved in FitArrange object.
74engine.set_data(data,Uid)</p>
75<p>Set model parameter &#8220;M1&#8221;= model.name add {model.parameter.name:value}.</p>
76<table class="docutils field-list" frame="void" rules="none">
77<col class="field-name" />
78<col class="field-body" />
79<tbody valign="top">
80<tr class="field"><th class="field-name">Note :</th><td class="field-body">Set_param() if used must always preceded set_model()
81for the fit to be performed.</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 FitArrangeList{} 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<table class="docutils field-list" frame="void" rules="none">
92<col class="field-name" />
93<col class="field-body" />
94<tbody valign="top">
95<tr class="field"><th class="field-name">Note :</th><td class="field-body">{model.parameter.name:value} is ignored in fit function since
96the user should make sure to call set_param himself.</td>
97</tr>
98</tbody>
99</table>
100<dl class="method">
101<dt id="sans.fit.ParkFitting.ParkFit.createAssembly">
102<tt class="descname">createAssembly</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit.createAssembly" title="Permalink to this definition">¶</a></dt>
103<dd>Extract sansmodel and sansdata from self.FitArrangelist ={Uid:FitArrange}
104Create parkmodel and park data ,form a list couple of parkmodel and parkdata
105create an assembly self.problem=  park.Assembly([(parkmodel,parkdata)])</dd></dl>
106
107<dl class="method">
108<dt id="sans.fit.ParkFitting.ParkFit.fit">
109<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.ParkFitting.ParkFit.fit" title="Permalink to this definition">¶</a></dt>
110<dd><p>Performs fit with park.fit module.It can  perform fit with one model
111and a set of data, more than two fit of  one model and sets of data or
112fit with more than two model associated with their set of data and constraints</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"><ul class="first simple">
118<li><strong>pars</strong> &#8211; Dictionary of parameter names for the model and their values.</li>
119<li><strong>qmin</strong> &#8211; The minimum value of data&#8217;s range to be fit</li>
120<li><strong>qmax</strong> &#8211; The maximum value of data&#8217;s range to be fit</li>
121</ul>
122</td>
123</tr>
124<tr class="field"><th class="field-name">Note :</th><td class="field-body"><p class="first">all parameter are ignored most of the time.Are just there to keep ScipyFit
125and ParkFit interface the same.</p>
126</td>
127</tr>
128<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">result.fitness Value of the goodness of fit metric</p>
129</td>
130</tr>
131<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">result.pvec list of parameter with the best value found during fitting</p>
132</td>
133</tr>
134<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">result.cov Covariance matrix</p>
135</td>
136</tr>
137</tbody>
138</table>
139</dd></dl>
140
141<dl class="method">
142<dt id="sans.fit.ParkFitting.ParkFit.get_model">
143<tt class="descname">get_model</tt><big>(</big><em>Uid</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit.get_model" title="Permalink to this definition">¶</a></dt>
144<dd><table class="docutils field-list" frame="void" rules="none">
145<col class="field-name" />
146<col class="field-body" />
147<tbody valign="top">
148<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
149<li><strong>Uid</strong> &#8211; Uid is key in the dictionary containing the model to return</li>
150</ul>
151</td>
152</tr>
153<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
154with this Uid</p>
155</td>
156</tr>
157</tbody>
158</table>
159</dd></dl>
160
161<dl class="method">
162<dt id="sans.fit.ParkFitting.ParkFit.get_problem_to_fit">
163<tt class="descname">get_problem_to_fit</tt><big>(</big><em>Uid</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit.get_problem_to_fit" title="Permalink to this definition">¶</a></dt>
164<dd><p>return the self.selected value of the fit problem of Uid</p>
165<table class="docutils field-list" frame="void" rules="none">
166<col class="field-name" />
167<col class="field-body" />
168<tbody valign="top">
169<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
170<li><strong>Uid</strong> &#8211; the Uid of the problem</li>
171</ul>
172</td>
173</tr>
174</tbody>
175</table>
176</dd></dl>
177
178<dl class="method">
179<dt id="sans.fit.ParkFitting.ParkFit.remove_Fit_Problem">
180<tt class="descname">remove_Fit_Problem</tt><big>(</big><em>Uid</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit.remove_Fit_Problem" title="Permalink to this definition">¶</a></dt>
181<dd>remove   fitarrange in Uid</dd></dl>
182
183<dl class="method">
184<dt id="sans.fit.ParkFitting.ParkFit.select_problem_for_fit">
185<tt class="descname">select_problem_for_fit</tt><big>(</big><em>Uid</em>, <em>value</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit.select_problem_for_fit" title="Permalink to this definition">¶</a></dt>
186<dd><p>select a couple of model and data at the Uid position in dictionary
187and set in self.selected value to value</p>
188<table class="docutils field-list" frame="void" rules="none">
189<col class="field-name" />
190<col class="field-body" />
191<tbody valign="top">
192<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
193<li><strong>value</strong> &#8211; the value to allow fitting.
194can only have the value one or zero</li>
195</ul>
196</td>
197</tr>
198</tbody>
199</table>
200</dd></dl>
201
202<dl class="method">
203<dt id="sans.fit.ParkFitting.ParkFit.set_data">
204<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.ParkFitting.ParkFit.set_data" title="Permalink to this definition">¶</a></dt>
205<dd><p>Receives plottable, creates a list of data to fit,set data
206in a FitArrange object and adds that object in a dictionary
207with key Uid.</p>
208<table class="docutils field-list" frame="void" rules="none">
209<col class="field-name" />
210<col class="field-body" />
211<tbody valign="top">
212<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
213<li><strong>data</strong> &#8211; data added</li>
214<li><strong>Uid</strong> &#8211; unique key corresponding to a fitArrange object with data</li>
215</ul>
216</td>
217</tr>
218</tbody>
219</table>
220</dd></dl>
221
222<dl class="method">
223<dt id="sans.fit.ParkFitting.ParkFit.set_model">
224<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.ParkFitting.ParkFit.set_model" title="Permalink to this definition">¶</a></dt>
225<dd><p>set a model on a given uid in the fit engine.</p>
226<table class="docutils field-list" frame="void" rules="none">
227<col class="field-name" />
228<col class="field-body" />
229<tbody valign="top">
230<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
231<li><strong>model</strong> &#8211; sans.models type</li>
232<li><strong>Uid</strong> &#8211; is the key of the fitArrange dictionary where model is
233saved as a value</li>
234<li><strong>pars</strong> &#8211; the list of parameters to fit</li>
235<li><strong>constraints</strong> &#8211; <p>list of
236tuple (name of parameter, value of parameters)
237the value of parameter must be a string to constraint 2 different
238parameters.
239Example: 
240we want to fit 2 model M1 and M2 both have parameters A and B.
241constraints can be:</p>
242<blockquote>
243constraints = [(M1.A, M2.B+2), (M1.B= M2.A <a href="#id1"><span class="problematic" id="id2">*</span></a>5),...,]</blockquote>
244</li>
245</ul>
246</td>
247</tr>
248<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>
249</td>
250</tr>
251</tbody>
252</table>
253</dd></dl>
254
255</dd></dl>
256
257</div>
258</div>
259
260
261          </div>
262        </div>
263      </div>
264      <div class="sphinxsidebar">
265        <div class="sphinxsidebarwrapper">
266  <h3><a href="../index.html">Table Of Contents</a></h3>
267  <ul>
268<li><a class="reference internal" href="#">ParkFitting</a><ul>
269<li><a class="reference internal" href="#module-sans.fit.ParkFitting">:mod:` sans.fit.ParkFitting`</a></li>
270</ul>
271</li>
272</ul>
273
274  <h4>Previous topic</h4>
275  <p class="topless"><a href="Fitting.html"
276                        title="previous chapter">Fitting</a></p>
277  <h4>Next topic</h4>
278  <p class="topless"><a href="ScipyFitting.html"
279                        title="next chapter">ScipyFitting</a></p>
280  <h3>This Page</h3>
281  <ul class="this-page-menu">
282    <li><a href="../_sources/api/ParkFitting.txt"
283           rel="nofollow">Show Source</a></li>
284  </ul>
285<div id="searchbox" style="display: none">
286  <h3>Quick search</h3>
287    <form class="search" action="../search.html" method="get">
288      <input type="text" name="q" size="18" />
289      <input type="submit" value="Go" />
290      <input type="hidden" name="check_keywords" value="yes" />
291      <input type="hidden" name="area" value="default" />
292    </form>
293    <p class="searchtip" style="font-size: 90%">
294    Enter search terms or a module, class or function name.
295    </p>
296</div>
297<script type="text/javascript">$('#searchbox').show(0);</script>
298        </div>
299      </div>
300      <div class="clearer"></div>
301    </div>
302    <div class="related">
303      <h3>Navigation</h3>
304      <ul>
305        <li class="right" style="margin-right: 10px">
306          <a href="../genindex.html" title="General Index"
307             >index</a></li>
308        <li class="right" >
309          <a href="../py-modindex.html" title="Python Module Index"
310             >modules</a> |</li>
311        <li class="right" >
312          <a href="ScipyFitting.html" title="ScipyFitting"
313             >next</a> |</li>
314        <li class="right" >
315          <a href="Fitting.html" title="Fitting"
316             >previous</a> |</li>
317        <li><a href="../index.html">park_integration v0.1.0 documentation</a> &raquo;</li>
318          <li><a href="index.html" >Reference</a> &raquo;</li> 
319      </ul>
320    </div>
321    <div class="footer">
322        &copy; Copyright 2010, sans group.
323      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0b1.
324    </div>
325  </body>
326</html>
Note: See TracBrowser for help on using the repository browser.