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>smearing_2d — DataLoader 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="DataLoader v0.1.0 documentation" href="../index.html" /> |
---|
26 | <link rel="up" title="Reference" href="index.html" /> |
---|
27 | <link rel="next" title="Readers" href="readers/index.html" /> |
---|
28 | <link rel="prev" title="qsmearing" href="qsmearing.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="readers/index.html" title="Readers" |
---|
42 | accesskey="N">next</a> |</li> |
---|
43 | <li class="right" > |
---|
44 | <a href="qsmearing.html" title="qsmearing" |
---|
45 | accesskey="P">previous</a> |</li> |
---|
46 | <li><a href="../index.html">DataLoader 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="smearing-2d"> |
---|
57 | <h1>smearing_2d<a class="headerlink" href="#smearing-2d" title="Permalink to this headline">¶</a></h1> |
---|
58 | <div class="section" id="module-DataLoader.smearing_2d"> |
---|
59 | <span id="dataloader-smearing-2d"></span><h2><a class="reference internal" href="#module-DataLoader.smearing_2d"><tt class="xref py py-mod docutils literal"><span class="pre">DataLoader.smearing_2d</span></tt></a><a class="headerlink" href="#module-DataLoader.smearing_2d" title="Permalink to this headline">¶</a></h2> |
---|
60 | <dl class="class"> |
---|
61 | <dt id="DataLoader.smearing_2d.Smearer2D"> |
---|
62 | <em class="property">class </em><tt class="descclassname">DataLoader.smearing_2d.</tt><tt class="descname">Smearer2D</tt><big>(</big><em>data=None</em>, <em>model=None</em>, <em>index=None</em>, <em>limit=2.5</em>, <em>accuracy='Low'</em><big>)</big><a class="headerlink" href="#DataLoader.smearing_2d.Smearer2D" title="Permalink to this definition">¶</a></dt> |
---|
63 | <dd><p>Gaussian Q smearing class for SANS 2d data</p> |
---|
64 | <dl class="method"> |
---|
65 | <dt id="DataLoader.smearing_2d.Smearer2D.get_data"> |
---|
66 | <tt class="descname">get_data</tt><big>(</big><big>)</big><a class="headerlink" href="#DataLoader.smearing_2d.Smearer2D.get_data" title="Permalink to this definition">¶</a></dt> |
---|
67 | <dd>get qx_data, qy_data, dqx_data,dqy_data,and calculate phi_data=arctan(qx_data/qy_data)</dd></dl> |
---|
68 | |
---|
69 | <dl class="method"> |
---|
70 | <dt id="DataLoader.smearing_2d.Smearer2D.get_value"> |
---|
71 | <tt class="descname">get_value</tt><big>(</big><big>)</big><a class="headerlink" href="#DataLoader.smearing_2d.Smearer2D.get_value" title="Permalink to this definition">¶</a></dt> |
---|
72 | <dd><p>Over sampling of r_nbins times phi_nbins, calculate Gaussian weights, then find smeared intensity |
---|
73 | For the default values, this is equivalent (but by using numpy array |
---|
74 | the speed optimized by a factor of ten)to the following:</p> |
---|
75 | <div class="highlight-python"><pre>Remove the singular points if exists |
---|
76 | self.dqx_data[self.dqx_data==0]=SIGMA_ZERO |
---|
77 | self.dqy_data[self.dqy_data==0]=SIGMA_ZERO |
---|
78 | |
---|
79 | for phi in range(0,4): |
---|
80 | for r in range(0,5): |
---|
81 | n = (phi)*5+(r) |
---|
82 | r = r+0.25 |
---|
83 | dphi = phi*2.0*math.pi/4.0 + numpy.arctan(self.qy_data[index_model]/self.dqy_data[index_model]/self.qx_data[index_model]*/self.dqx_data[index_model]) |
---|
84 | dq = r*sqrt( self.dqx_data[index_model]*self.dqx_data[index_model] + self.dqy_data[index_model]*self.dqy_data[index_model] ) |
---|
85 | #integrant of exp(-0.5*r*r) r dr at each bins : The integration may not need. |
---|
86 | weight_res[n] = e^{(-0.5*((r-0.25)*(r-0.25)))}- e^{(-0.5*((r-0.25)*(r-0.25)))} |
---|
87 | #if phi != 0 and r != 0: |
---|
88 | qx_res = numpy.append(qx_res,self.qx_data[index_model]+ dq * cos(dphi)) |
---|
89 | qy_res = numpy.append(qy_res,self.qy_data[index_model]+ dq * sin(dphi))</pre> |
---|
90 | </div> |
---|
91 | <p>Then compute I(qx_res,qy_res) and do weighted averaging.</p> |
---|
92 | </dd></dl> |
---|
93 | |
---|
94 | <dl class="method"> |
---|
95 | <dt id="DataLoader.smearing_2d.Smearer2D.set_accuracy"> |
---|
96 | <tt class="descname">set_accuracy</tt><big>(</big><em>accuracy='Low'</em><big>)</big><a class="headerlink" href="#DataLoader.smearing_2d.Smearer2D.set_accuracy" title="Permalink to this definition">¶</a></dt> |
---|
97 | <dd><p>Set accuracy.</p> |
---|
98 | <table class="docutils field-list" frame="void" rules="none"> |
---|
99 | <col class="field-name" /> |
---|
100 | <col class="field-body" /> |
---|
101 | <tbody valign="top"> |
---|
102 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
103 | <li><strong>accuracy</strong> – string</li> |
---|
104 | </ul> |
---|
105 | </td> |
---|
106 | </tr> |
---|
107 | </tbody> |
---|
108 | </table> |
---|
109 | </dd></dl> |
---|
110 | |
---|
111 | <dl class="method"> |
---|
112 | <dt id="DataLoader.smearing_2d.Smearer2D.set_data"> |
---|
113 | <tt class="descname">set_data</tt><big>(</big><em>data=None</em><big>)</big><a class="headerlink" href="#DataLoader.smearing_2d.Smearer2D.set_data" title="Permalink to this definition">¶</a></dt> |
---|
114 | <dd><p>Set data.</p> |
---|
115 | <table class="docutils field-list" frame="void" rules="none"> |
---|
116 | <col class="field-name" /> |
---|
117 | <col class="field-body" /> |
---|
118 | <tbody valign="top"> |
---|
119 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
120 | <li><strong>data</strong> – DataLoader.Data_info type</li> |
---|
121 | </ul> |
---|
122 | </td> |
---|
123 | </tr> |
---|
124 | </tbody> |
---|
125 | </table> |
---|
126 | </dd></dl> |
---|
127 | |
---|
128 | <dl class="method"> |
---|
129 | <dt id="DataLoader.smearing_2d.Smearer2D.set_index"> |
---|
130 | <tt class="descname">set_index</tt><big>(</big><em>index=None</em><big>)</big><a class="headerlink" href="#DataLoader.smearing_2d.Smearer2D.set_index" title="Permalink to this definition">¶</a></dt> |
---|
131 | <dd><p>Set index.</p> |
---|
132 | <table class="docutils field-list" frame="void" rules="none"> |
---|
133 | <col class="field-name" /> |
---|
134 | <col class="field-body" /> |
---|
135 | <tbody valign="top"> |
---|
136 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
137 | <li><strong>index</strong> – 1d arrays</li> |
---|
138 | </ul> |
---|
139 | </td> |
---|
140 | </tr> |
---|
141 | </tbody> |
---|
142 | </table> |
---|
143 | </dd></dl> |
---|
144 | |
---|
145 | <dl class="method"> |
---|
146 | <dt id="DataLoader.smearing_2d.Smearer2D.set_model"> |
---|
147 | <tt class="descname">set_model</tt><big>(</big><em>model=None</em><big>)</big><a class="headerlink" href="#DataLoader.smearing_2d.Smearer2D.set_model" title="Permalink to this definition">¶</a></dt> |
---|
148 | <dd><p>Set model.</p> |
---|
149 | <table class="docutils field-list" frame="void" rules="none"> |
---|
150 | <col class="field-name" /> |
---|
151 | <col class="field-body" /> |
---|
152 | <tbody valign="top"> |
---|
153 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
154 | <li><strong>model</strong> – sans.models instance</li> |
---|
155 | </ul> |
---|
156 | </td> |
---|
157 | </tr> |
---|
158 | </tbody> |
---|
159 | </table> |
---|
160 | </dd></dl> |
---|
161 | |
---|
162 | <dl class="method"> |
---|
163 | <dt id="DataLoader.smearing_2d.Smearer2D.set_smearer"> |
---|
164 | <tt class="descname">set_smearer</tt><big>(</big><em>smearer=True</em><big>)</big><a class="headerlink" href="#DataLoader.smearing_2d.Smearer2D.set_smearer" title="Permalink to this definition">¶</a></dt> |
---|
165 | <dd><p>Set whether or not smearer will be used</p> |
---|
166 | <table class="docutils field-list" frame="void" rules="none"> |
---|
167 | <col class="field-name" /> |
---|
168 | <col class="field-body" /> |
---|
169 | <tbody valign="top"> |
---|
170 | <tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
171 | <li><strong>smearer</strong> – smear object</li> |
---|
172 | </ul> |
---|
173 | </td> |
---|
174 | </tr> |
---|
175 | </tbody> |
---|
176 | </table> |
---|
177 | </dd></dl> |
---|
178 | |
---|
179 | </dd></dl> |
---|
180 | |
---|
181 | </div> |
---|
182 | </div> |
---|
183 | |
---|
184 | |
---|
185 | </div> |
---|
186 | </div> |
---|
187 | </div> |
---|
188 | <div class="sphinxsidebar"> |
---|
189 | <div class="sphinxsidebarwrapper"> |
---|
190 | <h3><a href="../index.html">Table Of Contents</a></h3> |
---|
191 | <ul> |
---|
192 | <li><a class="reference internal" href="#">smearing_2d</a><ul> |
---|
193 | <li><a class="reference internal" href="#module-DataLoader.smearing_2d"><tt class="docutils literal"><span class="pre">DataLoader.smearing_2d</span></tt></a></li> |
---|
194 | </ul> |
---|
195 | </li> |
---|
196 | </ul> |
---|
197 | |
---|
198 | <h4>Previous topic</h4> |
---|
199 | <p class="topless"><a href="qsmearing.html" |
---|
200 | title="previous chapter">qsmearing</a></p> |
---|
201 | <h4>Next topic</h4> |
---|
202 | <p class="topless"><a href="readers/index.html" |
---|
203 | title="next chapter">Readers</a></p> |
---|
204 | <h3>This Page</h3> |
---|
205 | <ul class="this-page-menu"> |
---|
206 | <li><a href="../_sources/api/smearing_2d.txt" |
---|
207 | rel="nofollow">Show Source</a></li> |
---|
208 | </ul> |
---|
209 | <div id="searchbox" style="display: none"> |
---|
210 | <h3>Quick search</h3> |
---|
211 | <form class="search" action="../search.html" method="get"> |
---|
212 | <input type="text" name="q" size="18" /> |
---|
213 | <input type="submit" value="Go" /> |
---|
214 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
215 | <input type="hidden" name="area" value="default" /> |
---|
216 | </form> |
---|
217 | <p class="searchtip" style="font-size: 90%"> |
---|
218 | Enter search terms or a module, class or function name. |
---|
219 | </p> |
---|
220 | </div> |
---|
221 | <script type="text/javascript">$('#searchbox').show(0);</script> |
---|
222 | </div> |
---|
223 | </div> |
---|
224 | <div class="clearer"></div> |
---|
225 | </div> |
---|
226 | <div class="related"> |
---|
227 | <h3>Navigation</h3> |
---|
228 | <ul> |
---|
229 | <li class="right" style="margin-right: 10px"> |
---|
230 | <a href="../genindex.html" title="General Index" |
---|
231 | >index</a></li> |
---|
232 | <li class="right" > |
---|
233 | <a href="../py-modindex.html" title="Python Module Index" |
---|
234 | >modules</a> |</li> |
---|
235 | <li class="right" > |
---|
236 | <a href="readers/index.html" title="Readers" |
---|
237 | >next</a> |</li> |
---|
238 | <li class="right" > |
---|
239 | <a href="qsmearing.html" title="qsmearing" |
---|
240 | >previous</a> |</li> |
---|
241 | <li><a href="../index.html">DataLoader v0.1.0 documentation</a> »</li> |
---|
242 | <li><a href="index.html" >Reference</a> »</li> |
---|
243 | </ul> |
---|
244 | </div> |
---|
245 | <div class="footer"> |
---|
246 | © Copyright 2010, sans group. |
---|
247 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0b1. |
---|
248 | </div> |
---|
249 | </body> |
---|
250 | </html> |
---|