1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
3 | |
---|
4 | |
---|
5 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
6 | <head> |
---|
7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
8 | |
---|
9 | <title>3.1. Bumps interface — Sasmodels</title> |
---|
10 | |
---|
11 | <link rel="stylesheet" href="../_static/haiku-site.css" type="text/css" /> |
---|
12 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
---|
13 | |
---|
14 | <script type="text/javascript"> |
---|
15 | var DOCUMENTATION_OPTIONS = { |
---|
16 | URL_ROOT: '../', |
---|
17 | VERSION: '0.9', |
---|
18 | COLLAPSE_INDEX: false, |
---|
19 | FILE_SUFFIX: '.html', |
---|
20 | HAS_SOURCE: true |
---|
21 | }; |
---|
22 | </script> |
---|
23 | <script type="text/javascript" src="../_static/jquery.js"></script> |
---|
24 | <script type="text/javascript" src="../_static/underscore.js"></script> |
---|
25 | <script type="text/javascript" src="../_static/doctools.js"></script> |
---|
26 | <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> |
---|
27 | <link rel="top" title="Sasmodels" href="../index.html" /> |
---|
28 | <link rel="up" title="3. Reference" href="index.html" /> |
---|
29 | <link rel="next" title="3.2. Sasview to sasmodel converter" href="convert.html" /> |
---|
30 | <link rel="prev" title="3. Reference" href="index.html" /> |
---|
31 | </head> |
---|
32 | <body> |
---|
33 | <div class="header"><h1 class="heading"><a href="../index.html"> |
---|
34 | <span>Home</span></a></h1> |
---|
35 | <h2 class="heading"><span>3.1. Bumps interface</span></h2> |
---|
36 | </div> |
---|
37 | <div class="topnav"> |
---|
38 | |
---|
39 | <p> |
---|
40 | «  <a href="index.html">3. Reference</a> |
---|
41 |   ::   |
---|
42 | <a class="uplink" href="../index.html">Contents</a> |
---|
43 |   ::   |
---|
44 | <a href="convert.html">3.2. Sasview to sasmodel converter</a>  Â» |
---|
45 | </p> |
---|
46 | |
---|
47 | </div> |
---|
48 | <div class="content"> |
---|
49 | |
---|
50 | |
---|
51 | <div class="section" id="bumps-interface"> |
---|
52 | <h1>3.1. Bumps interface<a class="headerlink" href="#bumps-interface" title="Permalink to this headline">¶</a></h1> |
---|
53 | <div class="section" id="module-sasmodels.bumps_model"> |
---|
54 | <span id="sasmodels-bumps-model"></span><h2>3.1.1. <a class="reference internal" href="#module-sasmodels.bumps_model" title="sasmodels.bumps_model"><tt class="xref py py-mod docutils literal"><span class="pre">sasmodels.bumps_model</span></tt></a><a class="headerlink" href="#module-sasmodels.bumps_model" title="Permalink to this headline">¶</a></h2> |
---|
55 | <p>Wrap sasmodels for direct use by bumps.</p> |
---|
56 | <p><a class="reference internal" href="#sasmodels.bumps_model.Model" title="sasmodels.bumps_model.Model"><tt class="xref py py-class docutils literal"><span class="pre">Model</span></tt></a> is a wrapper for the sasmodels kernel which defines a |
---|
57 | bumps <em>Parameter</em> box for each kernel parameter. <em>Model</em> accepts keyword |
---|
58 | arguments to set the initial value for each parameter.</p> |
---|
59 | <p><a class="reference internal" href="#sasmodels.bumps_model.Experiment" title="sasmodels.bumps_model.Experiment"><tt class="xref py py-class docutils literal"><span class="pre">Experiment</span></tt></a> combines the <em>Model</em> function with a data file loaded by the |
---|
60 | sasview data loader. <em>Experiment</em> takes a <em>cutoff</em> parameter controlling |
---|
61 | how far the polydispersity integral extends.</p> |
---|
62 | <p>A variety of helper functions are provided:</p> |
---|
63 | <blockquote> |
---|
64 | <div><p><a class="reference internal" href="#sasmodels.bumps_model.load_data" title="sasmodels.bumps_model.load_data"><tt class="xref py py-func docutils literal"><span class="pre">load_data()</span></tt></a> loads a sasview data file.</p> |
---|
65 | <p><a class="reference internal" href="#sasmodels.bumps_model.empty_data1D" title="sasmodels.bumps_model.empty_data1D"><tt class="xref py py-func docutils literal"><span class="pre">empty_data1D()</span></tt></a> creates an empty dataset, which is useful for plotting |
---|
66 | a theory function before the data is measured.</p> |
---|
67 | <p><a class="reference internal" href="#sasmodels.bumps_model.empty_data2D" title="sasmodels.bumps_model.empty_data2D"><tt class="xref py py-func docutils literal"><span class="pre">empty_data2D()</span></tt></a> creates an empty 2D dataset.</p> |
---|
68 | <p><a class="reference internal" href="#sasmodels.bumps_model.set_beam_stop" title="sasmodels.bumps_model.set_beam_stop"><tt class="xref py py-func docutils literal"><span class="pre">set_beam_stop()</span></tt></a> masks the beam stop from the data.</p> |
---|
69 | <p><a class="reference internal" href="#sasmodels.bumps_model.set_half" title="sasmodels.bumps_model.set_half"><tt class="xref py py-func docutils literal"><span class="pre">set_half()</span></tt></a> selects the right or left half of the data, which can |
---|
70 | be useful for shear measurements which have not been properly corrected |
---|
71 | for path length and reflections.</p> |
---|
72 | <p><a class="reference internal" href="#sasmodels.bumps_model.set_top" title="sasmodels.bumps_model.set_top"><tt class="xref py py-func docutils literal"><span class="pre">set_top()</span></tt></a> cuts the top part off the data.</p> |
---|
73 | <p><a class="reference internal" href="#sasmodels.bumps_model.plot_data" title="sasmodels.bumps_model.plot_data"><tt class="xref py py-func docutils literal"><span class="pre">plot_data()</span></tt></a> plots the data file.</p> |
---|
74 | <p><a class="reference internal" href="#sasmodels.bumps_model.plot_theory" title="sasmodels.bumps_model.plot_theory"><tt class="xref py py-func docutils literal"><span class="pre">plot_theory()</span></tt></a> plots a calculated result from the model.</p> |
---|
75 | </div></blockquote> |
---|
76 | <dl class="class"> |
---|
77 | <dt id="sasmodels.bumps_model.Experiment"> |
---|
78 | <em class="property">class </em><tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">Experiment</tt><big>(</big><em>data</em>, <em>model</em>, <em>cutoff=1e-05</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment" title="Permalink to this definition">¶</a></dt> |
---|
79 | <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p> |
---|
80 | <p>Return a bumps wrapper for a SAS model.</p> |
---|
81 | <p><em>data</em> is the data to be fitted.</p> |
---|
82 | <p><em>model</em> is the SAS model from <tt class="xref py py-func docutils literal"><span class="pre">core.load_model()</span></tt>.</p> |
---|
83 | <p><em>cutoff</em> is the integration cutoff, which avoids computing the |
---|
84 | the SAS model where the polydispersity weight is low.</p> |
---|
85 | <p>Model parameters can be initialized with additional keyword |
---|
86 | arguments, or by assigning to model.parameter_name.value.</p> |
---|
87 | <p>The resulting bumps model can be used directly in a FitProblem call.</p> |
---|
88 | <dl class="method"> |
---|
89 | <dt id="sasmodels.bumps_model.Experiment.nllf"> |
---|
90 | <tt class="descname">nllf</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment.nllf" title="Permalink to this definition">¶</a></dt> |
---|
91 | <dd></dd></dl> |
---|
92 | |
---|
93 | <dl class="method"> |
---|
94 | <dt id="sasmodels.bumps_model.Experiment.numpoints"> |
---|
95 | <tt class="descname">numpoints</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment.numpoints" title="Permalink to this definition">¶</a></dt> |
---|
96 | <dd><p>Return the number of points</p> |
---|
97 | </dd></dl> |
---|
98 | |
---|
99 | <dl class="method"> |
---|
100 | <dt id="sasmodels.bumps_model.Experiment.parameters"> |
---|
101 | <tt class="descname">parameters</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment.parameters" title="Permalink to this definition">¶</a></dt> |
---|
102 | <dd><p>Return a dictionary of parameters</p> |
---|
103 | </dd></dl> |
---|
104 | |
---|
105 | <dl class="method"> |
---|
106 | <dt id="sasmodels.bumps_model.Experiment.plot"> |
---|
107 | <tt class="descname">plot</tt><big>(</big><em>view='log'</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment.plot" title="Permalink to this definition">¶</a></dt> |
---|
108 | <dd><p>Plot the data and residuals.</p> |
---|
109 | </dd></dl> |
---|
110 | |
---|
111 | <dl class="method"> |
---|
112 | <dt id="sasmodels.bumps_model.Experiment.residuals"> |
---|
113 | <tt class="descname">residuals</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment.residuals" title="Permalink to this definition">¶</a></dt> |
---|
114 | <dd></dd></dl> |
---|
115 | |
---|
116 | <dl class="method"> |
---|
117 | <dt id="sasmodels.bumps_model.Experiment.save"> |
---|
118 | <tt class="descname">save</tt><big>(</big><em>basename</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment.save" title="Permalink to this definition">¶</a></dt> |
---|
119 | <dd></dd></dl> |
---|
120 | |
---|
121 | <dl class="method"> |
---|
122 | <dt id="sasmodels.bumps_model.Experiment.simulate_data"> |
---|
123 | <tt class="descname">simulate_data</tt><big>(</big><em>noise=None</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment.simulate_data" title="Permalink to this definition">¶</a></dt> |
---|
124 | <dd></dd></dl> |
---|
125 | |
---|
126 | <dl class="method"> |
---|
127 | <dt id="sasmodels.bumps_model.Experiment.theory"> |
---|
128 | <tt class="descname">theory</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment.theory" title="Permalink to this definition">¶</a></dt> |
---|
129 | <dd></dd></dl> |
---|
130 | |
---|
131 | <dl class="method"> |
---|
132 | <dt id="sasmodels.bumps_model.Experiment.update"> |
---|
133 | <tt class="descname">update</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Experiment.update" title="Permalink to this definition">¶</a></dt> |
---|
134 | <dd></dd></dl> |
---|
135 | |
---|
136 | </dd></dl> |
---|
137 | |
---|
138 | <dl class="class"> |
---|
139 | <dt id="sasmodels.bumps_model.Model"> |
---|
140 | <em class="property">class </em><tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">Model</tt><big>(</big><em>kernel</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Model" title="Permalink to this definition">¶</a></dt> |
---|
141 | <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p> |
---|
142 | <dl class="method"> |
---|
143 | <dt id="sasmodels.bumps_model.Model.parameters"> |
---|
144 | <tt class="descname">parameters</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.Model.parameters" title="Permalink to this definition">¶</a></dt> |
---|
145 | <dd><p>Return a dictionary of parameters</p> |
---|
146 | </dd></dl> |
---|
147 | |
---|
148 | </dd></dl> |
---|
149 | |
---|
150 | <dl class="function"> |
---|
151 | <dt id="sasmodels.bumps_model.BumpsModel"> |
---|
152 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">BumpsModel</tt><big>(</big><em>data</em>, <em>model</em>, <em>cutoff=1e-05</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.BumpsModel" title="Permalink to this definition">¶</a></dt> |
---|
153 | <dd></dd></dl> |
---|
154 | |
---|
155 | <dl class="function"> |
---|
156 | <dt id="sasmodels.bumps_model.delay"> |
---|
157 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">delay</tt><big>(</big><em>dt</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.delay" title="Permalink to this definition">¶</a></dt> |
---|
158 | <dd><p>Return number date-time delta as number seconds</p> |
---|
159 | </dd></dl> |
---|
160 | |
---|
161 | <dl class="function"> |
---|
162 | <dt id="sasmodels.bumps_model.demo"> |
---|
163 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">demo</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.demo" title="Permalink to this definition">¶</a></dt> |
---|
164 | <dd></dd></dl> |
---|
165 | |
---|
166 | <dl class="function"> |
---|
167 | <dt id="sasmodels.bumps_model.empty_data1D"> |
---|
168 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">empty_data1D</tt><big>(</big><em>q</em>, <em>resolution=0.05</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.empty_data1D" title="Permalink to this definition">¶</a></dt> |
---|
169 | <dd><p>Create empty 1D data using the given <em>q</em> as the x value.</p> |
---|
170 | <p><em>resolution</em> dq/q defaults to 5%.</p> |
---|
171 | </dd></dl> |
---|
172 | |
---|
173 | <dl class="function"> |
---|
174 | <dt id="sasmodels.bumps_model.empty_data2D"> |
---|
175 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">empty_data2D</tt><big>(</big><em>qx</em>, <em>qy=None</em>, <em>resolution=0.05</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.empty_data2D" title="Permalink to this definition">¶</a></dt> |
---|
176 | <dd><p>Create empty 2D data using the given mesh.</p> |
---|
177 | <p>If <em>qy</em> is missing, create a square mesh with <em>qy=qx</em>.</p> |
---|
178 | <p><em>resolution</em> dq/q defaults to 5%.</p> |
---|
179 | </dd></dl> |
---|
180 | |
---|
181 | <dl class="function"> |
---|
182 | <dt id="sasmodels.bumps_model.load_data"> |
---|
183 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">load_data</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.load_data" title="Permalink to this definition">¶</a></dt> |
---|
184 | <dd><p>Load data using a sasview loader.</p> |
---|
185 | </dd></dl> |
---|
186 | |
---|
187 | <dl class="function"> |
---|
188 | <dt id="sasmodels.bumps_model.plot_data"> |
---|
189 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">plot_data</tt><big>(</big><em>data</em>, <em>view='log'</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.plot_data" title="Permalink to this definition">¶</a></dt> |
---|
190 | <dd><p>Plot data loaded by the sasview loader.</p> |
---|
191 | </dd></dl> |
---|
192 | |
---|
193 | <dl class="function"> |
---|
194 | <dt id="sasmodels.bumps_model.plot_theory"> |
---|
195 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">plot_theory</tt><big>(</big><em>data</em>, <em>theory</em>, <em>view='log'</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.plot_theory" title="Permalink to this definition">¶</a></dt> |
---|
196 | <dd></dd></dl> |
---|
197 | |
---|
198 | <dl class="function"> |
---|
199 | <dt id="sasmodels.bumps_model.set_beam_stop"> |
---|
200 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">set_beam_stop</tt><big>(</big><em>data</em>, <em>radius</em>, <em>outer=None</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.set_beam_stop" title="Permalink to this definition">¶</a></dt> |
---|
201 | <dd><p>Add a beam stop of the given <em>radius</em>. If <em>outer</em>, make an annulus.</p> |
---|
202 | </dd></dl> |
---|
203 | |
---|
204 | <dl class="function"> |
---|
205 | <dt id="sasmodels.bumps_model.set_half"> |
---|
206 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">set_half</tt><big>(</big><em>data</em>, <em>half</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.set_half" title="Permalink to this definition">¶</a></dt> |
---|
207 | <dd><p>Select half of the data, either “right” or “left”.</p> |
---|
208 | </dd></dl> |
---|
209 | |
---|
210 | <dl class="function"> |
---|
211 | <dt id="sasmodels.bumps_model.set_top"> |
---|
212 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">set_top</tt><big>(</big><em>data</em>, <em>cutoff</em><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.set_top" title="Permalink to this definition">¶</a></dt> |
---|
213 | <dd><p>Chop the top off the data, above <em>cutoff</em>.</p> |
---|
214 | </dd></dl> |
---|
215 | |
---|
216 | <dl class="function"> |
---|
217 | <dt id="sasmodels.bumps_model.tic"> |
---|
218 | <tt class="descclassname">sasmodels.bumps_model.</tt><tt class="descname">tic</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.bumps_model.tic" title="Permalink to this definition">¶</a></dt> |
---|
219 | <dd><p>Timer function.</p> |
---|
220 | <p>Use “toc=tic()” to start the clock and “toc()” to measure |
---|
221 | a time interval.</p> |
---|
222 | </dd></dl> |
---|
223 | |
---|
224 | </div> |
---|
225 | </div> |
---|
226 | |
---|
227 | |
---|
228 | </div> |
---|
229 | <div class="bottomnav"> |
---|
230 | |
---|
231 | <p> |
---|
232 | «  <a href="index.html">3. Reference</a> |
---|
233 |   ::   |
---|
234 | <a class="uplink" href="../index.html">Contents</a> |
---|
235 |   ::   |
---|
236 | <a href="convert.html">3.2. Sasview to sasmodel converter</a>  Â» |
---|
237 | </p> |
---|
238 | |
---|
239 | </div> |
---|
240 | |
---|
241 | <div class="footer"> |
---|
242 | © Copyright 2014, sasview team. |
---|
243 | Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. |
---|
244 | </div> |
---|
245 | </body> |
---|
246 | </html> |
---|