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 — 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> »</li> |
---|
47 | <li><a href="index.html" accesskey="U">Reference</a> »</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 |
---|
61 | FitArrange, ParkFit,Parameter classes.All listed classes work together |
---|
62 | to perform a simple fit with park optimizer.</p> |
---|
63 | <dl class="class"> |
---|
64 | <dt id="sans.fit.ParkFitting.MyAssembly"> |
---|
65 | <em class="property">class </em><tt class="descclassname">sans.fit.ParkFitting.</tt><tt class="descname">MyAssembly</tt><big>(</big><em>models</em>, <em>curr_thread=None</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly" title="Permalink to this definition">¶</a></dt> |
---|
66 | <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">park.assembly.Assembly</span></tt></p> |
---|
67 | <dl class="method"> |
---|
68 | <dt id="sans.fit.ParkFitting.MyAssembly.abort"> |
---|
69 | <tt class="descname">abort</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.abort" title="Permalink to this definition">¶</a></dt> |
---|
70 | <dd><p>Interrupt the current function evaluation.</p> |
---|
71 | <p>Forward this to the currently executing model if possible.</p> |
---|
72 | </dd></dl> |
---|
73 | |
---|
74 | <dl class="method"> |
---|
75 | <dt id="sans.fit.ParkFitting.MyAssembly.all_results"> |
---|
76 | <tt class="descname">all_results</tt><big>(</big><em>result</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.all_results" title="Permalink to this definition">¶</a></dt> |
---|
77 | <dd><p>Extend result from the fit with the calculated parameters.</p> |
---|
78 | </dd></dl> |
---|
79 | |
---|
80 | <dl class="method"> |
---|
81 | <dt id="sans.fit.ParkFitting.MyAssembly.append"> |
---|
82 | <tt class="descname">append</tt><big>(</big><em>fitness</em>, <em>weight=1.0</em>, <em>isfitted=True</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.append" title="Permalink to this definition">¶</a></dt> |
---|
83 | <dd><p>Add a model to the end of set.</p> |
---|
84 | <table class="docutils field-list" frame="void" rules="none"> |
---|
85 | <col class="field-name" /> |
---|
86 | <col class="field-body" /> |
---|
87 | <tbody valign="top"> |
---|
88 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fitness</strong> – the fitting model</td> |
---|
89 | </tr> |
---|
90 | </tbody> |
---|
91 | </table> |
---|
92 | <p>The fitting model can be an instance of <cite>park.assembly.Fitness</cite>, |
---|
93 | or a tuple of (<cite>park.model.Model</cite>,`park.data.Data1D`) |
---|
94 | :param weight: model weighting (usually 1.0) |
---|
95 | :param isfitted: whether model should be fit (equivalent to weight 0.)</p> |
---|
96 | </dd></dl> |
---|
97 | |
---|
98 | <dl class="method"> |
---|
99 | <dt id="sans.fit.ParkFitting.MyAssembly.cov"> |
---|
100 | <tt class="descname">cov</tt><big>(</big><em>pvec</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.cov" title="Permalink to this definition">¶</a></dt> |
---|
101 | <dd><p>Return the covariance matrix inv(J’J) at point p.</p> |
---|
102 | </dd></dl> |
---|
103 | |
---|
104 | <dl class="method"> |
---|
105 | <dt id="sans.fit.ParkFitting.MyAssembly.eval"> |
---|
106 | <tt class="descname">eval</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.eval" title="Permalink to this definition">¶</a></dt> |
---|
107 | <dd><p>Recalculate the theory functions, and from them, the |
---|
108 | residuals and chisq.</p> |
---|
109 | <table class="docutils field-list" frame="void" rules="none"> |
---|
110 | <col class="field-name" /> |
---|
111 | <col class="field-body" /> |
---|
112 | <tbody valign="top"> |
---|
113 | <tr class="field"><th class="field-name">Note :</th><td class="field-body">Call this after the parameters have been updated.</td> |
---|
114 | </tr> |
---|
115 | </tbody> |
---|
116 | </table> |
---|
117 | </dd></dl> |
---|
118 | |
---|
119 | <dl class="method"> |
---|
120 | <dt id="sans.fit.ParkFitting.MyAssembly.fit_parameters"> |
---|
121 | <tt class="descname">fit_parameters</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.fit_parameters" title="Permalink to this definition">¶</a></dt> |
---|
122 | <dd><p>Return an alphabetical list of the fitting parameters.</p> |
---|
123 | <p>This function is called once at the beginning of a fit, |
---|
124 | and serves as a convenient place to precalculate what |
---|
125 | can be precalculated such as the set of fitting parameters |
---|
126 | and the parameter expressions evaluator.</p> |
---|
127 | </dd></dl> |
---|
128 | |
---|
129 | <dl class="method"> |
---|
130 | <dt id="sans.fit.ParkFitting.MyAssembly.fresiduals"> |
---|
131 | <tt class="descname">fresiduals</tt><big>(</big><em>pvec</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.fresiduals" title="Permalink to this definition">¶</a></dt> |
---|
132 | <dd></dd></dl> |
---|
133 | |
---|
134 | <dl class="method"> |
---|
135 | <dt id="sans.fit.ParkFitting.MyAssembly.insert"> |
---|
136 | <tt class="descname">insert</tt><big>(</big><em>idx</em>, <em>fitness</em>, <em>weight=1.0</em>, <em>isfitted=True</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.insert" title="Permalink to this definition">¶</a></dt> |
---|
137 | <dd><p>Add a model to a particular position in the set.</p> |
---|
138 | </dd></dl> |
---|
139 | |
---|
140 | <dl class="method"> |
---|
141 | <dt id="sans.fit.ParkFitting.MyAssembly.isfeasible"> |
---|
142 | <tt class="descname">isfeasible</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.isfeasible" title="Permalink to this definition">¶</a></dt> |
---|
143 | <dd><p>Returns true if the parameter set is in a feasible region of the |
---|
144 | modeling space.</p> |
---|
145 | </dd></dl> |
---|
146 | |
---|
147 | <dl class="method"> |
---|
148 | <dt id="sans.fit.ParkFitting.MyAssembly.isfitted"> |
---|
149 | <tt class="descname">isfitted</tt><big>(</big><em>idx</em>, <em>value=None</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.isfitted" title="Permalink to this definition">¶</a></dt> |
---|
150 | <dd><p>Query if a particular model is fitted.</p> |
---|
151 | <p>Set isfitted to value if value is supplied.</p> |
---|
152 | <table class="docutils field-list" frame="void" rules="none"> |
---|
153 | <col class="field-name" /> |
---|
154 | <col class="field-body" /> |
---|
155 | <tbody valign="top"> |
---|
156 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
157 | <li><strong>idx</strong> (<em>integer</em>) – model number</li> |
---|
158 | <li><strong>value</strong> – </li> |
---|
159 | </ul> |
---|
160 | </td> |
---|
161 | </tr> |
---|
162 | </tbody> |
---|
163 | </table> |
---|
164 | </dd></dl> |
---|
165 | |
---|
166 | <dl class="method"> |
---|
167 | <dt id="sans.fit.ParkFitting.MyAssembly.jacobian"> |
---|
168 | <tt class="descname">jacobian</tt><big>(</big><em>pvec</em>, <em>step=1e-008</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.jacobian" title="Permalink to this definition">¶</a></dt> |
---|
169 | <dd><p>Returns the derivative wrt the fit parameters at point p.</p> |
---|
170 | <p>Numeric derivatives are calculated based on step, where step is |
---|
171 | the portion of the total range for parameter j, or the portion of |
---|
172 | point value p_j if the range on parameter j is infinite.</p> |
---|
173 | </dd></dl> |
---|
174 | |
---|
175 | <dl class="method"> |
---|
176 | <dt id="sans.fit.ParkFitting.MyAssembly.result"> |
---|
177 | <tt class="descname">result</tt><big>(</big><em>status='step'</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.result" title="Permalink to this definition">¶</a></dt> |
---|
178 | <dd><p>Details to send back to the fitting client on an improved fit.</p> |
---|
179 | <p>status is ‘start’, ‘step’ or ‘end’ depending if this is the |
---|
180 | first result to return, an improved result, or the final result.</p> |
---|
181 | <p>[Not implemented]</p> |
---|
182 | </dd></dl> |
---|
183 | |
---|
184 | <dl class="method"> |
---|
185 | <dt id="sans.fit.ParkFitting.MyAssembly.set_result"> |
---|
186 | <tt class="descname">set_result</tt><big>(</big><em>result</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.set_result" title="Permalink to this definition">¶</a></dt> |
---|
187 | <dd><p>Set the parameters resulting from the fit into the parameter set, |
---|
188 | and update the calculated expression.</p> |
---|
189 | <p>The parameter values may be retrieved by walking the assembly.parameterset |
---|
190 | tree, checking each parameter for isfitted, iscomputed, or isfixed. |
---|
191 | For example:</p> |
---|
192 | <div class="highlight-python"><div class="highlight"><pre><span class="n">assembly</span><span class="o">.</span><span class="n">set_result</span><span class="p">(</span><span class="n">result</span><span class="p">)</span> |
---|
193 | <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">assembly</span><span class="o">.</span><span class="n">parameterset</span><span class="o">.</span><span class="n">flatten</span><span class="p">():</span> |
---|
194 | <span class="k">if</span> <span class="n">p</span><span class="o">.</span><span class="n">isfitted</span><span class="p">():</span> |
---|
195 | <span class="k">print</span> <span class="s">"</span><span class="si">%s</span><span class="s"> </span><span class="si">%g</span><span class="s"> in [</span><span class="si">%g</span><span class="s">,</span><span class="si">%g</span><span class="s">]"</span><span class="o">%</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">path</span><span class="p">,</span><span class="n">p</span><span class="o">.</span><span class="n">value</span><span class="p">,</span><span class="n">p</span><span class="o">.</span><span class="n">range</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">p</span><span class="o">.</span><span class="n">range</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> |
---|
196 | <span class="k">elif</span> <span class="n">p</span><span class="o">.</span><span class="n">iscomputed</span><span class="p">():</span> |
---|
197 | <span class="k">print</span> <span class="s">"</span><span class="si">%s</span><span class="s"> computed as </span><span class="si">%g</span><span class="s">"</span><span class="o">%</span><span class="p">(</span><span class="n">p</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">p</span><span class="o">.</span><span class="n">value</span><span class="p">)</span> |
---|
198 | </pre></div> |
---|
199 | </div> |
---|
200 | <p>This does not calculate the function or the residuals for these parameters. |
---|
201 | You can call assembly.eval() to do this. The residuals will be set in |
---|
202 | assembly[i].residuals. The theory and data are model specific, and can |
---|
203 | be found in assembly[i].fitness.data.</p> |
---|
204 | </dd></dl> |
---|
205 | |
---|
206 | <dl class="method"> |
---|
207 | <dt id="sans.fit.ParkFitting.MyAssembly.stderr"> |
---|
208 | <tt class="descname">stderr</tt><big>(</big><em>pvec</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.stderr" title="Permalink to this definition">¶</a></dt> |
---|
209 | <dd><p>Return parameter uncertainty.</p> |
---|
210 | <p>This is just the sqrt diagonal of covariance matrix inv(J’J) at point p.</p> |
---|
211 | </dd></dl> |
---|
212 | |
---|
213 | <dl class="method"> |
---|
214 | <dt id="sans.fit.ParkFitting.MyAssembly.weight"> |
---|
215 | <tt class="descname">weight</tt><big>(</big><em>idx</em>, <em>value=None</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.MyAssembly.weight" title="Permalink to this definition">¶</a></dt> |
---|
216 | <dd><p>Query the weight on a particular model.</p> |
---|
217 | <p>Set weight to value if value is supplied.</p> |
---|
218 | <table class="docutils field-list" frame="void" rules="none"> |
---|
219 | <col class="field-name" /> |
---|
220 | <col class="field-body" /> |
---|
221 | <tbody valign="top"> |
---|
222 | <tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><dl class="first docutils"> |
---|
223 | <dt>idx <span class="classifier-delimiter">:</span> <span class="classifier">integer</span></dt> |
---|
224 | <dd><p class="first last">model number</p> |
---|
225 | </dd> |
---|
226 | <dt>value <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt> |
---|
227 | <dd><p class="first last">model weight</p> |
---|
228 | </dd> |
---|
229 | </dl> |
---|
230 | </td> |
---|
231 | </tr> |
---|
232 | <tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">model weight</p> |
---|
233 | </td> |
---|
234 | </tr> |
---|
235 | </tbody> |
---|
236 | </table> |
---|
237 | </dd></dl> |
---|
238 | |
---|
239 | </dd></dl> |
---|
240 | |
---|
241 | <dl class="class"> |
---|
242 | <dt id="sans.fit.ParkFitting.ParkFit"> |
---|
243 | <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> |
---|
244 | <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> |
---|
245 | <p>ParkFit performs the Fit.This class can be used as follow: |
---|
246 | #Do the fit Park |
---|
247 | create an engine: engine = ParkFit() |
---|
248 | Use data must be of type plottable |
---|
249 | Use a sans model</p> |
---|
250 | <p>Add data with a dictionnary of FitArrangeList where Uid is a key and data |
---|
251 | is saved in FitArrange object. |
---|
252 | engine.set_data(data,Uid)</p> |
---|
253 | <p>Set model parameter “M1”= model.name add {model.parameter.name:value}.</p> |
---|
254 | <table class="docutils field-list" frame="void" rules="none"> |
---|
255 | <col class="field-name" /> |
---|
256 | <col class="field-body" /> |
---|
257 | <tbody valign="top"> |
---|
258 | <tr class="field"><th class="field-name">Note :</th><td class="field-body">Set_param() if used must always preceded set_model() |
---|
259 | for the fit to be performed.</td> |
---|
260 | </tr> |
---|
261 | </tbody> |
---|
262 | </table> |
---|
263 | <p>engine.set_param( model,”M1”, {‘A’:2,’B’:4})</p> |
---|
264 | <p>Add model with a dictionnary of FitArrangeList{} where Uid is a key |
---|
265 | and model |
---|
266 | is save in FitArrange object. |
---|
267 | engine.set_model(model,Uid)</p> |
---|
268 | <p>engine.fit return chisqr,[model.parameter 1,2,..],[[err1....][..err2...]] |
---|
269 | chisqr1, out1, cov1=engine.fit({model.parameter.name:value},qmin,qmax)</p> |
---|
270 | <table class="docutils field-list" frame="void" rules="none"> |
---|
271 | <col class="field-name" /> |
---|
272 | <col class="field-body" /> |
---|
273 | <tbody valign="top"> |
---|
274 | <tr class="field"><th class="field-name">Note :</th><td class="field-body">{model.parameter.name:value} is ignored in fit function since |
---|
275 | the user should make sure to call set_param himself.</td> |
---|
276 | </tr> |
---|
277 | </tbody> |
---|
278 | </table> |
---|
279 | <dl class="method"> |
---|
280 | <dt id="sans.fit.ParkFitting.ParkFit.create_assembly"> |
---|
281 | <tt class="descname">create_assembly</tt><big>(</big><em>curr_thread</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit.create_assembly" title="Permalink to this definition">¶</a></dt> |
---|
282 | <dd><p>Extract sansmodel and sansdata from |
---|
283 | self.FitArrangelist ={Uid:FitArrange} |
---|
284 | Create parkmodel and park data ,form a list couple of parkmodel |
---|
285 | and parkdata |
---|
286 | create an assembly self.problem= park.Assembly([(parkmodel,parkdata)])</p> |
---|
287 | </dd></dl> |
---|
288 | |
---|
289 | <dl class="method"> |
---|
290 | <dt id="sans.fit.ParkFitting.ParkFit.fit"> |
---|
291 | <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.ParkFitting.ParkFit.fit" title="Permalink to this definition">¶</a></dt> |
---|
292 | <dd><p>Performs fit with park.fit module.It can perform fit with one model |
---|
293 | and a set of data, more than two fit of one model and sets of data or |
---|
294 | fit with more than two model associated with their set of data and |
---|
295 | constraints</p> |
---|
296 | <table class="docutils field-list" frame="void" rules="none"> |
---|
297 | <col class="field-name" /> |
---|
298 | <col class="field-body" /> |
---|
299 | <tbody valign="top"> |
---|
300 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
301 | <li><strong>pars</strong> – Dictionary of parameter names for the model and their |
---|
302 | values.</li> |
---|
303 | <li><strong>qmin</strong> – The minimum value of data’s range to be fit</li> |
---|
304 | <li><strong>qmax</strong> – The maximum value of data’s range to be fit</li> |
---|
305 | </ul> |
---|
306 | </td> |
---|
307 | </tr> |
---|
308 | <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 |
---|
309 | to keep ScipyFit and ParkFit interface the same.</p> |
---|
310 | </td> |
---|
311 | </tr> |
---|
312 | <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> |
---|
313 | </td> |
---|
314 | </tr> |
---|
315 | <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 |
---|
316 | found during fitting</p> |
---|
317 | </td> |
---|
318 | </tr> |
---|
319 | <tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">result.cov Covariance matrix</p> |
---|
320 | </td> |
---|
321 | </tr> |
---|
322 | </tbody> |
---|
323 | </table> |
---|
324 | </dd></dl> |
---|
325 | |
---|
326 | <dl class="method"> |
---|
327 | <dt id="sans.fit.ParkFitting.ParkFit.get_model"> |
---|
328 | <tt class="descname">get_model</tt><big>(</big><em>id</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit.get_model" title="Permalink to this definition">¶</a></dt> |
---|
329 | <dd><table class="docutils field-list" frame="void" rules="none"> |
---|
330 | <col class="field-name" /> |
---|
331 | <col class="field-body" /> |
---|
332 | <tbody valign="top"> |
---|
333 | <tr class="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> |
---|
334 | </tr> |
---|
335 | <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 |
---|
336 | created with this id</td> |
---|
337 | </tr> |
---|
338 | </tbody> |
---|
339 | </table> |
---|
340 | </dd></dl> |
---|
341 | |
---|
342 | <dl class="method"> |
---|
343 | <dt id="sans.fit.ParkFitting.ParkFit.get_problem_to_fit"> |
---|
344 | <tt class="descname">get_problem_to_fit</tt><big>(</big><em>id</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit.get_problem_to_fit" title="Permalink to this definition">¶</a></dt> |
---|
345 | <dd><p>return the self.selected value of the fit problem of id</p> |
---|
346 | <table class="docutils field-list" frame="void" rules="none"> |
---|
347 | <col class="field-name" /> |
---|
348 | <col class="field-body" /> |
---|
349 | <tbody valign="top"> |
---|
350 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>id</strong> – the id of the problem</td> |
---|
351 | </tr> |
---|
352 | </tbody> |
---|
353 | </table> |
---|
354 | </dd></dl> |
---|
355 | |
---|
356 | <dl class="method"> |
---|
357 | <dt id="sans.fit.ParkFitting.ParkFit.remove_fit_problem"> |
---|
358 | <tt class="descname">remove_fit_problem</tt><big>(</big><em>id</em><big>)</big><a class="headerlink" href="#sans.fit.ParkFitting.ParkFit.remove_fit_problem" title="Permalink to this definition">¶</a></dt> |
---|
359 | <dd><p>remove fitarrange in id</p> |
---|
360 | </dd></dl> |
---|
361 | |
---|
362 | <dl class="method"> |
---|
363 | <dt id="sans.fit.ParkFitting.ParkFit.select_problem_for_fit"> |
---|
364 | <tt class="descname">select_problem_for_fit</tt><big>(</big><em>id</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> |
---|
365 | <dd><p>select a couple of model and data at the id position in dictionary |
---|
366 | and set in self.selected value to value</p> |
---|
367 | <table class="docutils field-list" frame="void" rules="none"> |
---|
368 | <col class="field-name" /> |
---|
369 | <col class="field-body" /> |
---|
370 | <tbody valign="top"> |
---|
371 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> – the value to allow fitting. |
---|
372 | can only have the value one or zero</td> |
---|
373 | </tr> |
---|
374 | </tbody> |
---|
375 | </table> |
---|
376 | </dd></dl> |
---|
377 | |
---|
378 | <dl class="method"> |
---|
379 | <dt id="sans.fit.ParkFitting.ParkFit.set_data"> |
---|
380 | <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.ParkFitting.ParkFit.set_data" title="Permalink to this definition">¶</a></dt> |
---|
381 | <dd><p>Receives plottable, creates a list of data to fit,set data |
---|
382 | in a FitArrange object and adds that object in a dictionary |
---|
383 | with key id.</p> |
---|
384 | <table class="docutils field-list" frame="void" rules="none"> |
---|
385 | <col class="field-name" /> |
---|
386 | <col class="field-body" /> |
---|
387 | <tbody valign="top"> |
---|
388 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
389 | <li><strong>data</strong> – data added</li> |
---|
390 | <li><strong>id</strong> – unique key corresponding to a fitArrange object with data</li> |
---|
391 | </ul> |
---|
392 | </td> |
---|
393 | </tr> |
---|
394 | </tbody> |
---|
395 | </table> |
---|
396 | </dd></dl> |
---|
397 | |
---|
398 | <dl class="method"> |
---|
399 | <dt id="sans.fit.ParkFitting.ParkFit.set_model"> |
---|
400 | <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.ParkFitting.ParkFit.set_model" title="Permalink to this definition">¶</a></dt> |
---|
401 | <dd><p>set a model on a given in the fit engine.</p> |
---|
402 | <table class="docutils field-list" frame="void" rules="none"> |
---|
403 | <col class="field-name" /> |
---|
404 | <col class="field-body" /> |
---|
405 | <tbody valign="top"> |
---|
406 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>model</strong> – sans.models type</td> |
---|
407 | </tr> |
---|
408 | </tbody> |
---|
409 | </table> |
---|
410 | <dl class="docutils"> |
---|
411 | <dt>:param <span class="classifier-delimiter">:</span> <span class="classifier">is the key of the fitArrange dictionary where model is </span></dt> |
---|
412 | <dd>saved as a value</dd> |
---|
413 | </dl> |
---|
414 | <table class="docutils field-list" frame="void" rules="none"> |
---|
415 | <col class="field-name" /> |
---|
416 | <col class="field-body" /> |
---|
417 | <tbody valign="top"> |
---|
418 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
419 | <li><strong>pars</strong> – the list of parameters to fit</li> |
---|
420 | <li><strong>constraints</strong> – <p>list of |
---|
421 | tuple (name of parameter, value of parameters) |
---|
422 | the value of parameter must be a string to constraint 2 different |
---|
423 | parameters. |
---|
424 | Example: |
---|
425 | we want to fit 2 model M1 and M2 both have parameters A and B. |
---|
426 | constraints can be:</p> |
---|
427 | <blockquote> |
---|
428 | <div>constraints = [(M1.A, M2.B+2), (M1.B= M2.A <a href="#id1"><span class="problematic" id="id2">*</span></a>5),...,]</div></blockquote> |
---|
429 | </li> |
---|
430 | </ul> |
---|
431 | </td> |
---|
432 | </tr> |
---|
433 | <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’s parameters</p> |
---|
434 | </td> |
---|
435 | </tr> |
---|
436 | </tbody> |
---|
437 | </table> |
---|
438 | </dd></dl> |
---|
439 | |
---|
440 | </dd></dl> |
---|
441 | |
---|
442 | </div> |
---|
443 | </div> |
---|
444 | |
---|
445 | |
---|
446 | </div> |
---|
447 | </div> |
---|
448 | </div> |
---|
449 | <div class="sphinxsidebar"> |
---|
450 | <div class="sphinxsidebarwrapper"> |
---|
451 | <h3><a href="../index.html">Table Of Contents</a></h3> |
---|
452 | <ul> |
---|
453 | <li><a class="reference internal" href="#">ParkFitting</a><ul> |
---|
454 | <li><a class="reference internal" href="#module-sans.fit.ParkFitting">:mod:` sans.fit.ParkFitting`</a></li> |
---|
455 | </ul> |
---|
456 | </li> |
---|
457 | </ul> |
---|
458 | |
---|
459 | <h4>Previous topic</h4> |
---|
460 | <p class="topless"><a href="Fitting.html" |
---|
461 | title="previous chapter">Fitting</a></p> |
---|
462 | <h4>Next topic</h4> |
---|
463 | <p class="topless"><a href="ScipyFitting.html" |
---|
464 | title="next chapter">ScipyFitting</a></p> |
---|
465 | <h3>This Page</h3> |
---|
466 | <ul class="this-page-menu"> |
---|
467 | <li><a href="../_sources/api/ParkFitting.txt" |
---|
468 | rel="nofollow">Show Source</a></li> |
---|
469 | </ul> |
---|
470 | <div id="searchbox" style="display: none"> |
---|
471 | <h3>Quick search</h3> |
---|
472 | <form class="search" action="../search.html" method="get"> |
---|
473 | <input type="text" name="q" size="18" /> |
---|
474 | <input type="submit" value="Go" /> |
---|
475 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
476 | <input type="hidden" name="area" value="default" /> |
---|
477 | </form> |
---|
478 | <p class="searchtip" style="font-size: 90%"> |
---|
479 | Enter search terms or a module, class or function name. |
---|
480 | </p> |
---|
481 | </div> |
---|
482 | <script type="text/javascript">$('#searchbox').show(0);</script> |
---|
483 | </div> |
---|
484 | </div> |
---|
485 | <div class="clearer"></div> |
---|
486 | </div> |
---|
487 | <div class="related"> |
---|
488 | <h3>Navigation</h3> |
---|
489 | <ul> |
---|
490 | <li class="right" style="margin-right: 10px"> |
---|
491 | <a href="../genindex.html" title="General Index" |
---|
492 | >index</a></li> |
---|
493 | <li class="right" > |
---|
494 | <a href="../py-modindex.html" title="Python Module Index" |
---|
495 | >modules</a> |</li> |
---|
496 | <li class="right" > |
---|
497 | <a href="ScipyFitting.html" title="ScipyFitting" |
---|
498 | >next</a> |</li> |
---|
499 | <li class="right" > |
---|
500 | <a href="Fitting.html" title="Fitting" |
---|
501 | >previous</a> |</li> |
---|
502 | <li><a href="../index.html">park_integration v0.1.0 documentation</a> »</li> |
---|
503 | <li><a href="index.html" >Reference</a> »</li> |
---|
504 | </ul> |
---|
505 | </div> |
---|
506 | <div class="footer"> |
---|
507 | © Copyright 2010, sans group. |
---|
508 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. |
---|
509 | </div> |
---|
510 | </body> |
---|
511 | </html> |
---|