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>GSAS-II GUI Routines — GSAS-II 0.2.0 documentation</title> |
---|
10 | |
---|
11 | <link rel="stylesheet" href="_static/default.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.2.0', |
---|
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="GSAS-II 0.2.0 documentation" href="index.html" /> |
---|
28 | <link rel="next" title="GSAS-II GUI Submodules" href="GSASIIGUI.html" /> |
---|
29 | <link rel="prev" title="GSAS-II Utility Modules" href="GSASIIutil.html" /> |
---|
30 | </head> |
---|
31 | <body> |
---|
32 | <div class="related"> |
---|
33 | <h3>Navigation</h3> |
---|
34 | <ul> |
---|
35 | <li class="right" style="margin-right: 10px"> |
---|
36 | <a href="genindex.html" title="General Index" |
---|
37 | accesskey="I">index</a></li> |
---|
38 | <li class="right" > |
---|
39 | <a href="py-modindex.html" title="Python Module Index" |
---|
40 | >modules</a> |</li> |
---|
41 | <li class="right" > |
---|
42 | <a href="GSASIIGUI.html" title="GSAS-II GUI Submodules" |
---|
43 | accesskey="N">next</a> |</li> |
---|
44 | <li class="right" > |
---|
45 | <a href="GSASIIutil.html" title="GSAS-II Utility Modules" |
---|
46 | accesskey="P">previous</a> |</li> |
---|
47 | <li><a href="index.html">GSAS-II 0.2.0 documentation</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="module-GSASIIctrls"> |
---|
57 | <span id="gsas-ii-gui-routines"></span><h1><em>GSAS-II GUI Routines</em><a class="headerlink" href="#module-GSASIIctrls" title="Permalink to this headline">¶</a></h1> |
---|
58 | <div class="section" id="gsasiictrls-custom-gui-controls"> |
---|
59 | <h2><em>GSASIIctrls: Custom GUI controls</em><a class="headerlink" href="#gsasiictrls-custom-gui-controls" title="Permalink to this headline">¶</a></h2> |
---|
60 | <p>A library of GUI controls for reuse throughout GSAS-II</p> |
---|
61 | <p>(at present many are still in GSASIIgrid, but with time will be moved here)</p> |
---|
62 | <dl class="class"> |
---|
63 | <dt id="GSASIIctrls.ASCIIValidator"> |
---|
64 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">ASCIIValidator</tt><big>(</big><em>result=None</em>, <em>key=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ASCIIValidator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ASCIIValidator" title="Permalink to this definition">¶</a></dt> |
---|
65 | <dd><p>A validator to be used with a TextCtrl to prevent |
---|
66 | entering characters other than ASCII characters.</p> |
---|
67 | <dl class="docutils"> |
---|
68 | <dt>The value is checked for validity after every keystroke</dt> |
---|
69 | <dd>If an invalid number is entered, the box is highlighted. |
---|
70 | If the number is valid, it is saved in result[key]</dd> |
---|
71 | </dl> |
---|
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-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
77 | <li><strong>result</strong> (<em>dict/list</em>) – List or dict where value should be placed when valid</li> |
---|
78 | <li><strong>key</strong> (<em>any</em>) – key to use for result (int for list)</li> |
---|
79 | </ul> |
---|
80 | </td> |
---|
81 | </tr> |
---|
82 | </tbody> |
---|
83 | </table> |
---|
84 | <dl class="method"> |
---|
85 | <dt id="GSASIIctrls.ASCIIValidator.Clone"> |
---|
86 | <tt class="descname">Clone</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ASCIIValidator.Clone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ASCIIValidator.Clone" title="Permalink to this definition">¶</a></dt> |
---|
87 | <dd><p>Create a copy of the validator, a strange, but required component</p> |
---|
88 | </dd></dl> |
---|
89 | |
---|
90 | <dl class="method"> |
---|
91 | <dt id="GSASIIctrls.ASCIIValidator.OnChar"> |
---|
92 | <tt class="descname">OnChar</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ASCIIValidator.OnChar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ASCIIValidator.OnChar" title="Permalink to this definition">¶</a></dt> |
---|
93 | <dd><p>Called each type a key is pressed |
---|
94 | ignores keys that are not allowed for int and float types</p> |
---|
95 | </dd></dl> |
---|
96 | |
---|
97 | <dl class="method"> |
---|
98 | <dt id="GSASIIctrls.ASCIIValidator.TestValid"> |
---|
99 | <tt class="descname">TestValid</tt><big>(</big><em>tc</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ASCIIValidator.TestValid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ASCIIValidator.TestValid" title="Permalink to this definition">¶</a></dt> |
---|
100 | <dd><p>Check if the value is valid by casting the input string |
---|
101 | into ASCII.</p> |
---|
102 | <p>Save it in the dict/list where the initial value was stored</p> |
---|
103 | <table class="docutils field-list" frame="void" rules="none"> |
---|
104 | <col class="field-name" /> |
---|
105 | <col class="field-body" /> |
---|
106 | <tbody valign="top"> |
---|
107 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>tc</strong> (<em>wx.TextCtrl</em>) – A reference to the TextCtrl that the validator |
---|
108 | is associated with.</td> |
---|
109 | </tr> |
---|
110 | </tbody> |
---|
111 | </table> |
---|
112 | </dd></dl> |
---|
113 | |
---|
114 | <dl class="method"> |
---|
115 | <dt id="GSASIIctrls.ASCIIValidator.TransferFromWindow"> |
---|
116 | <tt class="descname">TransferFromWindow</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ASCIIValidator.TransferFromWindow"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ASCIIValidator.TransferFromWindow" title="Permalink to this definition">¶</a></dt> |
---|
117 | <dd><p>Needed by validator, strange, but required component</p> |
---|
118 | </dd></dl> |
---|
119 | |
---|
120 | <dl class="method"> |
---|
121 | <dt id="GSASIIctrls.ASCIIValidator.TransferToWindow"> |
---|
122 | <tt class="descname">TransferToWindow</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ASCIIValidator.TransferToWindow"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ASCIIValidator.TransferToWindow" title="Permalink to this definition">¶</a></dt> |
---|
123 | <dd><p>Needed by validator, strange, but required component</p> |
---|
124 | </dd></dl> |
---|
125 | |
---|
126 | </dd></dl> |
---|
127 | |
---|
128 | <dl class="class"> |
---|
129 | <dt id="GSASIIctrls.AddHelp"> |
---|
130 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">AddHelp</tt><big>(</big><em>frame</em>, <em>helpType</em>, <em>helpLbl=None</em>, <em>title=''</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#AddHelp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.AddHelp" title="Permalink to this definition">¶</a></dt> |
---|
131 | <dd><p>For the Mac: creates an entry to the help menu of type |
---|
132 | ‘Help on <helpType>’: where helpType is a reference to an HTML page to |
---|
133 | be opened.</p> |
---|
134 | <p>NOTE: when appending this menu (menu.Append) be sure to set the title to |
---|
135 | ‘&Help’ so that wx handles it correctly.</p> |
---|
136 | <dl class="method"> |
---|
137 | <dt id="GSASIIctrls.AddHelp.OnHelpById"> |
---|
138 | <tt class="descname">OnHelpById</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#AddHelp.OnHelpById"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.AddHelp.OnHelpById" title="Permalink to this definition">¶</a></dt> |
---|
139 | <dd><p>Called when Help on... is pressed in a menu. Brings up |
---|
140 | a web page for documentation.</p> |
---|
141 | </dd></dl> |
---|
142 | |
---|
143 | </dd></dl> |
---|
144 | |
---|
145 | <dl class="function"> |
---|
146 | <dt id="GSASIIctrls.CallScrolledMultiEditor"> |
---|
147 | <tt class="descclassname">GSASIIctrls.</tt><tt class="descname">CallScrolledMultiEditor</tt><big>(</big><em>parent</em>, <em>dictlst</em>, <em>elemlst</em>, <em>prelbl=</em>, <span class="optional">[</span><span class="optional">]</span><em>postlbl=</em>, <span class="optional">[</span><span class="optional">]</span><em>title='Edit items'</em>, <em>header=''</em>, <em>size=(300</em>, <em>250)</em>, <em>CopyButton=False</em>, <em>**kw</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#CallScrolledMultiEditor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.CallScrolledMultiEditor" title="Permalink to this definition">¶</a></dt> |
---|
148 | <dd><p>Shell routine to call a ScrolledMultiEditor dialog. See |
---|
149 | <a class="reference internal" href="#GSASIIctrls.ScrolledMultiEditor" title="GSASIIctrls.ScrolledMultiEditor"><tt class="xref py py-class docutils literal"><span class="pre">ScrolledMultiEditor</span></tt></a> for parameter definitions.</p> |
---|
150 | <table class="docutils field-list" frame="void" rules="none"> |
---|
151 | <col class="field-name" /> |
---|
152 | <col class="field-body" /> |
---|
153 | <tbody valign="top"> |
---|
154 | <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if the OK button is pressed; False if the window is closed |
---|
155 | with the system menu or the Cancel button.</td> |
---|
156 | </tr> |
---|
157 | </tbody> |
---|
158 | </table> |
---|
159 | </dd></dl> |
---|
160 | |
---|
161 | <dl class="class"> |
---|
162 | <dt id="GSASIIctrls.G2CheckBox"> |
---|
163 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">G2CheckBox</tt><big>(</big><em>parent</em>, <em>label</em>, <em>loc</em>, <em>key</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2CheckBox"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2CheckBox" title="Permalink to this definition">¶</a></dt> |
---|
164 | <dd><p>A customized version of a CheckBox that automatically initializes |
---|
165 | the control to a supplied list or dict entry and updates that |
---|
166 | entry as the widget is used.</p> |
---|
167 | <table class="docutils field-list" frame="void" rules="none"> |
---|
168 | <col class="field-name" /> |
---|
169 | <col class="field-body" /> |
---|
170 | <tbody valign="top"> |
---|
171 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
172 | <li><strong>parent</strong> (<em>wx.Panel</em>) – name of panel or frame that will be |
---|
173 | the parent to the widget. Can be None.</li> |
---|
174 | <li><strong>label</strong> (<em>str</em>) – text to put on check button</li> |
---|
175 | <li><strong>loc</strong> (<em>dict/list</em>) – the dict or list with the initial value to be |
---|
176 | placed in the CheckBox.</li> |
---|
177 | <li><strong>key</strong> (<em>int/str</em>) – the dict key or the list index for the value to be |
---|
178 | edited by the CheckBox. The <tt class="docutils literal"><span class="pre">loc[key]</span></tt> element must exist. |
---|
179 | The CheckBox will be initialized from this value. |
---|
180 | If the value is anything other that True (or 1), it will be taken as |
---|
181 | False.</li> |
---|
182 | </ul> |
---|
183 | </td> |
---|
184 | </tr> |
---|
185 | </tbody> |
---|
186 | </table> |
---|
187 | </dd></dl> |
---|
188 | |
---|
189 | <dl class="class"> |
---|
190 | <dt id="GSASIIctrls.G2HtmlWindow"> |
---|
191 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">G2HtmlWindow</tt><big>(</big><em>parent</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2HtmlWindow"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2HtmlWindow" title="Permalink to this definition">¶</a></dt> |
---|
192 | <dd><p>Displays help information in a primitive HTML browser type window</p> |
---|
193 | </dd></dl> |
---|
194 | |
---|
195 | <dl class="function"> |
---|
196 | <dt id="GSASIIctrls.G2MessageBox"> |
---|
197 | <tt class="descclassname">GSASIIctrls.</tt><tt class="descname">G2MessageBox</tt><big>(</big><em>parent</em>, <em>msg</em>, <em>title='Error'</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2MessageBox"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2MessageBox" title="Permalink to this definition">¶</a></dt> |
---|
198 | <dd><p>Simple code to display a error or warning message</p> |
---|
199 | </dd></dl> |
---|
200 | |
---|
201 | <dl class="class"> |
---|
202 | <dt id="GSASIIctrls.G2TreeCtrl"> |
---|
203 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">G2TreeCtrl</tt><big>(</big><em>parent=None</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2TreeCtrl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2TreeCtrl" title="Permalink to this definition">¶</a></dt> |
---|
204 | <dd><p>Create a wrapper around the standard TreeCtrl so we can “wrap” |
---|
205 | various events.</p> |
---|
206 | <p>This logs when a tree item is selected (in <a class="reference internal" href="#GSASIIctrls.G2TreeCtrl.onSelectionChanged" title="GSASIIctrls.G2TreeCtrl.onSelectionChanged"><tt class="xref py py-meth docutils literal"><span class="pre">onSelectionChanged()</span></tt></a>)</p> |
---|
207 | <p>This also wraps lists and dicts pulled out of the tree to track where |
---|
208 | they were retrieved from.</p> |
---|
209 | <dl class="method"> |
---|
210 | <dt id="GSASIIctrls.G2TreeCtrl.Bind"> |
---|
211 | <tt class="descname">Bind</tt><big>(</big><em>eventtype</em>, <em>handler</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2TreeCtrl.Bind"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2TreeCtrl.Bind" title="Permalink to this definition">¶</a></dt> |
---|
212 | <dd><p>Override the Bind() function so that page change events can be trapped</p> |
---|
213 | </dd></dl> |
---|
214 | |
---|
215 | <dl class="method"> |
---|
216 | <dt id="GSASIIctrls.G2TreeCtrl.ConvertRelativeHistNum"> |
---|
217 | <tt class="descname">ConvertRelativeHistNum</tt><big>(</big><em>histtype</em>, <em>histnum</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2TreeCtrl.ConvertRelativeHistNum"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2TreeCtrl.ConvertRelativeHistNum" title="Permalink to this definition">¶</a></dt> |
---|
218 | <dd><p>Converts a histogram type and relative histogram number to a |
---|
219 | histogram name in the current project</p> |
---|
220 | </dd></dl> |
---|
221 | |
---|
222 | <dl class="method"> |
---|
223 | <dt id="GSASIIctrls.G2TreeCtrl.ConvertRelativePhaseNum"> |
---|
224 | <tt class="descname">ConvertRelativePhaseNum</tt><big>(</big><em>phasenum</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2TreeCtrl.ConvertRelativePhaseNum"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2TreeCtrl.ConvertRelativePhaseNum" title="Permalink to this definition">¶</a></dt> |
---|
225 | <dd><p>Converts relative phase number to a phase name in |
---|
226 | the current project</p> |
---|
227 | </dd></dl> |
---|
228 | |
---|
229 | <dl class="method"> |
---|
230 | <dt id="GSASIIctrls.G2TreeCtrl.GetRelativeHistNum"> |
---|
231 | <tt class="descname">GetRelativeHistNum</tt><big>(</big><em>histname</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2TreeCtrl.GetRelativeHistNum"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2TreeCtrl.GetRelativeHistNum" title="Permalink to this definition">¶</a></dt> |
---|
232 | <dd><p>Returns list with a histogram type and a relative number for that |
---|
233 | histogram, or the original string if not a histogram</p> |
---|
234 | </dd></dl> |
---|
235 | |
---|
236 | <dl class="method"> |
---|
237 | <dt id="GSASIIctrls.G2TreeCtrl.GetRelativePhaseNum"> |
---|
238 | <tt class="descname">GetRelativePhaseNum</tt><big>(</big><em>phasename</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2TreeCtrl.GetRelativePhaseNum"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2TreeCtrl.GetRelativePhaseNum" title="Permalink to this definition">¶</a></dt> |
---|
239 | <dd><p>Returns a phase number if the string matches a phase name |
---|
240 | or else returns the original string</p> |
---|
241 | </dd></dl> |
---|
242 | |
---|
243 | <dl class="method"> |
---|
244 | <dt id="GSASIIctrls.G2TreeCtrl.onSelectionChanged"> |
---|
245 | <tt class="descname">onSelectionChanged</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#G2TreeCtrl.onSelectionChanged"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.G2TreeCtrl.onSelectionChanged" title="Permalink to this definition">¶</a></dt> |
---|
246 | <dd><p>Log each press on a tree item here.</p> |
---|
247 | </dd></dl> |
---|
248 | |
---|
249 | </dd></dl> |
---|
250 | |
---|
251 | <dl class="function"> |
---|
252 | <dt id="GSASIIctrls.GetItemOrder"> |
---|
253 | <tt class="descclassname">GSASIIctrls.</tt><tt class="descname">GetItemOrder</tt><big>(</big><em>parent</em>, <em>keylist</em>, <em>vallookup</em>, <em>posdict</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#GetItemOrder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.GetItemOrder" title="Permalink to this definition">¶</a></dt> |
---|
254 | <dd><p>Creates a panel where items can be ordered into columns</p> |
---|
255 | <table class="docutils field-list" frame="void" rules="none"> |
---|
256 | <col class="field-name" /> |
---|
257 | <col class="field-body" /> |
---|
258 | <tbody valign="top"> |
---|
259 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
260 | <li><strong>keylist</strong> (<em>list</em>) – is a list of keys for column assignments</li> |
---|
261 | <li><strong>vallookup</strong> (<em>dict</em>) – is a dict keyed by names in keylist where each item is a dict. |
---|
262 | Each inner dict contains variable names as keys and their associated values</li> |
---|
263 | <li><strong>posdict</strong> (<em>dict</em>) – is a dict keyed by names in keylist where each item is a dict. |
---|
264 | Each inner dict contains column numbers as keys and their associated |
---|
265 | variable name as a value. This is used for both input and output.</li> |
---|
266 | </ul> |
---|
267 | </td> |
---|
268 | </tr> |
---|
269 | </tbody> |
---|
270 | </table> |
---|
271 | </dd></dl> |
---|
272 | |
---|
273 | <dl class="class"> |
---|
274 | <dt id="GSASIIctrls.HelpButton"> |
---|
275 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">HelpButton</tt><big>(</big><em>parent</em>, <em>msg</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#HelpButton"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.HelpButton" title="Permalink to this definition">¶</a></dt> |
---|
276 | <dd><p>Create a help button that displays help information. |
---|
277 | The text is displayed in a modal message window.</p> |
---|
278 | <p>TODO: it might be nice if it were non-modal: e.g. it stays around until |
---|
279 | the parent is deleted or the user closes it, but this did not work for |
---|
280 | me.</p> |
---|
281 | <table class="docutils field-list" frame="void" rules="none"> |
---|
282 | <col class="field-name" /> |
---|
283 | <col class="field-body" /> |
---|
284 | <tbody valign="top"> |
---|
285 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
286 | <li><strong>parent</strong> – the panel which will be the parent of the button</li> |
---|
287 | <li><strong>msg</strong> (<em>str</em>) – the help text to be displayed</li> |
---|
288 | </ul> |
---|
289 | </td> |
---|
290 | </tr> |
---|
291 | </tbody> |
---|
292 | </table> |
---|
293 | </dd></dl> |
---|
294 | |
---|
295 | <dl class="class"> |
---|
296 | <dt id="GSASIIctrls.MyHelp"> |
---|
297 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">MyHelp</tt><big>(</big><em>frame</em>, <em>helpType=None</em>, <em>helpLbl=None</em>, <em>morehelpitems=</em>, <span class="optional">[</span><span class="optional">]</span><em>title=''</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#MyHelp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.MyHelp" title="Permalink to this definition">¶</a></dt> |
---|
298 | <dd><p>A class that creates the contents of a help menu. |
---|
299 | The menu will start with two entries:</p> |
---|
300 | <ul class="simple"> |
---|
301 | <li>‘Help on <helpType>’: where helpType is a reference to an HTML page to |
---|
302 | be opened</li> |
---|
303 | <li>About: opens an About dialog using OnHelpAbout. N.B. on the Mac this |
---|
304 | gets moved to the App menu to be consistent with Apple style.</li> |
---|
305 | </ul> |
---|
306 | <p>NOTE: for this to work properly with respect to system menus, the title |
---|
307 | for the menu must be &Help, or it will not be processed properly:</p> |
---|
308 | <div class="highlight-python"><div class="highlight"><pre><span class="n">menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="n">menu</span><span class="o">=</span><span class="n">MyHelp</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="o">...</span><span class="p">),</span><span class="n">title</span><span class="o">=</span><span class="s">"&Help"</span><span class="p">)</span> |
---|
309 | </pre></div> |
---|
310 | </div> |
---|
311 | <dl class="method"> |
---|
312 | <dt id="GSASIIctrls.MyHelp.OnCheckUpdates"> |
---|
313 | <tt class="descname">OnCheckUpdates</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#MyHelp.OnCheckUpdates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.MyHelp.OnCheckUpdates" title="Permalink to this definition">¶</a></dt> |
---|
314 | <dd><p>Check if the GSAS-II repository has an update for the current source files |
---|
315 | and perform that update if requested.</p> |
---|
316 | </dd></dl> |
---|
317 | |
---|
318 | <dl class="method"> |
---|
319 | <dt id="GSASIIctrls.MyHelp.OnHelpAbout"> |
---|
320 | <tt class="descname">OnHelpAbout</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#MyHelp.OnHelpAbout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.MyHelp.OnHelpAbout" title="Permalink to this definition">¶</a></dt> |
---|
321 | <dd><p>Display an ‘About GSAS-II’ box</p> |
---|
322 | </dd></dl> |
---|
323 | |
---|
324 | <dl class="method"> |
---|
325 | <dt id="GSASIIctrls.MyHelp.OnHelpById"> |
---|
326 | <tt class="descname">OnHelpById</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#MyHelp.OnHelpById"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.MyHelp.OnHelpById" title="Permalink to this definition">¶</a></dt> |
---|
327 | <dd><p>Called when Help on... is pressed in a menu. Brings up |
---|
328 | a web page for documentation.</p> |
---|
329 | </dd></dl> |
---|
330 | |
---|
331 | <dl class="method"> |
---|
332 | <dt id="GSASIIctrls.MyHelp.OnSelectVersion"> |
---|
333 | <tt class="descname">OnSelectVersion</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#MyHelp.OnSelectVersion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.MyHelp.OnSelectVersion" title="Permalink to this definition">¶</a></dt> |
---|
334 | <dd><p>Allow the user to select a specific version of GSAS-II</p> |
---|
335 | </dd></dl> |
---|
336 | |
---|
337 | </dd></dl> |
---|
338 | |
---|
339 | <dl class="class"> |
---|
340 | <dt id="GSASIIctrls.MyHtmlPanel"> |
---|
341 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">MyHtmlPanel</tt><big>(</big><em>frame</em>, <em>id</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#MyHtmlPanel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.MyHtmlPanel" title="Permalink to this definition">¶</a></dt> |
---|
342 | <dd><p>Defines a panel to display HTML help information, as an alternative to |
---|
343 | displaying help information in a web browser.</p> |
---|
344 | </dd></dl> |
---|
345 | |
---|
346 | <dl class="class"> |
---|
347 | <dt id="GSASIIctrls.NumberValidator"> |
---|
348 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">NumberValidator</tt><big>(</big><em>typ</em>, <em>positiveonly=False</em>, <em>min=None</em>, <em>max=None</em>, <em>result=None</em>, <em>key=None</em>, <em>OKcontrol=None</em>, <em>CIFinput=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#NumberValidator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.NumberValidator" title="Permalink to this definition">¶</a></dt> |
---|
349 | <dd><p>A validator to be used with a TextCtrl to prevent |
---|
350 | entering characters other than digits, signs, and for float |
---|
351 | input, a period and exponents.</p> |
---|
352 | <dl class="docutils"> |
---|
353 | <dt>The value is checked for validity after every keystroke</dt> |
---|
354 | <dd>If an invalid number is entered, the box is highlighted. |
---|
355 | If the number is valid, it is saved in result[key]</dd> |
---|
356 | </dl> |
---|
357 | <table class="docutils field-list" frame="void" rules="none"> |
---|
358 | <col class="field-name" /> |
---|
359 | <col class="field-body" /> |
---|
360 | <tbody valign="top"> |
---|
361 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
362 | <li><strong>typ</strong> (<em>type</em>) – the base data type. Must be int or float.</li> |
---|
363 | <li><strong>positiveonly</strong> (<em>bool</em>) – If True, negative integers are not allowed |
---|
364 | (default False). This prevents the + or - keys from being pressed. |
---|
365 | Used with typ=int; ignored for typ=float.</li> |
---|
366 | <li><strong>min</strong> (<em>number</em>) – Minimum allowed value. If None (default) the |
---|
367 | lower limit is unbounded</li> |
---|
368 | <li><strong>max</strong> (<em>number</em>) – Maximum allowed value. If None (default) the |
---|
369 | upper limit is unbounded</li> |
---|
370 | <li><strong>result</strong> (<em>dict/list</em>) – List or dict where value should be placed when valid</li> |
---|
371 | <li><strong>key</strong> (<em>any</em>) – key to use for result (int for list)</li> |
---|
372 | <li><strong>OKcontrol</strong> (<em>function</em>) – function or class method to control |
---|
373 | an OK button for a window. |
---|
374 | Ignored if None (default)</li> |
---|
375 | <li><strong>CIFinput</strong> (<em>bool</em>) – allows use of a single ‘?’ or ‘.’ character |
---|
376 | as valid input.</li> |
---|
377 | </ul> |
---|
378 | </td> |
---|
379 | </tr> |
---|
380 | </tbody> |
---|
381 | </table> |
---|
382 | <dl class="method"> |
---|
383 | <dt id="GSASIIctrls.NumberValidator.CheckInput"> |
---|
384 | <tt class="descname">CheckInput</tt><big>(</big><em>previousInvalid</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#NumberValidator.CheckInput"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.NumberValidator.CheckInput" title="Permalink to this definition">¶</a></dt> |
---|
385 | <dd><p>called to test every change to the TextCtrl for validity and |
---|
386 | to change the appearance of the TextCtrl</p> |
---|
387 | <p>Anytime the input is invalid, call self.OKcontrol |
---|
388 | (if defined) because it is fast. |
---|
389 | If valid, check for any other invalid entries only when |
---|
390 | changing from invalid to valid, since that is slower.</p> |
---|
391 | <table class="docutils field-list" frame="void" rules="none"> |
---|
392 | <col class="field-name" /> |
---|
393 | <col class="field-body" /> |
---|
394 | <tbody valign="top"> |
---|
395 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>previousInvalid</strong> (<em>bool</em>) – True if the TextCtrl contents were |
---|
396 | invalid prior to the current change.</td> |
---|
397 | </tr> |
---|
398 | </tbody> |
---|
399 | </table> |
---|
400 | </dd></dl> |
---|
401 | |
---|
402 | <dl class="method"> |
---|
403 | <dt id="GSASIIctrls.NumberValidator.Clone"> |
---|
404 | <tt class="descname">Clone</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#NumberValidator.Clone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.NumberValidator.Clone" title="Permalink to this definition">¶</a></dt> |
---|
405 | <dd><p>Create a copy of the validator, a strange, but required component</p> |
---|
406 | </dd></dl> |
---|
407 | |
---|
408 | <dl class="method"> |
---|
409 | <dt id="GSASIIctrls.NumberValidator.OnChar"> |
---|
410 | <tt class="descname">OnChar</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#NumberValidator.OnChar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.NumberValidator.OnChar" title="Permalink to this definition">¶</a></dt> |
---|
411 | <dd><p>Called each type a key is pressed |
---|
412 | ignores keys that are not allowed for int and float types</p> |
---|
413 | </dd></dl> |
---|
414 | |
---|
415 | <dl class="method"> |
---|
416 | <dt id="GSASIIctrls.NumberValidator.ShowValidity"> |
---|
417 | <tt class="descname">ShowValidity</tt><big>(</big><em>tc</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#NumberValidator.ShowValidity"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.NumberValidator.ShowValidity" title="Permalink to this definition">¶</a></dt> |
---|
418 | <dd><p>Set the control colors to show invalid input</p> |
---|
419 | <table class="docutils field-list" frame="void" rules="none"> |
---|
420 | <col class="field-name" /> |
---|
421 | <col class="field-body" /> |
---|
422 | <tbody valign="top"> |
---|
423 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>tc</strong> (<em>wx.TextCtrl</em>) – A reference to the TextCtrl that the validator |
---|
424 | is associated with.</td> |
---|
425 | </tr> |
---|
426 | </tbody> |
---|
427 | </table> |
---|
428 | </dd></dl> |
---|
429 | |
---|
430 | <dl class="method"> |
---|
431 | <dt id="GSASIIctrls.NumberValidator.TestValid"> |
---|
432 | <tt class="descname">TestValid</tt><big>(</big><em>tc</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#NumberValidator.TestValid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.NumberValidator.TestValid" title="Permalink to this definition">¶</a></dt> |
---|
433 | <dd><p>Check if the value is valid by casting the input string |
---|
434 | into the current type.</p> |
---|
435 | <p>Set the invalid variable in the TextCtrl object accordingly.</p> |
---|
436 | <p>If the value is valid, save it in the dict/list where |
---|
437 | the initial value was stored, if appropriate.</p> |
---|
438 | <table class="docutils field-list" frame="void" rules="none"> |
---|
439 | <col class="field-name" /> |
---|
440 | <col class="field-body" /> |
---|
441 | <tbody valign="top"> |
---|
442 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>tc</strong> (<em>wx.TextCtrl</em>) – A reference to the TextCtrl that the validator |
---|
443 | is associated with.</td> |
---|
444 | </tr> |
---|
445 | </tbody> |
---|
446 | </table> |
---|
447 | </dd></dl> |
---|
448 | |
---|
449 | <dl class="method"> |
---|
450 | <dt id="GSASIIctrls.NumberValidator.TransferFromWindow"> |
---|
451 | <tt class="descname">TransferFromWindow</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#NumberValidator.TransferFromWindow"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.NumberValidator.TransferFromWindow" title="Permalink to this definition">¶</a></dt> |
---|
452 | <dd><p>Needed by validator, strange, but required component</p> |
---|
453 | </dd></dl> |
---|
454 | |
---|
455 | <dl class="method"> |
---|
456 | <dt id="GSASIIctrls.NumberValidator.TransferToWindow"> |
---|
457 | <tt class="descname">TransferToWindow</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#NumberValidator.TransferToWindow"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.NumberValidator.TransferToWindow" title="Permalink to this definition">¶</a></dt> |
---|
458 | <dd><p>Needed by validator, strange, but required component</p> |
---|
459 | </dd></dl> |
---|
460 | |
---|
461 | </dd></dl> |
---|
462 | |
---|
463 | <dl class="class"> |
---|
464 | <dt id="GSASIIctrls.OpenTutorial"> |
---|
465 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">OpenTutorial</tt><big>(</big><em>parent=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#OpenTutorial"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.OpenTutorial" title="Permalink to this definition">¶</a></dt> |
---|
466 | <dd><p>Open a tutorial, optionally copying it to the local disk. Always copy |
---|
467 | the data files locally.</p> |
---|
468 | <p>For now tutorials will always be copied into the source code tree, but it |
---|
469 | might be better to have an option to copy them somewhere else, for people |
---|
470 | who don’t have write access to the GSAS-II source code location.</p> |
---|
471 | <dl class="method"> |
---|
472 | <dt id="GSASIIctrls.OpenTutorial.LoadExercise"> |
---|
473 | <tt class="descname">LoadExercise</tt><big>(</big><em>tutorialname</em>, <em>fullpath='/Users/toby/software/G2/GSASII'</em>, <em>baseURL='https://subversion.xray.aps.anl.gov/pyGSAS'</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#OpenTutorial.LoadExercise"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.OpenTutorial.LoadExercise" title="Permalink to this definition">¶</a></dt> |
---|
474 | <dd><p>Load Exercise file(s) for a Tutorial to the selected location</p> |
---|
475 | </dd></dl> |
---|
476 | |
---|
477 | <dl class="method"> |
---|
478 | <dt id="GSASIIctrls.OpenTutorial.LoadTutorial"> |
---|
479 | <tt class="descname">LoadTutorial</tt><big>(</big><em>tutorialname</em>, <em>fullpath='/Users/toby/software/G2/GSASII'</em>, <em>baseURL='https://subversion.xray.aps.anl.gov/pyGSAS'</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#OpenTutorial.LoadTutorial"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.OpenTutorial.LoadTutorial" title="Permalink to this definition">¶</a></dt> |
---|
480 | <dd><p>Load a Tutorial to the selected location</p> |
---|
481 | </dd></dl> |
---|
482 | |
---|
483 | <dl class="method"> |
---|
484 | <dt id="GSASIIctrls.OpenTutorial.OnModeSelect"> |
---|
485 | <tt class="descname">OnModeSelect</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#OpenTutorial.OnModeSelect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.OpenTutorial.OnModeSelect" title="Permalink to this definition">¶</a></dt> |
---|
486 | <dd><p>Respond when the mode is changed</p> |
---|
487 | </dd></dl> |
---|
488 | |
---|
489 | <dl class="method"> |
---|
490 | <dt id="GSASIIctrls.OpenTutorial.OnTutorialSelected"> |
---|
491 | <tt class="descname">OnTutorialSelected</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#OpenTutorial.OnTutorialSelected"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.OpenTutorial.OnTutorialSelected" title="Permalink to this definition">¶</a></dt> |
---|
492 | <dd><p>Respond when a tutorial is selected. Load tutorials and data locally, |
---|
493 | as needed and then display the page</p> |
---|
494 | </dd></dl> |
---|
495 | |
---|
496 | <dl class="method"> |
---|
497 | <dt id="GSASIIctrls.OpenTutorial.SelectDownloadLoc"> |
---|
498 | <tt class="descname">SelectDownloadLoc</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#OpenTutorial.SelectDownloadLoc"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.OpenTutorial.SelectDownloadLoc" title="Permalink to this definition">¶</a></dt> |
---|
499 | <dd><p>Select a download location, |
---|
500 | Cancel resets to the default</p> |
---|
501 | </dd></dl> |
---|
502 | |
---|
503 | <dl class="method"> |
---|
504 | <dt id="GSASIIctrls.OpenTutorial.ValidateTutorialDir"> |
---|
505 | <tt class="descname">ValidateTutorialDir</tt><big>(</big><em>fullpath='/Users/toby/software/G2/GSASII'</em>, <em>baseURL='https://subversion.xray.aps.anl.gov/pyGSAS'</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#OpenTutorial.ValidateTutorialDir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.OpenTutorial.ValidateTutorialDir" title="Permalink to this definition">¶</a></dt> |
---|
506 | <dd><p>Load help to new directory or make sure existing directory looks correctly set up |
---|
507 | throws an exception if there is a problem.</p> |
---|
508 | </dd></dl> |
---|
509 | |
---|
510 | </dd></dl> |
---|
511 | |
---|
512 | <dl class="class"> |
---|
513 | <dt id="GSASIIctrls.OrderBox"> |
---|
514 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">OrderBox</tt><big>(</big><em>parent</em>, <em>keylist</em>, <em>vallookup</em>, <em>posdict</em>, <em>*arg</em>, <em>**kw</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#OrderBox"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.OrderBox" title="Permalink to this definition">¶</a></dt> |
---|
515 | <dd><p>Creates a panel with scrollbars where items can be ordered into columns</p> |
---|
516 | <table class="docutils field-list" frame="void" rules="none"> |
---|
517 | <col class="field-name" /> |
---|
518 | <col class="field-body" /> |
---|
519 | <tbody valign="top"> |
---|
520 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
521 | <li><strong>keylist</strong> (<em>list</em>) – is a list of keys for column assignments</li> |
---|
522 | <li><strong>vallookup</strong> (<em>dict</em>) – is a dict keyed by names in keylist where each item is a dict. |
---|
523 | Each inner dict contains variable names as keys and their associated values</li> |
---|
524 | <li><strong>posdict</strong> (<em>dict</em>) – is a dict keyed by names in keylist where each item is a dict. |
---|
525 | Each inner dict contains column numbers as keys and their associated |
---|
526 | variable name as a value. This is used for both input and output.</li> |
---|
527 | </ul> |
---|
528 | </td> |
---|
529 | </tr> |
---|
530 | </tbody> |
---|
531 | </table> |
---|
532 | <dl class="method"> |
---|
533 | <dt id="GSASIIctrls.OrderBox.OnChoice"> |
---|
534 | <tt class="descname">OnChoice</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#OrderBox.OnChoice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.OrderBox.OnChoice" title="Permalink to this definition">¶</a></dt> |
---|
535 | <dd><p>Called when a column is assigned to a variable</p> |
---|
536 | </dd></dl> |
---|
537 | |
---|
538 | </dd></dl> |
---|
539 | |
---|
540 | <dl class="class"> |
---|
541 | <dt id="GSASIIctrls.PickTwoDialog"> |
---|
542 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">PickTwoDialog</tt><big>(</big><em>parent</em>, <em>title</em>, <em>prompt</em>, <em>names</em>, <em>choices</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#PickTwoDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.PickTwoDialog" title="Permalink to this definition">¶</a></dt> |
---|
543 | <dd><p>This does not seem to be in use</p> |
---|
544 | </dd></dl> |
---|
545 | |
---|
546 | <dl class="class"> |
---|
547 | <dt id="GSASIIctrls.ScrolledMultiEditor"> |
---|
548 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">ScrolledMultiEditor</tt><big>(</big><em>parent</em>, <em>dictlst</em>, <em>elemlst</em>, <em>prelbl=</em>, <span class="optional">[</span><span class="optional">]</span><em>postlbl=</em>, <span class="optional">[</span><span class="optional">]</span><em>title='Edit items'</em>, <em>header=''</em>, <em>size=(300</em>, <em>250)</em>, <em>CopyButton=False</em>, <em>minvals=</em>, <span class="optional">[</span><span class="optional">]</span><em>maxvals=</em>, <span class="optional">[</span><span class="optional">]</span><em>sizevals=</em>, <span class="optional">[</span><span class="optional">]</span><em>checkdictlst=</em>, <span class="optional">[</span><span class="optional">]</span><em>checkelemlst=</em>, <span class="optional">[</span><span class="optional">]</span><em>checklabel=''</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ScrolledMultiEditor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ScrolledMultiEditor" title="Permalink to this definition">¶</a></dt> |
---|
549 | <dd><p>Define a window for editing a potentially large number of dict- or |
---|
550 | list-contained values with validation for each item. Edited values are |
---|
551 | automatically placed in their source location. If invalid entries |
---|
552 | are provided, the TextCtrl is turned yellow and the OK button is disabled.</p> |
---|
553 | <p>The type for each TextCtrl validation is determined by the |
---|
554 | initial value of the entry (int, float or string). |
---|
555 | Float values can be entered in the TextCtrl as numbers or also |
---|
556 | as algebraic expressions using operators + - / * () and **, |
---|
557 | in addition pi, sind(), cosd(), tand(), and sqrt() can be used, |
---|
558 | as well as appreviations s(), sin(), c(), cos(), t(), tan() and sq().</p> |
---|
559 | <table class="docutils field-list" frame="void" rules="none"> |
---|
560 | <col class="field-name" /> |
---|
561 | <col class="field-body" /> |
---|
562 | <tbody valign="top"> |
---|
563 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
564 | <li><strong>parent</strong> (<em>wx.Frame</em>) – name of parent window, or may be None</li> |
---|
565 | <li><strong>dictlst</strong> (<em>tuple</em>) – a list of dicts or lists containing values to edit</li> |
---|
566 | <li><strong>elemlst</strong> (<em>tuple</em>) – a list of keys for each item in a dictlst. Must have the |
---|
567 | same length as dictlst.</li> |
---|
568 | <li><strong>parent</strong> – name of parent window, or may be None</li> |
---|
569 | <li><strong>prelbl</strong> (<em>tuple</em>) – a list of labels placed before the TextCtrl for each |
---|
570 | item (optional)</li> |
---|
571 | <li><strong>postlbl</strong> (<em>tuple</em>) – a list of labels placed after the TextCtrl for each |
---|
572 | item (optional)</li> |
---|
573 | <li><strong>title</strong> (<em>str</em>) – a title to place in the frame of the dialog</li> |
---|
574 | <li><strong>header</strong> (<em>str</em>) – text to place at the top of the window. May contain |
---|
575 | new line characters.</li> |
---|
576 | <li><strong>size</strong> (<em>wx.Size</em>) – a size parameter that dictates the |
---|
577 | size for the scrolled region of the dialog. The default is |
---|
578 | (300,250).</li> |
---|
579 | <li><strong>CopyButton</strong> (<em>bool</em>) – if True adds a small button that copies the |
---|
580 | value for the current row to all fields below (default is False)</li> |
---|
581 | <li><strong>minvals</strong> (<em>list</em>) – optional list of minimum values for validation |
---|
582 | of float or int values. Ignored if value is None.</li> |
---|
583 | <li><strong>maxvals</strong> (<em>list</em>) – optional list of maximum values for validation |
---|
584 | of float or int values. Ignored if value is None.</li> |
---|
585 | <li><strong>sizevals</strong> (<em>list</em>) – optional list of wx.Size values for each input |
---|
586 | widget. Ignored if value is None.</li> |
---|
587 | <li><strong>checkdictlst</strong> (<em>tuple</em>) – an optional list of dicts or lists containing bool |
---|
588 | values (similar to dictlst).</li> |
---|
589 | <li><strong>checkelemlst</strong> (<em>tuple</em>) – an optional list of dicts or lists containing bool |
---|
590 | key values (similar to elemlst). Must be used with checkdictlst.</li> |
---|
591 | <li><strong>checklabel</strong> (<em>string</em>) – a string to use for each checkbutton</li> |
---|
592 | </ul> |
---|
593 | </td> |
---|
594 | </tr> |
---|
595 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the wx.Dialog created here. Use method .ShowModal() to display it.</p> |
---|
596 | </td> |
---|
597 | </tr> |
---|
598 | </tbody> |
---|
599 | </table> |
---|
600 | <p><em>Example for use of ScrolledMultiEditor:</em></p> |
---|
601 | <div class="highlight-python"><div class="highlight"><pre>dlg = <pkg>.ScrolledMultiEditor(frame,dictlst,elemlst,prelbl,postlbl, |
---|
602 | header=header) |
---|
603 | if dlg.ShowModal() == wx.ID_OK: |
---|
604 | for d,k in zip(dictlst,elemlst): |
---|
605 | print d[k] |
---|
606 | </pre></div> |
---|
607 | </div> |
---|
608 | <p><em>Example definitions for dictlst and elemlst:</em></p> |
---|
609 | <div class="highlight-python"><div class="highlight"><pre> dictlst = (dict1,list1,dict1,list1) |
---|
610 | elemlst = ('a', 1, 2, 3) |
---|
611 | |
---|
612 | This causes items dict1['a'], list1[1], dict1[2] and list1[3] to be edited. |
---|
613 | </pre></div> |
---|
614 | </div> |
---|
615 | <p>Note that these items must have int, float or str values assigned to |
---|
616 | them. The dialog will force these types to be retained. String values |
---|
617 | that are blank are marked as invalid.</p> |
---|
618 | <dl class="method"> |
---|
619 | <dt id="GSASIIctrls.ScrolledMultiEditor.ControlOKButton"> |
---|
620 | <tt class="descname">ControlOKButton</tt><big>(</big><em>setvalue</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ScrolledMultiEditor.ControlOKButton"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ScrolledMultiEditor.ControlOKButton" title="Permalink to this definition">¶</a></dt> |
---|
621 | <dd><p>Enable or Disable the OK button for the dialog. Note that this is |
---|
622 | passed into the ValidatedTxtCtrl for use by validators.</p> |
---|
623 | <table class="docutils field-list" frame="void" rules="none"> |
---|
624 | <col class="field-name" /> |
---|
625 | <col class="field-body" /> |
---|
626 | <tbody valign="top"> |
---|
627 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>setvalue</strong> (<em>bool</em>) – if True, all entries in the dialog are |
---|
628 | checked for validity. if False then the OK button is disabled.</td> |
---|
629 | </tr> |
---|
630 | </tbody> |
---|
631 | </table> |
---|
632 | </dd></dl> |
---|
633 | |
---|
634 | </dd></dl> |
---|
635 | |
---|
636 | <dl class="function"> |
---|
637 | <dt id="GSASIIctrls.SelectEdit1Var"> |
---|
638 | <tt class="descclassname">GSASIIctrls.</tt><tt class="descname">SelectEdit1Var</tt><big>(</big><em>G2frame</em>, <em>array</em>, <em>labelLst</em>, <em>elemKeysLst</em>, <em>dspLst</em>, <em>refFlgElem</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#SelectEdit1Var"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.SelectEdit1Var" title="Permalink to this definition">¶</a></dt> |
---|
639 | <dd><p>Select a variable from a list, then edit it and select histograms |
---|
640 | to copy it to.</p> |
---|
641 | <table class="docutils field-list" frame="void" rules="none"> |
---|
642 | <col class="field-name" /> |
---|
643 | <col class="field-body" /> |
---|
644 | <tbody valign="top"> |
---|
645 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
646 | <li><strong>G2frame</strong> (<em>wx.Frame</em>) – main GSAS-II frame</li> |
---|
647 | <li><strong>array</strong> (<em>dict</em>) – the array (dict or list) where values to be edited are kept</li> |
---|
648 | <li><strong>labelLst</strong> (<em>list</em>) – labels for each data item</li> |
---|
649 | <li><strong>elemKeysLst</strong> (<em>list</em>) – a list of lists of keys needed to be applied (see below) |
---|
650 | to obtain the value of each parameter</li> |
---|
651 | <li><strong>dspLst</strong> (<em>list</em>) – list list of digits to be displayed (10,4) is 10 digits |
---|
652 | with 4 decimal places. Can be None.</li> |
---|
653 | <li><strong>refFlgElem</strong> (<em>list</em>) – a list of lists of keys needed to be applied (see below) |
---|
654 | to obtain the refine flag for each parameter or None if the parameter |
---|
655 | does not have refine flag.</li> |
---|
656 | </ul> |
---|
657 | </td> |
---|
658 | </tr> |
---|
659 | </tbody> |
---|
660 | </table> |
---|
661 | <dl class="docutils"> |
---|
662 | <dt>Example::</dt> |
---|
663 | <dd><blockquote class="first"> |
---|
664 | <div>array = data |
---|
665 | labelLst = [‘v1’,’v2’] |
---|
666 | elemKeysLst = [[‘v1’], [‘v2’,0]] |
---|
667 | refFlgElem = [None, [‘v2’,1]]</div></blockquote> |
---|
668 | <ul class="last simple"> |
---|
669 | <li>The value for v1 will be in data[‘v1’] and this cannot be refined while,</li> |
---|
670 | <li>The value for v2 will be in data[‘v2’][0] and its refinement flag is data[‘v2’][1]</li> |
---|
671 | </ul> |
---|
672 | </dd> |
---|
673 | </dl> |
---|
674 | </dd></dl> |
---|
675 | |
---|
676 | <dl class="function"> |
---|
677 | <dt id="GSASIIctrls.ShowHelp"> |
---|
678 | <tt class="descclassname">GSASIIctrls.</tt><tt class="descname">ShowHelp</tt><big>(</big><em>helpType</em>, <em>frame</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ShowHelp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ShowHelp" title="Permalink to this definition">¶</a></dt> |
---|
679 | <dd><p>Called to bring up a web page for documentation.</p> |
---|
680 | </dd></dl> |
---|
681 | |
---|
682 | <dl class="function"> |
---|
683 | <dt id="GSASIIctrls.ShowWebPage"> |
---|
684 | <tt class="descclassname">GSASIIctrls.</tt><tt class="descname">ShowWebPage</tt><big>(</big><em>URL</em>, <em>frame</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ShowWebPage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ShowWebPage" title="Permalink to this definition">¶</a></dt> |
---|
685 | <dd><p>Called to show a tutorial web page.</p> |
---|
686 | </dd></dl> |
---|
687 | |
---|
688 | <dl class="function"> |
---|
689 | <dt id="GSASIIctrls.StripIndents"> |
---|
690 | <tt class="descclassname">GSASIIctrls.</tt><tt class="descname">StripIndents</tt><big>(</big><em>msg</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#StripIndents"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.StripIndents" title="Permalink to this definition">¶</a></dt> |
---|
691 | <dd><p>Strip indentation from multiline strings</p> |
---|
692 | </dd></dl> |
---|
693 | |
---|
694 | <dl class="class"> |
---|
695 | <dt id="GSASIIctrls.ValidatedTxtCtrl"> |
---|
696 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">ValidatedTxtCtrl</tt><big>(</big><em>parent</em>, <em>loc</em>, <em>key</em>, <em>nDig=None</em>, <em>notBlank=True</em>, <em>min=None</em>, <em>max=None</em>, <em>OKcontrol=None</em>, <em>OnLeave=None</em>, <em>typeHint=None</em>, <em>CIFinput=False</em>, <em>OnLeaveArgs={}</em>, <em>**kw</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ValidatedTxtCtrl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ValidatedTxtCtrl" title="Permalink to this definition">¶</a></dt> |
---|
697 | <dd><p>Create a TextCtrl widget that uses a validator to prevent the |
---|
698 | entry of inappropriate characters and changes color to highlight |
---|
699 | when invalid input is supplied. As valid values are typed, |
---|
700 | they are placed into the dict or list where the initial value |
---|
701 | came from. The type of the initial value must be int, |
---|
702 | float or str or None (see <tt class="xref py py-obj docutils literal"><span class="pre">key</span></tt> and <tt class="xref py py-obj docutils literal"><span class="pre">typeHint</span></tt>); |
---|
703 | this type (or the one in <tt class="xref py py-obj docutils literal"><span class="pre">typeHint</span></tt>) is preserved.</p> |
---|
704 | <p>Float values can be entered in the TextCtrl as numbers or also |
---|
705 | as algebraic expressions using operators + - / * () and **, |
---|
706 | in addition pi, sind(), cosd(), tand(), and sqrt() can be used, |
---|
707 | as well as appreviations s, sin, c, cos, t, tan and sq.</p> |
---|
708 | <table class="docutils field-list" frame="void" rules="none"> |
---|
709 | <col class="field-name" /> |
---|
710 | <col class="field-body" /> |
---|
711 | <tbody valign="top"> |
---|
712 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
713 | <li><strong>parent</strong> (<em>wx.Panel</em>) – name of panel or frame that will be |
---|
714 | the parent to the TextCtrl. Can be None.</li> |
---|
715 | <li><strong>loc</strong> (<em>dict/list</em>) – the dict or list with the initial value to be |
---|
716 | placed in the TextCtrl.</li> |
---|
717 | <li><strong>key</strong> (<em>int/str</em>) – the dict key or the list index for the value to be |
---|
718 | edited by the TextCtrl. The <tt class="docutils literal"><span class="pre">loc[key]</span></tt> element must exist, but may |
---|
719 | have value None. If None, the type for the element is taken from |
---|
720 | <tt class="xref py py-obj docutils literal"><span class="pre">typeHint</span></tt> and the value for the control is set initially |
---|
721 | blank (and thus invalid.) This is a way to specify a field without a |
---|
722 | default value: a user must set a valid value. |
---|
723 | If the value is not None, it must have a base |
---|
724 | type of int, float, str or unicode; the TextCrtl will be initialized |
---|
725 | from this value.</li> |
---|
726 | <li><strong>nDig</strong> (<em>list</em>) – number of digits & places ([nDig,nPlc]) after decimal to use |
---|
727 | for display of float. Alternately, None can be specified which causes |
---|
728 | numbers to be displayed with approximately 5 significant figures |
---|
729 | (Default=None).</li> |
---|
730 | <li><strong>notBlank</strong> (<em>bool</em>) – if True (default) blank values are invalid |
---|
731 | for str inputs.</li> |
---|
732 | <li><strong>min</strong> (<em>number</em>) – minimum allowed valid value. If None (default) the |
---|
733 | lower limit is unbounded.</li> |
---|
734 | <li><strong>max</strong> (<em>number</em>) – maximum allowed valid value. If None (default) the |
---|
735 | upper limit is unbounded</li> |
---|
736 | <li><strong>OKcontrol</strong> (<em>function</em>) – specifies a function or method that will be |
---|
737 | called when the input is validated. The called function is supplied |
---|
738 | with one argument which is False if the TextCtrl contains an invalid |
---|
739 | value and True if the value is valid. |
---|
740 | Note that this function should check all values |
---|
741 | in the dialog when True, since other entries might be invalid. |
---|
742 | The default for this is None, which indicates no function should |
---|
743 | be called.</li> |
---|
744 | <li><strong>OnLeave</strong> (<em>function</em>) – <p>specifies a function or method that will be |
---|
745 | called when the focus for the control is lost. |
---|
746 | The called function is supplied with (at present) three keyword arguments:</p> |
---|
747 | <blockquote> |
---|
748 | <div><ul> |
---|
749 | <li>invalid: (<em>bool</em>) True if the value for the TextCtrl is invalid</li> |
---|
750 | <li>value: (<em>int/float/str</em>) the value contained in the TextCtrl</li> |
---|
751 | <li>tc: (<em>wx.TextCtrl</em>) the TextCtrl name</li> |
---|
752 | </ul> |
---|
753 | </div></blockquote> |
---|
754 | <p>The number of keyword arguments may be increased in the future should needs arise, |
---|
755 | so it is best to code these functions with a **kwargs argument so they will |
---|
756 | continue to run without errors</p> |
---|
757 | <p>The default for OnLeave is None, which indicates no function should |
---|
758 | be called.</p> |
---|
759 | </li> |
---|
760 | <li><strong>typeHint</strong> (<em>type</em>) – the value of typeHint is overrides the initial value |
---|
761 | for the dict/list element <tt class="docutils literal"><span class="pre">loc[key]</span></tt>, if set to |
---|
762 | int or float, which specifies the type for input to the TextCtrl. |
---|
763 | Defaults as None, which is ignored.</li> |
---|
764 | <li><strong>CIFinput</strong> (<em>bool</em>) – for str input, indicates that only printable |
---|
765 | ASCII characters may be entered into the TextCtrl. Forces output |
---|
766 | to be ASCII rather than Unicode. For float and int input, allows |
---|
767 | use of a single ‘?’ or ‘.’ character as valid input.</li> |
---|
768 | <li><strong>OnLeaveArgs</strong> (<em>dict</em>) – a dict with keyword args that are passed to |
---|
769 | the <tt class="xref py py-attr docutils literal"><span class="pre">OnLeave</span></tt> function. Defaults to <tt class="docutils literal"><span class="pre">{}</span></tt></li> |
---|
770 | <li><strong>(other)</strong> – other optional keyword parameters for the |
---|
771 | wx.TextCtrl widget such as size or style may be specified.</li> |
---|
772 | </ul> |
---|
773 | </td> |
---|
774 | </tr> |
---|
775 | </tbody> |
---|
776 | </table> |
---|
777 | <dl class="method"> |
---|
778 | <dt id="GSASIIctrls.ValidatedTxtCtrl.EvaluateExpression"> |
---|
779 | <tt class="descname">EvaluateExpression</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ValidatedTxtCtrl.EvaluateExpression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ValidatedTxtCtrl.EvaluateExpression" title="Permalink to this definition">¶</a></dt> |
---|
780 | <dd><p>Show the computed value when an expression is entered to the TextCtrl |
---|
781 | Make sure that the number fits by truncating decimal places and switching |
---|
782 | to scientific notation, as needed. |
---|
783 | Called on loss of focus, enter, etc..</p> |
---|
784 | </dd></dl> |
---|
785 | |
---|
786 | <dl class="method"> |
---|
787 | <dt id="GSASIIctrls.ValidatedTxtCtrl.OnKeyDown"> |
---|
788 | <tt class="descname">OnKeyDown</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ValidatedTxtCtrl.OnKeyDown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ValidatedTxtCtrl.OnKeyDown" title="Permalink to this definition">¶</a></dt> |
---|
789 | <dd><p>Special callback for wx 2.9+ on Mac where backspace is not processed by validator</p> |
---|
790 | </dd></dl> |
---|
791 | |
---|
792 | <dl class="method"> |
---|
793 | <dt id="GSASIIctrls.ValidatedTxtCtrl.ShowStringValidity"> |
---|
794 | <tt class="descname">ShowStringValidity</tt><big>(</big><em>previousInvalid=True</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#ValidatedTxtCtrl.ShowStringValidity"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.ValidatedTxtCtrl.ShowStringValidity" title="Permalink to this definition">¶</a></dt> |
---|
795 | <dd><p>Check if input is valid. Anytime the input is |
---|
796 | invalid, call self.OKcontrol (if defined) because it is fast. |
---|
797 | If valid, check for any other invalid entries only when |
---|
798 | changing from invalid to valid, since that is slower.</p> |
---|
799 | <table class="docutils field-list" frame="void" rules="none"> |
---|
800 | <col class="field-name" /> |
---|
801 | <col class="field-body" /> |
---|
802 | <tbody valign="top"> |
---|
803 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>previousInvalid</strong> (<em>bool</em>) – True if the TextCtrl contents were |
---|
804 | invalid prior to the current change.</td> |
---|
805 | </tr> |
---|
806 | </tbody> |
---|
807 | </table> |
---|
808 | </dd></dl> |
---|
809 | |
---|
810 | </dd></dl> |
---|
811 | |
---|
812 | <dl class="class"> |
---|
813 | <dt id="GSASIIctrls.downdate"> |
---|
814 | <em class="property">class </em><tt class="descclassname">GSASIIctrls.</tt><tt class="descname">downdate</tt><big>(</big><em>parent=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#downdate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.downdate" title="Permalink to this definition">¶</a></dt> |
---|
815 | <dd><p>Dialog to allow a user to select a version of GSAS-II to install</p> |
---|
816 | <dl class="method"> |
---|
817 | <dt id="GSASIIctrls.downdate.getVersion"> |
---|
818 | <tt class="descname">getVersion</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIctrls.html#downdate.getVersion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIctrls.downdate.getVersion" title="Permalink to this definition">¶</a></dt> |
---|
819 | <dd><p>Get the version number in the dialog</p> |
---|
820 | </dd></dl> |
---|
821 | |
---|
822 | </dd></dl> |
---|
823 | |
---|
824 | </div> |
---|
825 | <span class="target" id="module-GSASIIgrid"></span><div class="section" id="gsasiigrid-basic-gui-routines"> |
---|
826 | <h2><em>GSASIIgrid: Basic GUI routines</em><a class="headerlink" href="#gsasiigrid-basic-gui-routines" title="Permalink to this headline">¶</a></h2> |
---|
827 | <p>Note that a number of routines here should be moved to GSASIIctrls eventually, such as |
---|
828 | G2LoggedButton, EnumSelector, G2ChoiceButton, SingleFloatDialog, SingleStringDialog, |
---|
829 | MultiStringDialog, G2MultiChoiceDialog, G2SingleChoiceDialog, G2ColumnIDDialog, ItemSelector, GridFractionEditor</p> |
---|
830 | <p>Probably SGMessageBox, SymOpDialog, DisAglDialog, too.</p> |
---|
831 | <dl class="class"> |
---|
832 | <dt id="GSASIIgrid.DataFrame"> |
---|
833 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">DataFrame</tt><big>(</big><em>parent</em>, <em>frame</em>, <em>data=None</em>, <em>name=None</em>, <em>size=None</em>, <em>pos=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#DataFrame"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.DataFrame" title="Permalink to this definition">¶</a></dt> |
---|
834 | <dd><p>Create the data item window and all the entries in menus used in |
---|
835 | that window. For Linux and windows, the menu entries are created for the |
---|
836 | current data item window, but in the Mac the menu is accessed from all |
---|
837 | windows. This means that a different menu is posted depending on which |
---|
838 | data item is posted. On the Mac, all the menus contain the data tree menu |
---|
839 | items, but additional menus are added specific to the data item.</p> |
---|
840 | <p>Note that while the menus are created here, |
---|
841 | the binding for the menus is done later in various GSASII*GUI modules, |
---|
842 | where the functions to be called are defined.</p> |
---|
843 | <dl class="method"> |
---|
844 | <dt id="GSASIIgrid.DataFrame.Bind"> |
---|
845 | <tt class="descname">Bind</tt><big>(</big><em>eventtype</em>, <em>handler</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#DataFrame.Bind"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.DataFrame.Bind" title="Permalink to this definition">¶</a></dt> |
---|
846 | <dd><p>Override the Bind() function: on the Mac the binding is to |
---|
847 | the main window, so that menus operate with any window on top. |
---|
848 | For other platforms, either wrap calls that will be logged |
---|
849 | or call the default wx.Frame Bind() to bind to the menu item directly.</p> |
---|
850 | <p>Note that bindings can be made to objects by Id or by direct reference to the |
---|
851 | object. As a convention, when bindings are to objects, they are not logged |
---|
852 | but when bindings are by Id, they are logged.</p> |
---|
853 | </dd></dl> |
---|
854 | |
---|
855 | <dl class="method"> |
---|
856 | <dt id="GSASIIgrid.DataFrame.PostfillDataMenu"> |
---|
857 | <tt class="descname">PostfillDataMenu</tt><big>(</big><em>empty=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#DataFrame.PostfillDataMenu"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.DataFrame.PostfillDataMenu" title="Permalink to this definition">¶</a></dt> |
---|
858 | <dd><p>Create the “standard” part of data frame menus. Note that on Linux and |
---|
859 | Windows, this is the standard help Menu. On Mac, this menu duplicates the |
---|
860 | tree menu, but adds an extra help command for the data item and a separator.</p> |
---|
861 | </dd></dl> |
---|
862 | |
---|
863 | <dl class="method"> |
---|
864 | <dt id="GSASIIgrid.DataFrame.PrefillDataMenu"> |
---|
865 | <tt class="descname">PrefillDataMenu</tt><big>(</big><em>menu</em>, <em>helpType</em>, <em>helpLbl=None</em>, <em>empty=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#DataFrame.PrefillDataMenu"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.DataFrame.PrefillDataMenu" title="Permalink to this definition">¶</a></dt> |
---|
866 | <dd><p>Create the “standard” part of data frame menus. Note that on Linux and |
---|
867 | Windows nothing happens here. On Mac, this menu duplicates the |
---|
868 | tree menu, but adds an extra help command for the data item and a separator.</p> |
---|
869 | </dd></dl> |
---|
870 | |
---|
871 | </dd></dl> |
---|
872 | |
---|
873 | <dl class="class"> |
---|
874 | <dt id="GSASIIgrid.DisAglDialog"> |
---|
875 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">DisAglDialog</tt><big>(</big><em>parent</em>, <em>data</em>, <em>default</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#DisAglDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.DisAglDialog" title="Permalink to this definition">¶</a></dt> |
---|
876 | <dd><p>Distance/Angle Controls input dialog. After |
---|
877 | <tt class="xref py py-meth docutils literal"><span class="pre">ShowModal()</span></tt> returns, the results are found in |
---|
878 | dict <tt class="xref py py-attr docutils literal"><span class="pre">self.data</span></tt>, which is accessed using <a class="reference internal" href="#GSASIIgrid.DisAglDialog.GetData" title="GSASIIgrid.DisAglDialog.GetData"><tt class="xref py py-meth docutils literal"><span class="pre">GetData()</span></tt></a>.</p> |
---|
879 | <table class="docutils field-list" frame="void" rules="none"> |
---|
880 | <col class="field-name" /> |
---|
881 | <col class="field-body" /> |
---|
882 | <tbody valign="top"> |
---|
883 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
884 | <li><strong>parent</strong> (<em>wx.Frame</em>) – reference to parent frame (or None)</li> |
---|
885 | <li><strong>data</strong> (<em>dict</em>) – a dict containing the current |
---|
886 | search ranges or an empty dict, which causes default values |
---|
887 | to be used. |
---|
888 | Will be used to set element <cite>DisAglCtls</cite> in |
---|
889 | <a class="reference internal" href="GSASIIobj.html#phase-table"><em>Phase Tree Item</em></a></li> |
---|
890 | <li><strong>default</strong> (<em>dict</em>) – A dict containing the default |
---|
891 | search ranges for each element.</li> |
---|
892 | </ul> |
---|
893 | </td> |
---|
894 | </tr> |
---|
895 | </tbody> |
---|
896 | </table> |
---|
897 | <dl class="method"> |
---|
898 | <dt id="GSASIIgrid.DisAglDialog.Draw"> |
---|
899 | <tt class="descname">Draw</tt><big>(</big><em>data</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#DisAglDialog.Draw"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.DisAglDialog.Draw" title="Permalink to this definition">¶</a></dt> |
---|
900 | <dd><p>Creates the contents of the dialog. Normally called |
---|
901 | by <tt class="xref py py-meth docutils literal"><span class="pre">__init__()</span></tt>.</p> |
---|
902 | </dd></dl> |
---|
903 | |
---|
904 | <dl class="method"> |
---|
905 | <dt id="GSASIIgrid.DisAglDialog.GetData"> |
---|
906 | <tt class="descname">GetData</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#DisAglDialog.GetData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.DisAglDialog.GetData" title="Permalink to this definition">¶</a></dt> |
---|
907 | <dd><p>Returns the values from the dialog</p> |
---|
908 | </dd></dl> |
---|
909 | |
---|
910 | <dl class="method"> |
---|
911 | <dt id="GSASIIgrid.DisAglDialog.OnOk"> |
---|
912 | <tt class="descname">OnOk</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#DisAglDialog.OnOk"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.DisAglDialog.OnOk" title="Permalink to this definition">¶</a></dt> |
---|
913 | <dd><p>Called when the OK button is pressed</p> |
---|
914 | </dd></dl> |
---|
915 | |
---|
916 | <dl class="method"> |
---|
917 | <dt id="GSASIIgrid.DisAglDialog.OnReset"> |
---|
918 | <tt class="descname">OnReset</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#DisAglDialog.OnReset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.DisAglDialog.OnReset" title="Permalink to this definition">¶</a></dt> |
---|
919 | <dd><p>Called when the Reset button is pressed</p> |
---|
920 | </dd></dl> |
---|
921 | |
---|
922 | </dd></dl> |
---|
923 | |
---|
924 | <dl class="class"> |
---|
925 | <dt id="GSASIIgrid.EnumSelector"> |
---|
926 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">EnumSelector</tt><big>(</big><em>parent</em>, <em>dct</em>, <em>item</em>, <em>choices</em>, <em>values=None</em>, <em>**kw</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#EnumSelector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.EnumSelector" title="Permalink to this definition">¶</a></dt> |
---|
927 | <dd><p>A customized <tt class="xref py py-class docutils literal"><span class="pre">wxpython.ComboBox</span></tt> that selects items from a list |
---|
928 | of choices, but sets a dict (list) entry to the corresponding |
---|
929 | entry from the input list of values.</p> |
---|
930 | <table class="docutils field-list" frame="void" rules="none"> |
---|
931 | <col class="field-name" /> |
---|
932 | <col class="field-body" /> |
---|
933 | <tbody valign="top"> |
---|
934 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
935 | <li><strong>parent</strong> (<em>wx.Panel</em>) – the parent to the <tt class="xref py py-class docutils literal"><span class="pre">ComboBox</span></tt> (usually a |
---|
936 | frame or panel)</li> |
---|
937 | <li><strong>dct</strong> (<em>dict</em>) – a dict (or list) to contain the value set |
---|
938 | for the <tt class="xref py py-class docutils literal"><span class="pre">ComboBox</span></tt>.</li> |
---|
939 | <li><strong>item</strong> – the dict key (or list index) where <tt class="docutils literal"><span class="pre">dct[item]</span></tt> will |
---|
940 | be set to the value selected in the <tt class="xref py py-class docutils literal"><span class="pre">ComboBox</span></tt>. Also, dct[item] |
---|
941 | contains the starting value shown in the widget. If the value |
---|
942 | does not match an entry in <tt class="xref py py-data docutils literal"><span class="pre">values</span></tt>, the first value |
---|
943 | in <tt class="xref py py-data docutils literal"><span class="pre">choices</span></tt> is used as the default, but <tt class="docutils literal"><span class="pre">dct[item]</span></tt> is |
---|
944 | not changed.</li> |
---|
945 | <li><strong>choices</strong> (<em>list</em>) – <p>a list of choices to be displayed to the |
---|
946 | user such as</p> |
---|
947 | <div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="s">"default"</span><span class="p">,</span><span class="s">"option 1"</span><span class="p">,</span><span class="s">"option 2"</span><span class="p">,]</span> |
---|
948 | </pre></div> |
---|
949 | </div> |
---|
950 | <p>Note that these options will correspond to the entries in |
---|
951 | <tt class="xref py py-data docutils literal"><span class="pre">values</span></tt> (if specified) item by item.</p> |
---|
952 | </li> |
---|
953 | <li><strong>values</strong> (<em>list</em>) – <p>a list of values that correspond to |
---|
954 | the options in <tt class="xref py py-data docutils literal"><span class="pre">choices</span></tt>, such as</p> |
---|
955 | <div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">]</span> |
---|
956 | </pre></div> |
---|
957 | </div> |
---|
958 | <p>The default for <tt class="xref py py-data docutils literal"><span class="pre">values</span></tt> is to use the same list as |
---|
959 | specified for <tt class="xref py py-data docutils literal"><span class="pre">choices</span></tt>.</p> |
---|
960 | </li> |
---|
961 | <li><strong>(other)</strong> – additional keyword arguments accepted by |
---|
962 | <tt class="xref py py-class docutils literal"><span class="pre">ComboBox</span></tt> can be specified.</li> |
---|
963 | </ul> |
---|
964 | </td> |
---|
965 | </tr> |
---|
966 | </tbody> |
---|
967 | </table> |
---|
968 | </dd></dl> |
---|
969 | |
---|
970 | <dl class="class"> |
---|
971 | <dt id="GSASIIgrid.G2ChoiceButton"> |
---|
972 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">G2ChoiceButton</tt><big>(</big><em>parent</em>, <em>choiceList</em>, <em>indLoc=None</em>, <em>indKey=None</em>, <em>strLoc=None</em>, <em>strKey=None</em>, <em>onChoice=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2ChoiceButton"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2ChoiceButton" title="Permalink to this definition">¶</a></dt> |
---|
973 | <dd><p>A customized version of a wx.Choice that automatically initializes |
---|
974 | the control to match a supplied value and saves the choice directly |
---|
975 | into an array or list. Optionally a function can be called each time a |
---|
976 | choice is selected. The widget can be used with an array item that is set to |
---|
977 | to the choice by number (<tt class="docutils literal"><span class="pre">indLoc[indKey]</span></tt>) or by string value |
---|
978 | (<tt class="docutils literal"><span class="pre">strLoc[strKey]</span></tt>) or both. The initial value is taken from <tt class="docutils literal"><span class="pre">indLoc[indKey]</span></tt> |
---|
979 | if not None or <tt class="docutils literal"><span class="pre">strLoc[strKey]</span></tt> if not None.</p> |
---|
980 | <table class="docutils field-list" frame="void" rules="none"> |
---|
981 | <col class="field-name" /> |
---|
982 | <col class="field-body" /> |
---|
983 | <tbody valign="top"> |
---|
984 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
985 | <li><strong>parent</strong> (<em>wx.Panel</em>) – name of panel or frame that will be |
---|
986 | the parent to the widget. Can be None.</li> |
---|
987 | <li><strong>choiceList</strong> (<em>list</em>) – a list or tuple of choices to offer the user.</li> |
---|
988 | <li><strong>indLoc</strong> (<em>dict/list</em>) – a dict or list with the initial value to be |
---|
989 | placed in the Choice button. If this is None, this is ignored.</li> |
---|
990 | <li><strong>indKey</strong> (<em>int/str</em>) – the dict key or the list index for the value to be |
---|
991 | edited by the Choice button. If indLoc is not None then this |
---|
992 | must be specified and the <tt class="docutils literal"><span class="pre">indLoc[indKey]</span></tt> will be set. If the value |
---|
993 | for <tt class="docutils literal"><span class="pre">indLoc[indKey]</span></tt> is not None, it should be an integer in |
---|
994 | range(len(choiceList)). The Choice button will be initialized to the |
---|
995 | choice corresponding to the value in this element if not None.</li> |
---|
996 | <li><strong>strLoc</strong> (<em>dict/list</em>) – a dict or list with the string value corresponding to |
---|
997 | indLoc/indKey. Default (None) means that this is not used.</li> |
---|
998 | <li><strong>strKey</strong> (<em>int/str</em>) – the dict key or the list index for the string value |
---|
999 | The <tt class="docutils literal"><span class="pre">strLoc[strKey]</span></tt> element must exist or strLoc must be None (default).</li> |
---|
1000 | <li><strong>onChoice</strong> (<em>function</em>) – name of a function to call when the choice is made.</li> |
---|
1001 | </ul> |
---|
1002 | </td> |
---|
1003 | </tr> |
---|
1004 | </tbody> |
---|
1005 | </table> |
---|
1006 | </dd></dl> |
---|
1007 | |
---|
1008 | <dl class="class"> |
---|
1009 | <dt id="GSASIIgrid.G2ColumnIDDialog"> |
---|
1010 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">G2ColumnIDDialog</tt><big>(</big><em>parent</em>, <em>title</em>, <em>header</em>, <em>Comments</em>, <em>ChoiceList</em>, <em>ColumnData</em>, <em>monoFont=False</em>, <em>**kw</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2ColumnIDDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2ColumnIDDialog" title="Permalink to this definition">¶</a></dt> |
---|
1011 | <dd><p>A dialog for matching column data to desired items; some columns may be ignored.</p> |
---|
1012 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1013 | <col class="field-name" /> |
---|
1014 | <col class="field-body" /> |
---|
1015 | <tbody valign="top"> |
---|
1016 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
1017 | <li><strong>ParentFrame</strong> (<em>wx.Frame</em>) – reference to parent frame</li> |
---|
1018 | <li><strong>title</strong> (<em>str</em>) – heading above list of choices</li> |
---|
1019 | <li><strong>header</strong> (<em>str</em>) – Title to place on window frame</li> |
---|
1020 | <li><strong>ChoiceList</strong> (<em>list</em>) – a list of possible choices for the columns</li> |
---|
1021 | <li><strong>ColumnData</strong> (<em>list</em>) – lists of column data to be matched with ChoiceList</li> |
---|
1022 | <li><strong>monoFont</strong> (<em>bool</em>) – If False (default), use a variable-spaced font; |
---|
1023 | if True use a equally-spaced font.</li> |
---|
1024 | <li><strong>kw</strong> – optional keyword parameters for the wx.Dialog may |
---|
1025 | be included such as size [which defaults to <cite>(320,310)</cite>] and |
---|
1026 | style (which defaults to <tt class="docutils literal"><span class="pre">wx.DEFAULT_DIALOG_STYLE</span> <span class="pre">|</span> <span class="pre">wx.RESIZE_BORDER</span> <span class="pre">|</span> <span class="pre">wx.CENTRE</span> <span class="pre">|</span> <span class="pre">wx.OK</span> <span class="pre">|</span> <span class="pre">wx.CANCEL</span></tt>); |
---|
1027 | note that <tt class="docutils literal"><span class="pre">wx.OK</span></tt> and <tt class="docutils literal"><span class="pre">wx.CANCEL</span></tt> controls |
---|
1028 | the presence of the eponymous buttons in the dialog.</li> |
---|
1029 | </ul> |
---|
1030 | </td> |
---|
1031 | </tr> |
---|
1032 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the name of the created dialog</p> |
---|
1033 | </td> |
---|
1034 | </tr> |
---|
1035 | </tbody> |
---|
1036 | </table> |
---|
1037 | <dl class="method"> |
---|
1038 | <dt id="GSASIIgrid.G2ColumnIDDialog.GetSelection"> |
---|
1039 | <tt class="descname">GetSelection</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2ColumnIDDialog.GetSelection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2ColumnIDDialog.GetSelection" title="Permalink to this definition">¶</a></dt> |
---|
1040 | <dd><p>Returns the selected sample parm for each column</p> |
---|
1041 | </dd></dl> |
---|
1042 | |
---|
1043 | </dd></dl> |
---|
1044 | |
---|
1045 | <dl class="class"> |
---|
1046 | <dt id="GSASIIgrid.G2LoggedButton"> |
---|
1047 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">G2LoggedButton</tt><big>(</big><em>parent</em>, <em>id=-1</em>, <em>label=''</em>, <em>locationcode=''</em>, <em>handler=None</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2LoggedButton"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2LoggedButton" title="Permalink to this definition">¶</a></dt> |
---|
1048 | <dd><p>A version of wx.Button that creates logging events. Bindings are saved |
---|
1049 | in the object, and are looked up rather than directly set with a bind. |
---|
1050 | An index to these buttons is saved as log.ButtonBindingLookup |
---|
1051 | :param wx.Panel parent: parent widget |
---|
1052 | :param int id: Id for button |
---|
1053 | :param str label: label for button |
---|
1054 | :param str locationcode: a label used internally to uniquely indentify the button |
---|
1055 | :param function handler: a routine to call when the button is pressed</p> |
---|
1056 | <dl class="method"> |
---|
1057 | <dt id="GSASIIgrid.G2LoggedButton.onPress"> |
---|
1058 | <tt class="descname">onPress</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2LoggedButton.onPress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2LoggedButton.onPress" title="Permalink to this definition">¶</a></dt> |
---|
1059 | <dd><p>create log event and call handler</p> |
---|
1060 | </dd></dl> |
---|
1061 | |
---|
1062 | </dd></dl> |
---|
1063 | |
---|
1064 | <dl class="class"> |
---|
1065 | <dt id="GSASIIgrid.G2MultiChoiceDialog"> |
---|
1066 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">G2MultiChoiceDialog</tt><big>(</big><em>parent</em>, <em>title</em>, <em>header</em>, <em>ChoiceList</em>, <em>toggle=True</em>, <em>monoFont=False</em>, <em>filterBox=True</em>, <em>**kw</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2MultiChoiceDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2MultiChoiceDialog" title="Permalink to this definition">¶</a></dt> |
---|
1067 | <dd><p>A dialog similar to MultiChoiceDialog except that buttons are |
---|
1068 | added to set all choices and to toggle all choices.</p> |
---|
1069 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1070 | <col class="field-name" /> |
---|
1071 | <col class="field-body" /> |
---|
1072 | <tbody valign="top"> |
---|
1073 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
1074 | <li><strong>ParentFrame</strong> (<em>wx.Frame</em>) – reference to parent frame</li> |
---|
1075 | <li><strong>title</strong> (<em>str</em>) – heading above list of choices</li> |
---|
1076 | <li><strong>header</strong> (<em>str</em>) – Title to place on window frame</li> |
---|
1077 | <li><strong>ChoiceList</strong> (<em>list</em>) – a list of choices where one will be selected</li> |
---|
1078 | <li><strong>toggle</strong> (<em>bool</em>) – If True (default) the toggle and select all buttons |
---|
1079 | are displayed</li> |
---|
1080 | <li><strong>monoFont</strong> (<em>bool</em>) – If False (default), use a variable-spaced font; |
---|
1081 | if True use a equally-spaced font.</li> |
---|
1082 | <li><strong>filterBox</strong> (<em>bool</em>) – If True (default) an input widget is placed on |
---|
1083 | the window and only entries matching the entered text are shown.</li> |
---|
1084 | <li><strong>kw</strong> – optional keyword parameters for the wx.Dialog may |
---|
1085 | be included such as size [which defaults to <cite>(320,310)</cite>] and |
---|
1086 | style (which defaults to <cite>wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.CENTRE| wx.OK | wx.CANCEL</cite>); |
---|
1087 | note that <cite>wx.OK</cite> and <cite>wx.CANCEL</cite> controls |
---|
1088 | the presence of the eponymous buttons in the dialog.</li> |
---|
1089 | </ul> |
---|
1090 | </td> |
---|
1091 | </tr> |
---|
1092 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the name of the created dialog</p> |
---|
1093 | </td> |
---|
1094 | </tr> |
---|
1095 | </tbody> |
---|
1096 | </table> |
---|
1097 | <dl class="method"> |
---|
1098 | <dt id="GSASIIgrid.G2MultiChoiceDialog.GetSelections"> |
---|
1099 | <tt class="descname">GetSelections</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2MultiChoiceDialog.GetSelections"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2MultiChoiceDialog.GetSelections" title="Permalink to this definition">¶</a></dt> |
---|
1100 | <dd><p>Returns a list of the indices for the selected choices</p> |
---|
1101 | </dd></dl> |
---|
1102 | |
---|
1103 | <dl class="method"> |
---|
1104 | <dt id="GSASIIgrid.G2MultiChoiceDialog.OnCheck"> |
---|
1105 | <tt class="descname">OnCheck</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2MultiChoiceDialog.OnCheck"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2MultiChoiceDialog.OnCheck" title="Permalink to this definition">¶</a></dt> |
---|
1106 | <dd><p>for CheckListBox events; if Shift key down this sets all unset |
---|
1107 | entries below the selected one</p> |
---|
1108 | </dd></dl> |
---|
1109 | |
---|
1110 | <dl class="method"> |
---|
1111 | <dt id="GSASIIgrid.G2MultiChoiceDialog.SetSelections"> |
---|
1112 | <tt class="descname">SetSelections</tt><big>(</big><em>selList</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2MultiChoiceDialog.SetSelections"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2MultiChoiceDialog.SetSelections" title="Permalink to this definition">¶</a></dt> |
---|
1113 | <dd><p>Sets the selection indices in selList as selected. Resets any previous |
---|
1114 | selections for compatibility with wx.MultiChoiceDialog. Note that |
---|
1115 | the state for only the filtered items is shown.</p> |
---|
1116 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1117 | <col class="field-name" /> |
---|
1118 | <col class="field-body" /> |
---|
1119 | <tbody valign="top"> |
---|
1120 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>selList</strong> (<em>list</em>) – indices of items to be selected. These indices |
---|
1121 | are referenced to the order in self.ChoiceList</td> |
---|
1122 | </tr> |
---|
1123 | </tbody> |
---|
1124 | </table> |
---|
1125 | </dd></dl> |
---|
1126 | |
---|
1127 | <dl class="method"> |
---|
1128 | <dt id="GSASIIgrid.G2MultiChoiceDialog.onChar"> |
---|
1129 | <tt class="descname">onChar</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2MultiChoiceDialog.onChar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2MultiChoiceDialog.onChar" title="Permalink to this definition">¶</a></dt> |
---|
1130 | <dd><p>for keyboard events. self.trigger is used in self.OnCheck below</p> |
---|
1131 | </dd></dl> |
---|
1132 | |
---|
1133 | </dd></dl> |
---|
1134 | |
---|
1135 | <dl class="class"> |
---|
1136 | <dt id="GSASIIgrid.G2SingleChoiceDialog"> |
---|
1137 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">G2SingleChoiceDialog</tt><big>(</big><em>parent</em>, <em>title</em>, <em>header</em>, <em>ChoiceList</em>, <em>monoFont=False</em>, <em>filterBox=True</em>, <em>**kw</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2SingleChoiceDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2SingleChoiceDialog" title="Permalink to this definition">¶</a></dt> |
---|
1138 | <dd><p>A dialog similar to wx.SingleChoiceDialog except that a filter can be |
---|
1139 | added.</p> |
---|
1140 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1141 | <col class="field-name" /> |
---|
1142 | <col class="field-body" /> |
---|
1143 | <tbody valign="top"> |
---|
1144 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
1145 | <li><strong>ParentFrame</strong> (<em>wx.Frame</em>) – reference to parent frame</li> |
---|
1146 | <li><strong>title</strong> (<em>str</em>) – heading above list of choices</li> |
---|
1147 | <li><strong>header</strong> (<em>str</em>) – Title to place on window frame</li> |
---|
1148 | <li><strong>ChoiceList</strong> (<em>list</em>) – a list of choices where one will be selected</li> |
---|
1149 | <li><strong>monoFont</strong> (<em>bool</em>) – If False (default), use a variable-spaced font; |
---|
1150 | if True use a equally-spaced font.</li> |
---|
1151 | <li><strong>filterBox</strong> (<em>bool</em>) – If True (default) an input widget is placed on |
---|
1152 | the window and only entries matching the entered text are shown.</li> |
---|
1153 | <li><strong>kw</strong> – optional keyword parameters for the wx.Dialog may |
---|
1154 | be included such as size [which defaults to <cite>(320,310)</cite>] and |
---|
1155 | style (which defaults to <tt class="docutils literal"><span class="pre">wx.DEFAULT_DIALOG_STYLE</span> <span class="pre">|</span> <span class="pre">wx.RESIZE_BORDER</span> <span class="pre">|</span> <span class="pre">wx.CENTRE</span> <span class="pre">|</span> <span class="pre">wx.OK</span> <span class="pre">|</span> <span class="pre">wx.CANCEL</span></tt>); |
---|
1156 | note that <tt class="docutils literal"><span class="pre">wx.OK</span></tt> and <tt class="docutils literal"><span class="pre">wx.CANCEL</span></tt> controls |
---|
1157 | the presence of the eponymous buttons in the dialog.</li> |
---|
1158 | </ul> |
---|
1159 | </td> |
---|
1160 | </tr> |
---|
1161 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the name of the created dialog</p> |
---|
1162 | </td> |
---|
1163 | </tr> |
---|
1164 | </tbody> |
---|
1165 | </table> |
---|
1166 | <dl class="method"> |
---|
1167 | <dt id="GSASIIgrid.G2SingleChoiceDialog.GetSelection"> |
---|
1168 | <tt class="descname">GetSelection</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#G2SingleChoiceDialog.GetSelection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.G2SingleChoiceDialog.GetSelection" title="Permalink to this definition">¶</a></dt> |
---|
1169 | <dd><p>Returns the index of the selected choice</p> |
---|
1170 | </dd></dl> |
---|
1171 | |
---|
1172 | </dd></dl> |
---|
1173 | |
---|
1174 | <dl class="class"> |
---|
1175 | <dt id="GSASIIgrid.GSGrid"> |
---|
1176 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">GSGrid</tt><big>(</big><em>parent</em>, <em>name=''</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#GSGrid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.GSGrid" title="Permalink to this definition">¶</a></dt> |
---|
1177 | <dd><p>Basic wx.Grid implementation</p> |
---|
1178 | <dl class="method"> |
---|
1179 | <dt id="GSASIIgrid.GSGrid.InstallGridToolTip"> |
---|
1180 | <tt class="descname">InstallGridToolTip</tt><big>(</big><em>rowcolhintcallback</em>, <em>colLblCallback=None</em>, <em>rowLblCallback=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#GSGrid.InstallGridToolTip"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.GSGrid.InstallGridToolTip" title="Permalink to this definition">¶</a></dt> |
---|
1181 | <dd><p>code to display a tooltip for each item on a grid |
---|
1182 | from <a class="reference external" href="http://wiki.wxpython.org/wxGrid%20ToolTips">http://wiki.wxpython.org/wxGrid%20ToolTips</a> (buggy!), expanded to |
---|
1183 | column and row labels using hints from |
---|
1184 | <a class="reference external" href="https://groups.google.com/forum/#!topic/wxPython-users/bm8OARRVDCs">https://groups.google.com/forum/#!topic/wxPython-users/bm8OARRVDCs</a></p> |
---|
1185 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1186 | <col class="field-name" /> |
---|
1187 | <col class="field-body" /> |
---|
1188 | <tbody valign="top"> |
---|
1189 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
1190 | <li><strong>rowcolhintcallback</strong> (<em>function</em>) – a routine that returns a text |
---|
1191 | string depending on the selected row and column, to be used in |
---|
1192 | explaining grid entries.</li> |
---|
1193 | <li><strong>colLblCallback</strong> (<em>function</em>) – a routine that returns a text |
---|
1194 | string depending on the selected column, to be used in |
---|
1195 | explaining grid columns (if None, the default), column labels |
---|
1196 | do not get a tooltip.</li> |
---|
1197 | <li><strong>rowLblCallback</strong> (<em>function</em>) – a routine that returns a text |
---|
1198 | string depending on the selected row, to be used in |
---|
1199 | explaining grid rows (if None, the default), row labels |
---|
1200 | do not get a tooltip.</li> |
---|
1201 | </ul> |
---|
1202 | </td> |
---|
1203 | </tr> |
---|
1204 | </tbody> |
---|
1205 | </table> |
---|
1206 | </dd></dl> |
---|
1207 | |
---|
1208 | </dd></dl> |
---|
1209 | |
---|
1210 | <dl class="class"> |
---|
1211 | <dt id="GSASIIgrid.GSNoteBook"> |
---|
1212 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">GSNoteBook</tt><big>(</big><em>parent</em>, <em>name=''</em>, <em>size=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#GSNoteBook"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.GSNoteBook" title="Permalink to this definition">¶</a></dt> |
---|
1213 | <dd><p>Notebook used in various locations; implemented with wx.aui extension</p> |
---|
1214 | <dl class="method"> |
---|
1215 | <dt id="GSASIIgrid.GSNoteBook.Bind"> |
---|
1216 | <tt class="descname">Bind</tt><big>(</big><em>eventtype</em>, <em>handler</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#GSNoteBook.Bind"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.GSNoteBook.Bind" title="Permalink to this definition">¶</a></dt> |
---|
1217 | <dd><p>Override the Bind() function so that page change events can be trapped</p> |
---|
1218 | </dd></dl> |
---|
1219 | |
---|
1220 | </dd></dl> |
---|
1221 | |
---|
1222 | <dl class="function"> |
---|
1223 | <dt id="GSASIIgrid.GetPatternTreeDataNames"> |
---|
1224 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">GetPatternTreeDataNames</tt><big>(</big><em>G2frame</em>, <em>dataTypes</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#GetPatternTreeDataNames"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.GetPatternTreeDataNames" title="Permalink to this definition">¶</a></dt> |
---|
1225 | <dd><p>Needs a doc string</p> |
---|
1226 | </dd></dl> |
---|
1227 | |
---|
1228 | <dl class="function"> |
---|
1229 | <dt id="GSASIIgrid.GetPatternTreeItemId"> |
---|
1230 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">GetPatternTreeItemId</tt><big>(</big><em>G2frame</em>, <em>parentId</em>, <em>itemText</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#GetPatternTreeItemId"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.GetPatternTreeItemId" title="Permalink to this definition">¶</a></dt> |
---|
1231 | <dd><p>Needs a doc string</p> |
---|
1232 | </dd></dl> |
---|
1233 | |
---|
1234 | <dl class="class"> |
---|
1235 | <dt id="GSASIIgrid.GridFractionEditor"> |
---|
1236 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">GridFractionEditor</tt><big>(</big><em>grid</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#GridFractionEditor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.GridFractionEditor" title="Permalink to this definition">¶</a></dt> |
---|
1237 | <dd><p>A grid cell editor class that allows entry of values as fractions as well |
---|
1238 | as sine and cosine values [as s() and c()]</p> |
---|
1239 | <dl class="method"> |
---|
1240 | <dt id="GSASIIgrid.GridFractionEditor.ApplyEdit"> |
---|
1241 | <tt class="descname">ApplyEdit</tt><big>(</big><em>row</em>, <em>col</em>, <em>grid</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#GridFractionEditor.ApplyEdit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.GridFractionEditor.ApplyEdit" title="Permalink to this definition">¶</a></dt> |
---|
1242 | <dd><p>Called only in wx >= 2.9 |
---|
1243 | Save the value of the control into the grid if EndEdit() returns as True</p> |
---|
1244 | </dd></dl> |
---|
1245 | |
---|
1246 | </dd></dl> |
---|
1247 | |
---|
1248 | <dl class="function"> |
---|
1249 | <dt id="GSASIIgrid.HorizontalLine"> |
---|
1250 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">HorizontalLine</tt><big>(</big><em>sizer</em>, <em>parent</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#HorizontalLine"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.HorizontalLine" title="Permalink to this definition">¶</a></dt> |
---|
1251 | <dd><p>Draws a horizontal line as wide as the window. |
---|
1252 | This shows up on the Mac as a very thin line, no matter what I do</p> |
---|
1253 | </dd></dl> |
---|
1254 | |
---|
1255 | <dl class="function"> |
---|
1256 | <dt id="GSASIIgrid.HowDidIgetHere"> |
---|
1257 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">HowDidIgetHere</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#HowDidIgetHere"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.HowDidIgetHere" title="Permalink to this definition">¶</a></dt> |
---|
1258 | <dd><p>Show a traceback with calls that brought us to the current location. |
---|
1259 | Used for debugging.</p> |
---|
1260 | </dd></dl> |
---|
1261 | |
---|
1262 | <dl class="function"> |
---|
1263 | <dt id="GSASIIgrid.ItemSelector"> |
---|
1264 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">ItemSelector</tt><big>(</big><em>ChoiceList</em>, <em>ParentFrame=None</em>, <em>title='Select an item'</em>, <em>size=None</em>, <em>header='Item Selector'</em>, <em>useCancel=True</em>, <em>multiple=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#ItemSelector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.ItemSelector" title="Permalink to this definition">¶</a></dt> |
---|
1265 | <dd><p>Provide a wx dialog to select a single item or multiple items from list of choices</p> |
---|
1266 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1267 | <col class="field-name" /> |
---|
1268 | <col class="field-body" /> |
---|
1269 | <tbody valign="top"> |
---|
1270 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
1271 | <li><strong>ChoiceList</strong> (<em>list</em>) – a list of choices where one will be selected</li> |
---|
1272 | <li><strong>ParentFrame</strong> (<em>wx.Frame</em>) – Name of parent frame (default None)</li> |
---|
1273 | <li><strong>title</strong> (<em>str</em>) – heading above list of choices (default ‘Select an item’)</li> |
---|
1274 | <li><strong>size</strong> (<em>wx.Size</em>) – Size for dialog to be created (default None – size as needed)</li> |
---|
1275 | <li><strong>header</strong> (<em>str</em>) – Title to place on window frame (default ‘Item Selector’)</li> |
---|
1276 | <li><strong>useCancel</strong> (<em>bool</em>) – If True (default) both the OK and Cancel buttons are offered</li> |
---|
1277 | <li><strong>multiple</strong> (<em>bool</em>) – If True then multiple items can be selected (default False)</li> |
---|
1278 | </ul> |
---|
1279 | </td> |
---|
1280 | </tr> |
---|
1281 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the selection index or None or a selection list if multiple is true</p> |
---|
1282 | </td> |
---|
1283 | </tr> |
---|
1284 | </tbody> |
---|
1285 | </table> |
---|
1286 | </dd></dl> |
---|
1287 | |
---|
1288 | <dl class="function"> |
---|
1289 | <dt id="GSASIIgrid.MovePatternTreeToGrid"> |
---|
1290 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">MovePatternTreeToGrid</tt><big>(</big><em>G2frame</em>, <em>item</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#MovePatternTreeToGrid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.MovePatternTreeToGrid" title="Permalink to this definition">¶</a></dt> |
---|
1291 | <dd><p>Called from GSASII.OnPatternTreeSelChanged when a item is selected on the tree</p> |
---|
1292 | </dd></dl> |
---|
1293 | |
---|
1294 | <dl class="class"> |
---|
1295 | <dt id="GSASIIgrid.MultiStringDialog"> |
---|
1296 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">MultiStringDialog</tt><big>(</big><em>parent</em>, <em>title</em>, <em>prompts</em>, <em>values=</em><span class="optional">[</span><span class="optional">]</span><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#MultiStringDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.MultiStringDialog" title="Permalink to this definition">¶</a></dt> |
---|
1297 | <dd><p>Dialog to obtain a multi string values from user</p> |
---|
1298 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1299 | <col class="field-name" /> |
---|
1300 | <col class="field-body" /> |
---|
1301 | <tbody valign="top"> |
---|
1302 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
1303 | <li><strong>parent</strong> (<em>wx.Frame</em>) – name of parent frame</li> |
---|
1304 | <li><strong>title</strong> (<em>str</em>) – title string for dialog</li> |
---|
1305 | <li><strong>prompts</strong> (<em>str</em>) – strings to tell use what they are inputting</li> |
---|
1306 | <li><strong>values</strong> (<em>str</em>) – default input values, if any</li> |
---|
1307 | </ul> |
---|
1308 | </td> |
---|
1309 | </tr> |
---|
1310 | </tbody> |
---|
1311 | </table> |
---|
1312 | <dl class="method"> |
---|
1313 | <dt id="GSASIIgrid.MultiStringDialog.GetValues"> |
---|
1314 | <tt class="descname">GetValues</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#MultiStringDialog.GetValues"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.MultiStringDialog.GetValues" title="Permalink to this definition">¶</a></dt> |
---|
1315 | <dd><p>Use this method to get the value entered by the user |
---|
1316 | :returns: string entered by user</p> |
---|
1317 | </dd></dl> |
---|
1318 | |
---|
1319 | <dl class="method"> |
---|
1320 | <dt id="GSASIIgrid.MultiStringDialog.Show"> |
---|
1321 | <tt class="descname">Show</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#MultiStringDialog.Show"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.MultiStringDialog.Show" title="Permalink to this definition">¶</a></dt> |
---|
1322 | <dd><p>Use this method after creating the dialog to post it |
---|
1323 | :returns: True if the user pressed OK; False if the User pressed Cancel</p> |
---|
1324 | </dd></dl> |
---|
1325 | |
---|
1326 | </dd></dl> |
---|
1327 | |
---|
1328 | <dl class="class"> |
---|
1329 | <dt id="GSASIIgrid.SGMessageBox"> |
---|
1330 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">SGMessageBox</tt><big>(</big><em>parent</em>, <em>title</em>, <em>text</em>, <em>table</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#SGMessageBox"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.SGMessageBox" title="Permalink to this definition">¶</a></dt> |
---|
1331 | <dd><p>Special version of MessageBox that displays space group & super space group text |
---|
1332 | in two blocks</p> |
---|
1333 | <dl class="method"> |
---|
1334 | <dt id="GSASIIgrid.SGMessageBox.Show"> |
---|
1335 | <tt class="descname">Show</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#SGMessageBox.Show"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.SGMessageBox.Show" title="Permalink to this definition">¶</a></dt> |
---|
1336 | <dd><p>Use this method after creating the dialog to post it</p> |
---|
1337 | </dd></dl> |
---|
1338 | |
---|
1339 | </dd></dl> |
---|
1340 | |
---|
1341 | <dl class="function"> |
---|
1342 | <dt id="GSASIIgrid.SetDataMenuBar"> |
---|
1343 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">SetDataMenuBar</tt><big>(</big><em>G2frame</em>, <em>menu=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#SetDataMenuBar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.SetDataMenuBar" title="Permalink to this definition">¶</a></dt> |
---|
1344 | <dd><p>Set the menu for the data frame. On the Mac put this |
---|
1345 | menu for the data tree window instead.</p> |
---|
1346 | <p>Note that data frame items do not have menus, for these (menu=None) |
---|
1347 | display a blank menu or on the Mac display the standard menu for |
---|
1348 | the data tree window.</p> |
---|
1349 | </dd></dl> |
---|
1350 | |
---|
1351 | <dl class="class"> |
---|
1352 | <dt id="GSASIIgrid.ShowLSParms"> |
---|
1353 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">ShowLSParms</tt><big>(</big><em>parent</em>, <em>title</em>, <em>parmDict</em>, <em>varyList</em>, <em>fullVaryList</em>, <em>size=(300</em>, <em>430)</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#ShowLSParms"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.ShowLSParms" title="Permalink to this definition">¶</a></dt> |
---|
1354 | <dd><p>Create frame to show least-squares parameters</p> |
---|
1355 | </dd></dl> |
---|
1356 | |
---|
1357 | <dl class="class"> |
---|
1358 | <dt id="GSASIIgrid.SingleFloatDialog"> |
---|
1359 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">SingleFloatDialog</tt><big>(</big><em>parent, title, prompt, value, limits=[0.0, 1.0], format='%.5g'</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#SingleFloatDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.SingleFloatDialog" title="Permalink to this definition">¶</a></dt> |
---|
1360 | <dd><p>Dialog to obtain a single float value from user</p> |
---|
1361 | </dd></dl> |
---|
1362 | |
---|
1363 | <dl class="class"> |
---|
1364 | <dt id="GSASIIgrid.SingleStringDialog"> |
---|
1365 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">SingleStringDialog</tt><big>(</big><em>parent</em>, <em>title</em>, <em>prompt</em>, <em>value=''</em>, <em>size=(200</em>, <em>-1)</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#SingleStringDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.SingleStringDialog" title="Permalink to this definition">¶</a></dt> |
---|
1366 | <dd><p>Dialog to obtain a single string value from user</p> |
---|
1367 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1368 | <col class="field-name" /> |
---|
1369 | <col class="field-body" /> |
---|
1370 | <tbody valign="top"> |
---|
1371 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
1372 | <li><strong>parent</strong> (<em>wx.Frame</em>) – name of parent frame</li> |
---|
1373 | <li><strong>title</strong> (<em>str</em>) – title string for dialog</li> |
---|
1374 | <li><strong>prompt</strong> (<em>str</em>) – string to tell use what they are inputting</li> |
---|
1375 | <li><strong>value</strong> (<em>str</em>) – default input value, if any</li> |
---|
1376 | </ul> |
---|
1377 | </td> |
---|
1378 | </tr> |
---|
1379 | </tbody> |
---|
1380 | </table> |
---|
1381 | <dl class="method"> |
---|
1382 | <dt id="GSASIIgrid.SingleStringDialog.GetValue"> |
---|
1383 | <tt class="descname">GetValue</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#SingleStringDialog.GetValue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.SingleStringDialog.GetValue" title="Permalink to this definition">¶</a></dt> |
---|
1384 | <dd><p>Use this method to get the value entered by the user |
---|
1385 | :returns: string entered by user</p> |
---|
1386 | </dd></dl> |
---|
1387 | |
---|
1388 | <dl class="method"> |
---|
1389 | <dt id="GSASIIgrid.SingleStringDialog.Show"> |
---|
1390 | <tt class="descname">Show</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#SingleStringDialog.Show"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.SingleStringDialog.Show" title="Permalink to this definition">¶</a></dt> |
---|
1391 | <dd><p>Use this method after creating the dialog to post it |
---|
1392 | :returns: True if the user pressed OK; False if the User pressed Cancel</p> |
---|
1393 | </dd></dl> |
---|
1394 | |
---|
1395 | </dd></dl> |
---|
1396 | |
---|
1397 | <dl class="class"> |
---|
1398 | <dt id="GSASIIgrid.SymOpDialog"> |
---|
1399 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">SymOpDialog</tt><big>(</big><em>parent</em>, <em>SGData</em>, <em>New=True</em>, <em>ForceUnit=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#SymOpDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.SymOpDialog" title="Permalink to this definition">¶</a></dt> |
---|
1400 | <dd><p>Class to select a symmetry operator</p> |
---|
1401 | </dd></dl> |
---|
1402 | |
---|
1403 | <dl class="class"> |
---|
1404 | <dt id="GSASIIgrid.Table"> |
---|
1405 | <em class="property">class </em><tt class="descclassname">GSASIIgrid.</tt><tt class="descname">Table</tt><big>(</big><em>data=</em>, <span class="optional">[</span><span class="optional">]</span><em>rowLabels=None</em>, <em>colLabels=None</em>, <em>types=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#Table"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.Table" title="Permalink to this definition">¶</a></dt> |
---|
1406 | <dd><p>Basic data table for use with GSgrid</p> |
---|
1407 | </dd></dl> |
---|
1408 | |
---|
1409 | <dl class="function"> |
---|
1410 | <dt id="GSASIIgrid.UpdateControls"> |
---|
1411 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">UpdateControls</tt><big>(</big><em>G2frame</em>, <em>data</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#UpdateControls"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.UpdateControls" title="Permalink to this definition">¶</a></dt> |
---|
1412 | <dd><p>Edit overall GSAS-II controls in main Controls data tree entry</p> |
---|
1413 | </dd></dl> |
---|
1414 | |
---|
1415 | <dl class="function"> |
---|
1416 | <dt id="GSASIIgrid.UpdateNotebook"> |
---|
1417 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">UpdateNotebook</tt><big>(</big><em>G2frame</em>, <em>data</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#UpdateNotebook"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.UpdateNotebook" title="Permalink to this definition">¶</a></dt> |
---|
1418 | <dd><p>Called when the data tree notebook entry is selected. Allows for |
---|
1419 | editing of the text in that tree entry</p> |
---|
1420 | </dd></dl> |
---|
1421 | |
---|
1422 | <dl class="function"> |
---|
1423 | <dt id="GSASIIgrid.UpdatePWHKPlot"> |
---|
1424 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">UpdatePWHKPlot</tt><big>(</big><em>G2frame</em>, <em>kind</em>, <em>item</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#UpdatePWHKPlot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.UpdatePWHKPlot" title="Permalink to this definition">¶</a></dt> |
---|
1425 | <dd><p>Called when the histogram main tree entry is called. Displays the |
---|
1426 | histogram weight factor, refinement statistics for the histogram |
---|
1427 | and the range of data for a simulation.</p> |
---|
1428 | <p>Also invokes a plot of the histogram.</p> |
---|
1429 | </dd></dl> |
---|
1430 | |
---|
1431 | <dl class="function"> |
---|
1432 | <dt id="GSASIIgrid.UpdateSeqResults"> |
---|
1433 | <tt class="descclassname">GSASIIgrid.</tt><tt class="descname">UpdateSeqResults</tt><big>(</big><em>G2frame</em>, <em>data</em>, <em>prevSize=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIgrid.html#UpdateSeqResults"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIgrid.UpdateSeqResults" title="Permalink to this definition">¶</a></dt> |
---|
1434 | <dd><p>Called when the Sequential Results data tree entry is selected |
---|
1435 | to show results from a sequential refinement.</p> |
---|
1436 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1437 | <col class="field-name" /> |
---|
1438 | <col class="field-body" /> |
---|
1439 | <tbody valign="top"> |
---|
1440 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
1441 | <li><strong>G2frame</strong> (<em>wx.Frame</em>) – main GSAS-II data tree windows</li> |
---|
1442 | <li><strong>data</strong> (<em>dict</em>) – <p>a dictionary containing the following items:</p> |
---|
1443 | <ul> |
---|
1444 | <li>‘histNames’ - list of histogram names in order as processed by Sequential Refinement</li> |
---|
1445 | <li>‘varyList’ - list of variables - identical over all refinements in sequence |
---|
1446 | note that this is the original list of variables, prior to processing |
---|
1447 | constraints.</li> |
---|
1448 | <li>‘variableLabels’ – a dict of labels to be applied to each parameter |
---|
1449 | (this is created as an empty dict if not present in data).</li> |
---|
1450 | <li>keyed by histName - dictionaries for all data sets processed, which contains:<ul> |
---|
1451 | <li>‘variables’- result[0] from leastsq call</li> |
---|
1452 | <li>‘varyList’ - list of variables passed to leastsq call (not same as above)</li> |
---|
1453 | <li>‘sig’ - esds for variables</li> |
---|
1454 | <li>‘covMatrix’ - covariance matrix from individual refinement</li> |
---|
1455 | <li>‘title’ - histogram name; same as dict item name</li> |
---|
1456 | <li>‘newAtomDict’ - new atom parameters after shifts applied</li> |
---|
1457 | <li>‘newCellDict’ - refined cell parameters after shifts to A0-A5 from Dij terms applied’</li> |
---|
1458 | </ul> |
---|
1459 | </li> |
---|
1460 | </ul> |
---|
1461 | </li> |
---|
1462 | </ul> |
---|
1463 | </td> |
---|
1464 | </tr> |
---|
1465 | </tbody> |
---|
1466 | </table> |
---|
1467 | </dd></dl> |
---|
1468 | |
---|
1469 | </div> |
---|
1470 | <span class="target" id="module-GSASIIIO"></span><div class="section" id="gsasiiio-misc-i-o-routines"> |
---|
1471 | <h2><em>GSASIIIO: Misc I/O routines</em><a class="headerlink" href="#gsasiiio-misc-i-o-routines" title="Permalink to this headline">¶</a></h2> |
---|
1472 | <p>Module with miscellaneous routines for input and output. Many |
---|
1473 | are GUI routines to interact with user.</p> |
---|
1474 | <p>Includes support for image reading.</p> |
---|
1475 | <p>Also includes base classes for data import routines.</p> |
---|
1476 | <dl class="function"> |
---|
1477 | <dt id="GSASIIIO.CheckImageFile"> |
---|
1478 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">CheckImageFile</tt><big>(</big><em>G2frame</em>, <em>imagefile</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#CheckImageFile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.CheckImageFile" title="Permalink to this definition">¶</a></dt> |
---|
1479 | <dd><p>Get an new image file name if the specified one does not |
---|
1480 | exist</p> |
---|
1481 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1482 | <col class="field-name" /> |
---|
1483 | <col class="field-body" /> |
---|
1484 | <tbody valign="top"> |
---|
1485 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
1486 | <li><strong>G2frame</strong> (<em>wx.Frame</em>) – main GSAS-II Frame and data object</li> |
---|
1487 | <li><strong>imagefile</strong> (<em>str</em>) – name of image file</li> |
---|
1488 | </ul> |
---|
1489 | </td> |
---|
1490 | </tr> |
---|
1491 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">imagefile, if it exists, or the name of a file |
---|
1492 | that does exist or False if the user presses Cancel</p> |
---|
1493 | </td> |
---|
1494 | </tr> |
---|
1495 | </tbody> |
---|
1496 | </table> |
---|
1497 | </dd></dl> |
---|
1498 | |
---|
1499 | <dl class="class"> |
---|
1500 | <dt id="GSASIIIO.ExportBaseclass"> |
---|
1501 | <em class="property">class </em><tt class="descclassname">GSASIIIO.</tt><tt class="descname">ExportBaseclass</tt><big>(</big><em>G2frame</em>, <em>formatName</em>, <em>extension</em>, <em>longFormatName=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass" title="Permalink to this definition">¶</a></dt> |
---|
1502 | <dd><p>Defines a base class for the exporting of GSAS-II results.</p> |
---|
1503 | <p>This class is subclassed in the various exports/G2export_*.py files. Those files |
---|
1504 | are imported in <tt class="xref py py-meth docutils literal"><span class="pre">GSASII.GSASII._init_Exports()</span></tt> which defines the |
---|
1505 | appropriate menu items for each one and the .Exporter method is called |
---|
1506 | directly from the menu item.</p> |
---|
1507 | <dl class="method"> |
---|
1508 | <dt id="GSASIIIO.ExportBaseclass.CloseFile"> |
---|
1509 | <tt class="descname">CloseFile</tt><big>(</big><em>fp=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.CloseFile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.CloseFile" title="Permalink to this definition">¶</a></dt> |
---|
1510 | <dd><p>Close a file opened in OpenFile</p> |
---|
1511 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1512 | <col class="field-name" /> |
---|
1513 | <col class="field-body" /> |
---|
1514 | <tbody valign="top"> |
---|
1515 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fp</strong> (<em>file</em>) – the file object to be closed. If None (default) |
---|
1516 | file object self.fp is closed.</td> |
---|
1517 | </tr> |
---|
1518 | </tbody> |
---|
1519 | </table> |
---|
1520 | </dd></dl> |
---|
1521 | |
---|
1522 | <dl class="method"> |
---|
1523 | <dt id="GSASIIIO.ExportBaseclass.ExportSelect"> |
---|
1524 | <tt class="descname">ExportSelect</tt><big>(</big><em>AskFile='ask'</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.ExportSelect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.ExportSelect" title="Permalink to this definition">¶</a></dt> |
---|
1525 | <dd><p>Selects histograms or phases when needed. Sets a default file name when |
---|
1526 | requested in self.filename; always sets a default directory in self.dirname.</p> |
---|
1527 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1528 | <col class="field-name" /> |
---|
1529 | <col class="field-body" /> |
---|
1530 | <tbody valign="top"> |
---|
1531 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>AskFile</strong> (<em>bool</em>) – <p>Determines how this routine processes getting a |
---|
1532 | location to store the current export(s).</p> |
---|
1533 | <ul class="simple"> |
---|
1534 | <li>if AskFile is ‘ask’ (default option), get the name of the file to be written; |
---|
1535 | self.filename and self.dirname are always set. In the case where |
---|
1536 | multiple files must be generated, the export routine should do this |
---|
1537 | based on self.filename as a template.</li> |
---|
1538 | <li>if AskFile is ‘dir’, get the name of the directory to be used; |
---|
1539 | self.filename is not used, but self.dirname is always set. The export routine |
---|
1540 | will always generate the file name.</li> |
---|
1541 | <li>if AskFile is ‘single’, get only the name of the directory to be used when |
---|
1542 | multiple items will be written (as multiple files) are used |
---|
1543 | <em>or</em> a complete file name is requested when a single file |
---|
1544 | name is selected. self.dirname is always set and self.filename used |
---|
1545 | only when a single file is selected.</li> |
---|
1546 | <li>if AskFile is ‘default’, creates a name of the file to be used from |
---|
1547 | the name of the project (.gpx) file. If the project has not been saved, |
---|
1548 | then the name of file is requested. |
---|
1549 | self.filename and self.dirname are always set. In the case where |
---|
1550 | multiple file names must be generated, the export routine should do this |
---|
1551 | based on self.filename.</li> |
---|
1552 | <li>if AskFile is ‘default-dir’, sets self.dirname from the project (.gpx) |
---|
1553 | file. If the project has not been saved, then a directory is requested. |
---|
1554 | self.filename is not used.</li> |
---|
1555 | </ul> |
---|
1556 | </td> |
---|
1557 | </tr> |
---|
1558 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True in case of an error</td> |
---|
1559 | </tr> |
---|
1560 | </tbody> |
---|
1561 | </table> |
---|
1562 | </dd></dl> |
---|
1563 | |
---|
1564 | <dl class="method"> |
---|
1565 | <dt id="GSASIIIO.ExportBaseclass.GetAtoms"> |
---|
1566 | <tt class="descname">GetAtoms</tt><big>(</big><em>phasenam</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.GetAtoms"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.GetAtoms" title="Permalink to this definition">¶</a></dt> |
---|
1567 | <dd><p>Gets the atoms associated with a phase. Can be used with standard |
---|
1568 | or macromolecular phases</p> |
---|
1569 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1570 | <col class="field-name" /> |
---|
1571 | <col class="field-body" /> |
---|
1572 | <tbody valign="top"> |
---|
1573 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>phasenam</strong> (<em>str</em>) – the name for the selected phase</td> |
---|
1574 | </tr> |
---|
1575 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a list of items for eac atom where each item is a list containing: |
---|
1576 | label, typ, mult, xyz, and td, where<ul class="simple"> |
---|
1577 | <li>label and typ are the atom label and the scattering factor type (str)</li> |
---|
1578 | <li>mult is the site multiplicity (int)</li> |
---|
1579 | <li>xyz is contains a list with four pairs of numbers: |
---|
1580 | x, y, z and fractional occupancy and |
---|
1581 | their standard uncertainty (or a negative value)</li> |
---|
1582 | <li>td is contains a list with either one or six pairs of numbers: |
---|
1583 | if one number it is U<sub>iso</sub> and with six numbers it is |
---|
1584 | U<sub>11</sub>, U<sub>22</sub>, U<sub>33</sub>, U<sub>12</sub>, U<sub>13</sub> & U<sub>23</sub> |
---|
1585 | paired with their standard uncertainty (or a negative value)</li> |
---|
1586 | </ul> |
---|
1587 | </td> |
---|
1588 | </tr> |
---|
1589 | </tbody> |
---|
1590 | </table> |
---|
1591 | </dd></dl> |
---|
1592 | |
---|
1593 | <dl class="method"> |
---|
1594 | <dt id="GSASIIIO.ExportBaseclass.GetCell"> |
---|
1595 | <tt class="descname">GetCell</tt><big>(</big><em>phasenam</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.GetCell"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.GetCell" title="Permalink to this definition">¶</a></dt> |
---|
1596 | <dd><p>Gets the unit cell parameters and their s.u.’s for a selected phase</p> |
---|
1597 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1598 | <col class="field-name" /> |
---|
1599 | <col class="field-body" /> |
---|
1600 | <tbody valign="top"> |
---|
1601 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>phasenam</strong> (<em>str</em>) – the name for the selected phase</td> |
---|
1602 | </tr> |
---|
1603 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><cite>cellList,cellSig</cite> where each is a 7 element list corresponding |
---|
1604 | to a, b, c, alpha, beta, gamma, volume where <cite>cellList</cite> has the |
---|
1605 | cell values and <cite>cellSig</cite> has their uncertainties.</td> |
---|
1606 | </tr> |
---|
1607 | </tbody> |
---|
1608 | </table> |
---|
1609 | </dd></dl> |
---|
1610 | |
---|
1611 | <dl class="method"> |
---|
1612 | <dt id="GSASIIIO.ExportBaseclass.InitExport"> |
---|
1613 | <tt class="descname">InitExport</tt><big>(</big><em>event</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.InitExport"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.InitExport" title="Permalink to this definition">¶</a></dt> |
---|
1614 | <dd><p>Determines the type of menu that called the Exporter and |
---|
1615 | misc initialization.</p> |
---|
1616 | </dd></dl> |
---|
1617 | |
---|
1618 | <dl class="method"> |
---|
1619 | <dt id="GSASIIIO.ExportBaseclass.MakePWDRfilename"> |
---|
1620 | <tt class="descname">MakePWDRfilename</tt><big>(</big><em>hist</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.MakePWDRfilename"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.MakePWDRfilename" title="Permalink to this definition">¶</a></dt> |
---|
1621 | <dd><p>Make a filename root (no extension) from a PWDR histogram name</p> |
---|
1622 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1623 | <col class="field-name" /> |
---|
1624 | <col class="field-body" /> |
---|
1625 | <tbody valign="top"> |
---|
1626 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>hist</strong> (<em>str</em>) – the histogram name in data tree (starts with “PWDR ”)</td> |
---|
1627 | </tr> |
---|
1628 | </tbody> |
---|
1629 | </table> |
---|
1630 | </dd></dl> |
---|
1631 | |
---|
1632 | <dl class="method"> |
---|
1633 | <dt id="GSASIIIO.ExportBaseclass.OpenFile"> |
---|
1634 | <tt class="descname">OpenFile</tt><big>(</big><em>fil=None</em>, <em>mode='w'</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.OpenFile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.OpenFile" title="Permalink to this definition">¶</a></dt> |
---|
1635 | <dd><p>Open the output file</p> |
---|
1636 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1637 | <col class="field-name" /> |
---|
1638 | <col class="field-body" /> |
---|
1639 | <tbody valign="top"> |
---|
1640 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fil</strong> (<em>str</em>) – The name of the file to open. If None (default) |
---|
1641 | the name defaults to self.dirname + self.filename. |
---|
1642 | If an extension is supplied, it is not overridded, |
---|
1643 | but if not, the default extension is used.</td> |
---|
1644 | </tr> |
---|
1645 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">the file object opened by the routine which is also |
---|
1646 | saved as self.fp</td> |
---|
1647 | </tr> |
---|
1648 | </tbody> |
---|
1649 | </table> |
---|
1650 | </dd></dl> |
---|
1651 | |
---|
1652 | <dl class="method"> |
---|
1653 | <dt id="GSASIIIO.ExportBaseclass.Write"> |
---|
1654 | <tt class="descname">Write</tt><big>(</big><em>line</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.Write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.Write" title="Permalink to this definition">¶</a></dt> |
---|
1655 | <dd><p>write a line of output, attaching a line-end character</p> |
---|
1656 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1657 | <col class="field-name" /> |
---|
1658 | <col class="field-body" /> |
---|
1659 | <tbody valign="top"> |
---|
1660 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>line</strong> (<em>str</em>) – the text to be written.</td> |
---|
1661 | </tr> |
---|
1662 | </tbody> |
---|
1663 | </table> |
---|
1664 | </dd></dl> |
---|
1665 | |
---|
1666 | <dl class="method"> |
---|
1667 | <dt id="GSASIIIO.ExportBaseclass.askSaveDirectory"> |
---|
1668 | <tt class="descname">askSaveDirectory</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.askSaveDirectory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.askSaveDirectory" title="Permalink to this definition">¶</a></dt> |
---|
1669 | <dd><p>Ask the user to supply a directory name. Path name is used as the |
---|
1670 | starting point for the next export path search.</p> |
---|
1671 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1672 | <col class="field-name" /> |
---|
1673 | <col class="field-body" /> |
---|
1674 | <tbody valign="top"> |
---|
1675 | <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a directory name (str) or None if Cancel is pressed</td> |
---|
1676 | </tr> |
---|
1677 | </tbody> |
---|
1678 | </table> |
---|
1679 | </dd></dl> |
---|
1680 | |
---|
1681 | <dl class="method"> |
---|
1682 | <dt id="GSASIIIO.ExportBaseclass.askSaveFile"> |
---|
1683 | <tt class="descname">askSaveFile</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.askSaveFile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.askSaveFile" title="Permalink to this definition">¶</a></dt> |
---|
1684 | <dd><p>Ask the user to supply a file name</p> |
---|
1685 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1686 | <col class="field-name" /> |
---|
1687 | <col class="field-body" /> |
---|
1688 | <tbody valign="top"> |
---|
1689 | <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a file name (str) or None if Cancel is pressed</td> |
---|
1690 | </tr> |
---|
1691 | </tbody> |
---|
1692 | </table> |
---|
1693 | </dd></dl> |
---|
1694 | |
---|
1695 | <dl class="method"> |
---|
1696 | <dt id="GSASIIIO.ExportBaseclass.dumpTree"> |
---|
1697 | <tt class="descname">dumpTree</tt><big>(</big><em>mode='type'</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.dumpTree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.dumpTree" title="Permalink to this definition">¶</a></dt> |
---|
1698 | <dd><p>Print out information on the data tree dicts loaded in loadTree</p> |
---|
1699 | </dd></dl> |
---|
1700 | |
---|
1701 | <dl class="method"> |
---|
1702 | <dt id="GSASIIIO.ExportBaseclass.loadParmDict"> |
---|
1703 | <tt class="descname">loadParmDict</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.loadParmDict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.loadParmDict" title="Permalink to this definition">¶</a></dt> |
---|
1704 | <dd><p>Load the GSAS-II refinable parameters from the tree into a dict (self.parmDict). Update |
---|
1705 | refined values to those from the last cycle and set the uncertainties for the |
---|
1706 | refined parameters in another dict (self.sigDict).</p> |
---|
1707 | <p>Expands the parm & sig dicts to include values derived from constraints.</p> |
---|
1708 | </dd></dl> |
---|
1709 | |
---|
1710 | <dl class="method"> |
---|
1711 | <dt id="GSASIIIO.ExportBaseclass.loadTree"> |
---|
1712 | <tt class="descname">loadTree</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExportBaseclass.loadTree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExportBaseclass.loadTree" title="Permalink to this definition">¶</a></dt> |
---|
1713 | <dd><p>Load the contents of the data tree into a set of dicts |
---|
1714 | (self.OverallParms, self.Phases and self.Histogram as well as self.powderDict |
---|
1715 | & self.xtalDict)</p> |
---|
1716 | <ul class="simple"> |
---|
1717 | <li>The childrenless data tree items are overall parameters/controls for the |
---|
1718 | entire project and are placed in self.OverallParms</li> |
---|
1719 | <li>Phase items are placed in self.Phases</li> |
---|
1720 | <li>Data items are placed in self.Histogram. The key for these data items |
---|
1721 | begin with a keyword, such as PWDR, IMG, HKLF,... that identifies the data type.</li> |
---|
1722 | </ul> |
---|
1723 | </dd></dl> |
---|
1724 | |
---|
1725 | </dd></dl> |
---|
1726 | |
---|
1727 | <dl class="function"> |
---|
1728 | <dt id="GSASIIIO.ExtractFileFromZip"> |
---|
1729 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">ExtractFileFromZip</tt><big>(</big><em>filename</em>, <em>selection=None</em>, <em>confirmread=True</em>, <em>confirmoverwrite=True</em>, <em>parent=None</em>, <em>multipleselect=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ExtractFileFromZip"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ExtractFileFromZip" title="Permalink to this definition">¶</a></dt> |
---|
1730 | <dd><p>If the filename is a zip file, extract a file from that |
---|
1731 | archive.</p> |
---|
1732 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1733 | <col class="field-name" /> |
---|
1734 | <col class="field-body" /> |
---|
1735 | <tbody valign="top"> |
---|
1736 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
1737 | <li><strong>Selection</strong> (<em>list</em>) – used to predefine the name of the file |
---|
1738 | to be extracted. Filename case and zip directory name are |
---|
1739 | ignored in selection; the first matching file is used.</li> |
---|
1740 | <li><strong>confirmread</strong> (<em>bool</em>) – if True asks the user to confirm before expanding |
---|
1741 | the only file in a zip</li> |
---|
1742 | <li><strong>confirmoverwrite</strong> (<em>bool</em>) – if True asks the user to confirm |
---|
1743 | before overwriting if the extracted file already exists</li> |
---|
1744 | <li><strong>multipleselect</strong> (<em>bool</em>) – if True allows more than one zip |
---|
1745 | file to be extracted, a list of file(s) is returned. |
---|
1746 | If only one file is present, do not ask which one, otherwise |
---|
1747 | offer a list of choices (unless selection is used).</li> |
---|
1748 | </ul> |
---|
1749 | </td> |
---|
1750 | </tr> |
---|
1751 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the name of the file that has been created or a |
---|
1752 | list of files (see multipleselect)</p> |
---|
1753 | </td> |
---|
1754 | </tr> |
---|
1755 | </tbody> |
---|
1756 | </table> |
---|
1757 | <p>If the file is not a zipfile, return the name of the input file. |
---|
1758 | If the zipfile is empty or no file has been selected, return None</p> |
---|
1759 | </dd></dl> |
---|
1760 | |
---|
1761 | <dl class="function"> |
---|
1762 | <dt id="GSASIIIO.FileDlgFixExt"> |
---|
1763 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">FileDlgFixExt</tt><big>(</big><em>dlg</em>, <em>file</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#FileDlgFixExt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.FileDlgFixExt" title="Permalink to this definition">¶</a></dt> |
---|
1764 | <dd><p>this is needed to fix a problem in linux wx.FileDialog</p> |
---|
1765 | </dd></dl> |
---|
1766 | |
---|
1767 | <dl class="function"> |
---|
1768 | <dt id="GSASIIIO.GetEdfData"> |
---|
1769 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">GetEdfData</tt><big>(</big><em>filename</em>, <em>imageOnly=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#GetEdfData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.GetEdfData" title="Permalink to this definition">¶</a></dt> |
---|
1770 | <dd><p>Read European detector data edf file</p> |
---|
1771 | </dd></dl> |
---|
1772 | |
---|
1773 | <dl class="function"> |
---|
1774 | <dt id="GSASIIIO.GetG2Image"> |
---|
1775 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">GetG2Image</tt><big>(</big><em>filename</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#GetG2Image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.GetG2Image" title="Permalink to this definition">¶</a></dt> |
---|
1776 | <dd><p>Read an image as a python pickle</p> |
---|
1777 | </dd></dl> |
---|
1778 | |
---|
1779 | <dl class="function"> |
---|
1780 | <dt id="GSASIIIO.GetGEsumData"> |
---|
1781 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">GetGEsumData</tt><big>(</big><em>filename</em>, <em>imageOnly=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#GetGEsumData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.GetGEsumData" title="Permalink to this definition">¶</a></dt> |
---|
1782 | <dd><p>Read SUM file as produced at 1-ID from G.E. images</p> |
---|
1783 | </dd></dl> |
---|
1784 | |
---|
1785 | <dl class="function"> |
---|
1786 | <dt id="GSASIIIO.GetImageData"> |
---|
1787 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">GetImageData</tt><big>(</big><em>G2frame</em>, <em>imagefile</em>, <em>imageOnly=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#GetImageData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.GetImageData" title="Permalink to this definition">¶</a></dt> |
---|
1788 | <dd><p>Read an image with the file reader keyed by the |
---|
1789 | file extension</p> |
---|
1790 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1791 | <col class="field-name" /> |
---|
1792 | <col class="field-body" /> |
---|
1793 | <tbody valign="top"> |
---|
1794 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
1795 | <li><strong>G2frame</strong> (<em>wx.Frame</em>) – main GSAS-II Frame and data object.</li> |
---|
1796 | <li><strong>imagefile</strong> (<em>str</em>) – name of image file</li> |
---|
1797 | <li><strong>imageOnly</strong> (<em>bool</em>) – If True return only the image, |
---|
1798 | otherwise (default) return more (see below)</li> |
---|
1799 | </ul> |
---|
1800 | </td> |
---|
1801 | </tr> |
---|
1802 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">an image as a numpy array or a list of four items: |
---|
1803 | Comments, Data, Npix and the Image, as selected by imageOnly</p> |
---|
1804 | </td> |
---|
1805 | </tr> |
---|
1806 | </tbody> |
---|
1807 | </table> |
---|
1808 | </dd></dl> |
---|
1809 | |
---|
1810 | <dl class="function"> |
---|
1811 | <dt id="GSASIIIO.GetImgData"> |
---|
1812 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">GetImgData</tt><big>(</big><em>filename</em>, <em>imageOnly=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#GetImgData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.GetImgData" title="Permalink to this definition">¶</a></dt> |
---|
1813 | <dd><p>Read an ADSC image file</p> |
---|
1814 | </dd></dl> |
---|
1815 | |
---|
1816 | <dl class="function"> |
---|
1817 | <dt id="GSASIIIO.GetMAR345Data"> |
---|
1818 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">GetMAR345Data</tt><big>(</big><em>filename</em>, <em>imageOnly=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#GetMAR345Data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.GetMAR345Data" title="Permalink to this definition">¶</a></dt> |
---|
1819 | <dd><p>Read a MAR-345 image plate image</p> |
---|
1820 | </dd></dl> |
---|
1821 | |
---|
1822 | <dl class="function"> |
---|
1823 | <dt id="GSASIIIO.GetPNGData"> |
---|
1824 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">GetPNGData</tt><big>(</big><em>filename</em>, <em>imageOnly=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#GetPNGData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.GetPNGData" title="Permalink to this definition">¶</a></dt> |
---|
1825 | <dd><p>Read an image in a png format, assumes image is converted from CheMin tif file |
---|
1826 | so default parameters are that machine.</p> |
---|
1827 | </dd></dl> |
---|
1828 | |
---|
1829 | <dl class="function"> |
---|
1830 | <dt id="GSASIIIO.GetPowderPeaks"> |
---|
1831 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">GetPowderPeaks</tt><big>(</big><em>fileName</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#GetPowderPeaks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.GetPowderPeaks" title="Permalink to this definition">¶</a></dt> |
---|
1832 | <dd><p>Read powder peaks from a file</p> |
---|
1833 | </dd></dl> |
---|
1834 | |
---|
1835 | <dl class="function"> |
---|
1836 | <dt id="GSASIIIO.GetTifData"> |
---|
1837 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">GetTifData</tt><big>(</big><em>filename</em>, <em>imageOnly=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#GetTifData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.GetTifData" title="Permalink to this definition">¶</a></dt> |
---|
1838 | <dd><p>Read an image in a pseudo-tif format, |
---|
1839 | as produced by a wide variety of software, almost always |
---|
1840 | incorrectly in some way.</p> |
---|
1841 | </dd></dl> |
---|
1842 | |
---|
1843 | <dl class="class"> |
---|
1844 | <dt id="GSASIIIO.ImportBaseclass"> |
---|
1845 | <em class="property">class </em><tt class="descclassname">GSASIIIO.</tt><tt class="descname">ImportBaseclass</tt><big>(</big><em>formatName</em>, <em>longFormatName=None</em>, <em>extensionlist=</em>, <span class="optional">[</span><span class="optional">]</span><em>strictExtension=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportBaseclass"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportBaseclass" title="Permalink to this definition">¶</a></dt> |
---|
1846 | <dd><p>Defines a base class for the reading of input files (diffraction |
---|
1847 | data, coordinates,...). See <a class="reference internal" href="imports.html#import-routines"><em>Writing a Import Routine</em></a> |
---|
1848 | for an explanation on how to use a subclass of this class.</p> |
---|
1849 | <dl class="method"> |
---|
1850 | <dt id="GSASIIIO.ImportBaseclass.BlockSelector"> |
---|
1851 | <tt class="descname">BlockSelector</tt><big>(</big><em>ChoiceList</em>, <em>ParentFrame=None</em>, <em>title='Select a block'</em>, <em>size=None</em>, <em>header='Block Selector'</em>, <em>useCancel=True</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportBaseclass.BlockSelector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportBaseclass.BlockSelector" title="Permalink to this definition">¶</a></dt> |
---|
1852 | <dd><p>Provide a wx dialog to select a block if the file contains more |
---|
1853 | than one set of data and one must be selected</p> |
---|
1854 | </dd></dl> |
---|
1855 | |
---|
1856 | <dl class="method"> |
---|
1857 | <dt id="GSASIIIO.ImportBaseclass.CIFValidator"> |
---|
1858 | <tt class="descname">CIFValidator</tt><big>(</big><em>filepointer</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportBaseclass.CIFValidator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportBaseclass.CIFValidator" title="Permalink to this definition">¶</a></dt> |
---|
1859 | <dd><p>A <a class="reference internal" href="#GSASIIIO.ImportBaseclass.ContentsValidator" title="GSASIIIO.ImportBaseclass.ContentsValidator"><tt class="xref py py-meth docutils literal"><span class="pre">ContentsValidator()</span></tt></a> for use to validate CIF files.</p> |
---|
1860 | </dd></dl> |
---|
1861 | |
---|
1862 | <dl class="method"> |
---|
1863 | <dt id="GSASIIIO.ImportBaseclass.ContentsValidator"> |
---|
1864 | <tt class="descname">ContentsValidator</tt><big>(</big><em>filepointer</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportBaseclass.ContentsValidator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportBaseclass.ContentsValidator" title="Permalink to this definition">¶</a></dt> |
---|
1865 | <dd><p>This routine will attempt to determine if the file can be read |
---|
1866 | with the current format. |
---|
1867 | This will typically be overridden with a method that |
---|
1868 | takes a quick scan of [some of] |
---|
1869 | the file contents to do a “sanity” check if the file |
---|
1870 | appears to match the selected format. |
---|
1871 | Expected to be called via self.Validator()</p> |
---|
1872 | </dd></dl> |
---|
1873 | |
---|
1874 | <dl class="method"> |
---|
1875 | <dt id="GSASIIIO.ImportBaseclass.ExtensionValidator"> |
---|
1876 | <tt class="descname">ExtensionValidator</tt><big>(</big><em>filename</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportBaseclass.ExtensionValidator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportBaseclass.ExtensionValidator" title="Permalink to this definition">¶</a></dt> |
---|
1877 | <dd><p>This methods checks if the file has the correct extension |
---|
1878 | Return False if this filename will not be supported by this reader |
---|
1879 | Return True if the extension matches the list supplied by the reader |
---|
1880 | Return None if the reader allows un-registered extensions</p> |
---|
1881 | </dd></dl> |
---|
1882 | |
---|
1883 | <dl class="exception"> |
---|
1884 | <dt id="GSASIIIO.ImportBaseclass.ImportException"> |
---|
1885 | <em class="property">exception </em><tt class="descname">ImportException</tt><a class="reference internal" href="_modules/GSASIIIO.html#ImportBaseclass.ImportException"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportBaseclass.ImportException" title="Permalink to this definition">¶</a></dt> |
---|
1886 | <dd><p>Defines an Exception that is used when an import routine hits an expected error, |
---|
1887 | usually in .Reader.</p> |
---|
1888 | <p>Good practice is that the Reader should define a value in self.errors that |
---|
1889 | tells the user some information about what is wrong with their file.</p> |
---|
1890 | </dd></dl> |
---|
1891 | |
---|
1892 | <dl class="method"> |
---|
1893 | <dt id="GSASIIIO.ImportBaseclass.MultipleBlockSelector"> |
---|
1894 | <tt class="descclassname">ImportBaseclass.</tt><tt class="descname">MultipleBlockSelector</tt><big>(</big><em>ChoiceList</em>, <em>ParentFrame=None</em>, <em>title='Select a block'</em>, <em>size=None</em>, <em>header='Block Selector'</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportBaseclass.MultipleBlockSelector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportBaseclass.MultipleBlockSelector" title="Permalink to this definition">¶</a></dt> |
---|
1895 | <dd><p>Provide a wx dialog to select a block of data if the |
---|
1896 | file contains more than one set of data and one must be |
---|
1897 | selected.</p> |
---|
1898 | <table class="docutils field-list" frame="void" rules="none"> |
---|
1899 | <col class="field-name" /> |
---|
1900 | <col class="field-body" /> |
---|
1901 | <tbody valign="top"> |
---|
1902 | <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a list of the selected blocks</td> |
---|
1903 | </tr> |
---|
1904 | </tbody> |
---|
1905 | </table> |
---|
1906 | </dd></dl> |
---|
1907 | |
---|
1908 | <dl class="method"> |
---|
1909 | <dt id="GSASIIIO.ImportBaseclass.MultipleChoicesDialog"> |
---|
1910 | <tt class="descclassname">ImportBaseclass.</tt><tt class="descname">MultipleChoicesDialog</tt><big>(</big><em>choicelist</em>, <em>headinglist</em>, <em>ParentFrame=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportBaseclass.MultipleChoicesDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportBaseclass.MultipleChoicesDialog" title="Permalink to this definition">¶</a></dt> |
---|
1911 | <dd><p>A modal dialog that offers a series of choices, each with a title and a wx.Choice |
---|
1912 | widget. Typical input:</p> |
---|
1913 | <blockquote> |
---|
1914 | <div><ul class="simple"> |
---|
1915 | <li>choicelist=[ (‘a’,’b’,’c’), (‘test1’,’test2’),(‘no choice’,)]</li> |
---|
1916 | <li>headinglist = [ ‘select a, b or c’, ‘select 1 of 2’, ‘No option here’]</li> |
---|
1917 | </ul> |
---|
1918 | </div></blockquote> |
---|
1919 | <p>optional keyword parameters are: head (window title) and title |
---|
1920 | returns a list of selected indicies for each choice (or None)</p> |
---|
1921 | </dd></dl> |
---|
1922 | |
---|
1923 | <dl class="method"> |
---|
1924 | <dt id="GSASIIIO.ImportBaseclass.ReInitialize"> |
---|
1925 | <tt class="descclassname">ImportBaseclass.</tt><tt class="descname">ReInitialize</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportBaseclass.ReInitialize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportBaseclass.ReInitialize" title="Permalink to this definition">¶</a></dt> |
---|
1926 | <dd><p>Reinitialize the Reader to initial settings</p> |
---|
1927 | </dd></dl> |
---|
1928 | |
---|
1929 | </dd></dl> |
---|
1930 | |
---|
1931 | <dl class="class"> |
---|
1932 | <dt id="GSASIIIO.ImportPhase"> |
---|
1933 | <em class="property">class </em><tt class="descclassname">GSASIIIO.</tt><tt class="descname">ImportPhase</tt><big>(</big><em>formatName</em>, <em>longFormatName=None</em>, <em>extensionlist=</em>, <span class="optional">[</span><span class="optional">]</span><em>strictExtension=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportPhase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportPhase" title="Permalink to this definition">¶</a></dt> |
---|
1934 | <dd><p>Defines a base class for the reading of files with coordinates</p> |
---|
1935 | <p>Objects constructed that subclass this (in import/G2phase_*.py etc.) will be used |
---|
1936 | in <a class="reference internal" href="GSASII.html#GSASII.GSASII.OnImportPhase" title="GSASII.GSASII.OnImportPhase"><tt class="xref py py-meth docutils literal"><span class="pre">GSASII.GSASII.OnImportPhase()</span></tt></a>. |
---|
1937 | See <a class="reference internal" href="imports.html#import-routines"><em>Writing a Import Routine</em></a> |
---|
1938 | for an explanation on how to use this class.</p> |
---|
1939 | <dl class="method"> |
---|
1940 | <dt id="GSASIIIO.ImportPhase.PhaseSelector"> |
---|
1941 | <tt class="descname">PhaseSelector</tt><big>(</big><em>ChoiceList</em>, <em>ParentFrame=None</em>, <em>title='Select a phase'</em>, <em>size=None</em>, <em>header='Phase Selector'</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportPhase.PhaseSelector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportPhase.PhaseSelector" title="Permalink to this definition">¶</a></dt> |
---|
1942 | <dd><p>Provide a wx dialog to select a phase if the file contains more |
---|
1943 | than one phase</p> |
---|
1944 | </dd></dl> |
---|
1945 | |
---|
1946 | </dd></dl> |
---|
1947 | |
---|
1948 | <dl class="class"> |
---|
1949 | <dt id="GSASIIIO.ImportPowderData"> |
---|
1950 | <em class="property">class </em><tt class="descclassname">GSASIIIO.</tt><tt class="descname">ImportPowderData</tt><big>(</big><em>formatName</em>, <em>longFormatName=None</em>, <em>extensionlist=</em>, <span class="optional">[</span><span class="optional">]</span><em>strictExtension=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportPowderData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportPowderData" title="Permalink to this definition">¶</a></dt> |
---|
1951 | <dd><p>Defines a base class for the reading of files with powder data.</p> |
---|
1952 | <p>Objects constructed that subclass this (in import/G2pwd_*.py etc.) will be used |
---|
1953 | in <a class="reference internal" href="GSASII.html#GSASII.GSASII.OnImportPowder" title="GSASII.GSASII.OnImportPowder"><tt class="xref py py-meth docutils literal"><span class="pre">GSASII.GSASII.OnImportPowder()</span></tt></a>. |
---|
1954 | See <a class="reference internal" href="imports.html#import-routines"><em>Writing a Import Routine</em></a> |
---|
1955 | for an explanation on how to use this class.</p> |
---|
1956 | <dl class="method"> |
---|
1957 | <dt id="GSASIIIO.ImportPowderData.ReInitialize"> |
---|
1958 | <tt class="descname">ReInitialize</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportPowderData.ReInitialize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportPowderData.ReInitialize" title="Permalink to this definition">¶</a></dt> |
---|
1959 | <dd><p>Reinitialize the Reader to initial settings</p> |
---|
1960 | </dd></dl> |
---|
1961 | |
---|
1962 | </dd></dl> |
---|
1963 | |
---|
1964 | <dl class="class"> |
---|
1965 | <dt id="GSASIIIO.ImportSmallAngleData"> |
---|
1966 | <em class="property">class </em><tt class="descclassname">GSASIIIO.</tt><tt class="descname">ImportSmallAngleData</tt><big>(</big><em>formatName</em>, <em>longFormatName=None</em>, <em>extensionlist=</em>, <span class="optional">[</span><span class="optional">]</span><em>strictExtension=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportSmallAngleData"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportSmallAngleData" title="Permalink to this definition">¶</a></dt> |
---|
1967 | <dd><p>Defines a base class for the reading of files with small angle data. |
---|
1968 | See <a class="reference internal" href="imports.html#import-routines"><em>Writing a Import Routine</em></a> |
---|
1969 | for an explanation on how to use this class.</p> |
---|
1970 | <dl class="method"> |
---|
1971 | <dt id="GSASIIIO.ImportSmallAngleData.ReInitialize"> |
---|
1972 | <tt class="descname">ReInitialize</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportSmallAngleData.ReInitialize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportSmallAngleData.ReInitialize" title="Permalink to this definition">¶</a></dt> |
---|
1973 | <dd><p>Reinitialize the Reader to initial settings</p> |
---|
1974 | </dd></dl> |
---|
1975 | |
---|
1976 | </dd></dl> |
---|
1977 | |
---|
1978 | <dl class="class"> |
---|
1979 | <dt id="GSASIIIO.ImportStructFactor"> |
---|
1980 | <em class="property">class </em><tt class="descclassname">GSASIIIO.</tt><tt class="descname">ImportStructFactor</tt><big>(</big><em>formatName</em>, <em>longFormatName=None</em>, <em>extensionlist=</em>, <span class="optional">[</span><span class="optional">]</span><em>strictExtension=False</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportStructFactor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportStructFactor" title="Permalink to this definition">¶</a></dt> |
---|
1981 | <dd><p>Defines a base class for the reading of files with tables |
---|
1982 | of structure factors.</p> |
---|
1983 | <p>Structure factors are read with a call to <a class="reference internal" href="GSASII.html#GSASII.GSASII.OnImportSfact" title="GSASII.GSASII.OnImportSfact"><tt class="xref py py-meth docutils literal"><span class="pre">GSASII.GSASII.OnImportSfact()</span></tt></a> |
---|
1984 | which in turn calls <a class="reference internal" href="GSASII.html#GSASII.GSASII.OnImportGeneric" title="GSASII.GSASII.OnImportGeneric"><tt class="xref py py-meth docutils literal"><span class="pre">GSASII.GSASII.OnImportGeneric()</span></tt></a>, which calls |
---|
1985 | methods <tt class="xref py py-meth docutils literal"><span class="pre">ExtensionValidator()</span></tt>, <tt class="xref py py-meth docutils literal"><span class="pre">ContentsValidator()</span></tt> and |
---|
1986 | <tt class="xref py py-meth docutils literal"><span class="pre">Reader()</span></tt>.</p> |
---|
1987 | <p>See <a class="reference internal" href="imports.html#import-routines"><em>Writing a Import Routine</em></a> |
---|
1988 | for an explanation on how to use import classes in general. The specifics |
---|
1989 | for reading a structure factor histogram require that |
---|
1990 | the <tt class="docutils literal"><span class="pre">Reader()</span></tt> routine in the import |
---|
1991 | class need to do only a few things: It |
---|
1992 | should load <tt class="xref py py-attr docutils literal"><span class="pre">RefDict</span></tt> item <tt class="docutils literal"><span class="pre">'RefList'</span></tt> with the reflection list, |
---|
1993 | and set <a class="reference internal" href="#GSASIIIO.ImportStructFactor.Parameters" title="GSASIIIO.ImportStructFactor.Parameters"><tt class="xref py py-attr docutils literal"><span class="pre">Parameters</span></tt></a> with the instrument parameters |
---|
1994 | (initialized with <a class="reference internal" href="#GSASIIIO.ImportStructFactor.InitParameters" title="GSASIIIO.ImportStructFactor.InitParameters"><tt class="xref py py-meth docutils literal"><span class="pre">InitParameters()</span></tt></a> and set with <a class="reference internal" href="#GSASIIIO.ImportStructFactor.UpdateParameters" title="GSASIIIO.ImportStructFactor.UpdateParameters"><tt class="xref py py-meth docutils literal"><span class="pre">UpdateParameters()</span></tt></a>).</p> |
---|
1995 | <dl class="attribute"> |
---|
1996 | <dt id="GSASIIIO.ImportStructFactor.Banks"> |
---|
1997 | <tt class="descname">Banks</tt><em class="property"> = None</em><a class="headerlink" href="#GSASIIIO.ImportStructFactor.Banks" title="Permalink to this definition">¶</a></dt> |
---|
1998 | <dd><p>self.RefDict is a dict containing the reflection information, as read from the file. |
---|
1999 | Item ‘RefList’ contains the reflection information. See the |
---|
2000 | <a class="reference internal" href="GSASIIobj.html#xtalrefl-table"><em>Single Crystal Reflection Data Structure</em></a> |
---|
2001 | for the contents of each row. Dict element ‘FF’ |
---|
2002 | contains the form factor values for each element type; if this entry |
---|
2003 | is left as initialized (an empty list) it will be initialized as needed later.</p> |
---|
2004 | </dd></dl> |
---|
2005 | |
---|
2006 | <dl class="method"> |
---|
2007 | <dt id="GSASIIIO.ImportStructFactor.InitParameters"> |
---|
2008 | <tt class="descname">InitParameters</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportStructFactor.InitParameters"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportStructFactor.InitParameters" title="Permalink to this definition">¶</a></dt> |
---|
2009 | <dd><p>initialize the instrument parameters structure</p> |
---|
2010 | </dd></dl> |
---|
2011 | |
---|
2012 | <dl class="attribute"> |
---|
2013 | <dt id="GSASIIIO.ImportStructFactor.Parameters"> |
---|
2014 | <tt class="descname">Parameters</tt><em class="property"> = None</em><a class="headerlink" href="#GSASIIIO.ImportStructFactor.Parameters" title="Permalink to this definition">¶</a></dt> |
---|
2015 | <dd><p>self.Parameters is a list with two dicts for data parameter settings</p> |
---|
2016 | </dd></dl> |
---|
2017 | |
---|
2018 | <dl class="method"> |
---|
2019 | <dt id="GSASIIIO.ImportStructFactor.ReInitialize"> |
---|
2020 | <tt class="descname">ReInitialize</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportStructFactor.ReInitialize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportStructFactor.ReInitialize" title="Permalink to this definition">¶</a></dt> |
---|
2021 | <dd><p>Reinitialize the Reader to initial settings</p> |
---|
2022 | </dd></dl> |
---|
2023 | |
---|
2024 | <dl class="method"> |
---|
2025 | <dt id="GSASIIIO.ImportStructFactor.UpdateParameters"> |
---|
2026 | <tt class="descname">UpdateParameters</tt><big>(</big><em>Type=None</em>, <em>Wave=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ImportStructFactor.UpdateParameters"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ImportStructFactor.UpdateParameters" title="Permalink to this definition">¶</a></dt> |
---|
2027 | <dd><p>Revise the instrument parameters</p> |
---|
2028 | </dd></dl> |
---|
2029 | |
---|
2030 | </dd></dl> |
---|
2031 | |
---|
2032 | <dl class="function"> |
---|
2033 | <dt id="GSASIIIO.IndexPeakListSave"> |
---|
2034 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">IndexPeakListSave</tt><big>(</big><em>G2frame</em>, <em>peaks</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#IndexPeakListSave"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.IndexPeakListSave" title="Permalink to this definition">¶</a></dt> |
---|
2035 | <dd><p>Save powder peaks from the indexing list</p> |
---|
2036 | </dd></dl> |
---|
2037 | |
---|
2038 | <dl class="class"> |
---|
2039 | <dt id="GSASIIIO.MultipleChoicesDialog"> |
---|
2040 | <em class="property">class </em><tt class="descclassname">GSASIIIO.</tt><tt class="descname">MultipleChoicesDialog</tt><big>(</big><em>choicelist</em>, <em>headinglist</em>, <em>head='Select options'</em>, <em>title='Please select from options below'</em>, <em>parent=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#MultipleChoicesDialog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.MultipleChoicesDialog" title="Permalink to this definition">¶</a></dt> |
---|
2041 | <dd><p>A dialog that offers a series of choices, each with a |
---|
2042 | title and a wx.Choice widget. Intended to be used Modally. |
---|
2043 | typical input:</p> |
---|
2044 | <blockquote> |
---|
2045 | <div><ul class="simple"> |
---|
2046 | <li>choicelist=[ (‘a’,’b’,’c’), (‘test1’,’test2’),(‘no choice’,)]</li> |
---|
2047 | <li>headinglist = [ ‘select a, b or c’, ‘select 1 of 2’, ‘No option here’]</li> |
---|
2048 | </ul> |
---|
2049 | </div></blockquote> |
---|
2050 | <p>selections are placed in self.chosen when OK is pressed</p> |
---|
2051 | </dd></dl> |
---|
2052 | |
---|
2053 | <dl class="function"> |
---|
2054 | <dt id="GSASIIIO.PDFSave"> |
---|
2055 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">PDFSave</tt><big>(</big><em>G2frame</em>, <em>exports</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#PDFSave"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.PDFSave" title="Permalink to this definition">¶</a></dt> |
---|
2056 | <dd><p>Save a PDF G(r) and S(Q) in column formats</p> |
---|
2057 | </dd></dl> |
---|
2058 | |
---|
2059 | <dl class="function"> |
---|
2060 | <dt id="GSASIIIO.PeakListSave"> |
---|
2061 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">PeakListSave</tt><big>(</big><em>G2frame</em>, <em>file</em>, <em>peaks</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#PeakListSave"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.PeakListSave" title="Permalink to this definition">¶</a></dt> |
---|
2062 | <dd><p>Save powder peaks to a data file</p> |
---|
2063 | </dd></dl> |
---|
2064 | |
---|
2065 | <dl class="function"> |
---|
2066 | <dt id="GSASIIIO.ProjFileOpen"> |
---|
2067 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">ProjFileOpen</tt><big>(</big><em>G2frame</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ProjFileOpen"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ProjFileOpen" title="Permalink to this definition">¶</a></dt> |
---|
2068 | <dd><p>Read a GSAS-II project file and load into the G2 data tree</p> |
---|
2069 | </dd></dl> |
---|
2070 | |
---|
2071 | <dl class="function"> |
---|
2072 | <dt id="GSASIIIO.ProjFileSave"> |
---|
2073 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">ProjFileSave</tt><big>(</big><em>G2frame</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ProjFileSave"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ProjFileSave" title="Permalink to this definition">¶</a></dt> |
---|
2074 | <dd><p>Save a GSAS-II project file</p> |
---|
2075 | </dd></dl> |
---|
2076 | |
---|
2077 | <dl class="function"> |
---|
2078 | <dt id="GSASIIIO.PutG2Image"> |
---|
2079 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">PutG2Image</tt><big>(</big><em>filename</em>, <em>Comments</em>, <em>Data</em>, <em>Npix</em>, <em>image</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#PutG2Image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.PutG2Image" title="Permalink to this definition">¶</a></dt> |
---|
2080 | <dd><p>Write an image as a python pickle - might be better as an .edf file?</p> |
---|
2081 | </dd></dl> |
---|
2082 | |
---|
2083 | <dl class="function"> |
---|
2084 | <dt id="GSASIIIO.ReadCIF"> |
---|
2085 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">ReadCIF</tt><big>(</big><em>URLorFile</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#ReadCIF"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.ReadCIF" title="Permalink to this definition">¶</a></dt> |
---|
2086 | <dd><p>Open a CIF, which may be specified as a file name or as a URL using PyCifRW |
---|
2087 | (from James Hester). |
---|
2088 | The open routine gets confused with DOS names that begin with a letter and colon |
---|
2089 | “C:dir” so this routine will try to open the passed name as a file and if that |
---|
2090 | fails, try it as a URL</p> |
---|
2091 | <table class="docutils field-list" frame="void" rules="none"> |
---|
2092 | <col class="field-name" /> |
---|
2093 | <col class="field-body" /> |
---|
2094 | <tbody valign="top"> |
---|
2095 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>URLorFile</strong> (<em>str</em>) – string containing a URL or a file name. Code will try first |
---|
2096 | to open it as a file and then as a URL.</td> |
---|
2097 | </tr> |
---|
2098 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a PyCifRW CIF object.</td> |
---|
2099 | </tr> |
---|
2100 | </tbody> |
---|
2101 | </table> |
---|
2102 | </dd></dl> |
---|
2103 | |
---|
2104 | <dl class="function"> |
---|
2105 | <dt id="GSASIIIO.SaveIntegration"> |
---|
2106 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">SaveIntegration</tt><big>(</big><em>G2frame</em>, <em>PickId</em>, <em>data</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#SaveIntegration"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.SaveIntegration" title="Permalink to this definition">¶</a></dt> |
---|
2107 | <dd><p>Save image integration results as powder pattern(s)</p> |
---|
2108 | </dd></dl> |
---|
2109 | |
---|
2110 | <dl class="function"> |
---|
2111 | <dt id="GSASIIIO.SetNewPhase"> |
---|
2112 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">SetNewPhase</tt><big>(</big><em>Name='New Phase'</em>, <em>SGData=None</em>, <em>cell=None</em>, <em>Super=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#SetNewPhase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.SetNewPhase" title="Permalink to this definition">¶</a></dt> |
---|
2113 | <dd><p>Create a new phase dict with default values for various parameters</p> |
---|
2114 | <table class="docutils field-list" frame="void" rules="none"> |
---|
2115 | <col class="field-name" /> |
---|
2116 | <col class="field-body" /> |
---|
2117 | <tbody valign="top"> |
---|
2118 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
2119 | <li><strong>Name</strong> (<em>str</em>) – Name for new Phase</li> |
---|
2120 | <li><strong>SGData</strong> (<em>dict</em>) – space group data from <tt class="xref py py-func docutils literal"><span class="pre">GSASIIspc:SpcGroup()</span></tt>; |
---|
2121 | defaults to data for P 1</li> |
---|
2122 | <li><strong>cell</strong> (<em>list</em>) – unit cell parameter list; defaults to |
---|
2123 | [1.0,1.0,1.0,90.,90,90.,1.]</li> |
---|
2124 | </ul> |
---|
2125 | </td> |
---|
2126 | </tr> |
---|
2127 | </tbody> |
---|
2128 | </table> |
---|
2129 | </dd></dl> |
---|
2130 | |
---|
2131 | <dl class="function"> |
---|
2132 | <dt id="GSASIIIO.sfloat"> |
---|
2133 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">sfloat</tt><big>(</big><em>S</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#sfloat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.sfloat" title="Permalink to this definition">¶</a></dt> |
---|
2134 | <dd><p>Convert a string to float. An empty field is treated as zero</p> |
---|
2135 | </dd></dl> |
---|
2136 | |
---|
2137 | <dl class="function"> |
---|
2138 | <dt id="GSASIIIO.sint"> |
---|
2139 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">sint</tt><big>(</big><em>S</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#sint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.sint" title="Permalink to this definition">¶</a></dt> |
---|
2140 | <dd><p>Convert a string to int. An empty field is treated as zero</p> |
---|
2141 | </dd></dl> |
---|
2142 | |
---|
2143 | <dl class="function"> |
---|
2144 | <dt id="GSASIIIO.trim"> |
---|
2145 | <tt class="descclassname">GSASIIIO.</tt><tt class="descname">trim</tt><big>(</big><em>val</em><big>)</big><a class="reference internal" href="_modules/GSASIIIO.html#trim"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIIO.trim" title="Permalink to this definition">¶</a></dt> |
---|
2146 | <dd><p>Simplify a string containing leading and trailing spaces |
---|
2147 | as well as newlines, tabs, repeated spaces etc. into a shorter and |
---|
2148 | more simple string, by replacing all ranges of whitespace |
---|
2149 | characters with a single space.</p> |
---|
2150 | <table class="docutils field-list" frame="void" rules="none"> |
---|
2151 | <col class="field-name" /> |
---|
2152 | <col class="field-body" /> |
---|
2153 | <tbody valign="top"> |
---|
2154 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>val</strong> (<em>str</em>) – the string to be simplified</td> |
---|
2155 | </tr> |
---|
2156 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">the (usually) shortened version of the string</td> |
---|
2157 | </tr> |
---|
2158 | </tbody> |
---|
2159 | </table> |
---|
2160 | </dd></dl> |
---|
2161 | |
---|
2162 | </div> |
---|
2163 | <span class="target" id="module-ReadMarCCDFrame"></span><div class="section" id="readmarccdframe-read-mar-files"> |
---|
2164 | <h2><em>ReadMarCCDFrame: Read Mar Files</em><a class="headerlink" href="#readmarccdframe-read-mar-files" title="Permalink to this headline">¶</a></h2> |
---|
2165 | <dl class="class"> |
---|
2166 | <dt id="ReadMarCCDFrame.marFrame"> |
---|
2167 | <em class="property">class </em><tt class="descclassname">ReadMarCCDFrame.</tt><tt class="descname">marFrame</tt><big>(</big><em>File</em>, <em>byteOrd='<'</em>, <em>IFD={}</em><big>)</big><a class="reference internal" href="_modules/ReadMarCCDFrame.html#marFrame"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ReadMarCCDFrame.marFrame" title="Permalink to this definition">¶</a></dt> |
---|
2168 | <dd><p>A class to extract correct mar header and image info from a MarCCD file</p> |
---|
2169 | <table class="docutils field-list" frame="void" rules="none"> |
---|
2170 | <col class="field-name" /> |
---|
2171 | <col class="field-body" /> |
---|
2172 | <tbody valign="top"> |
---|
2173 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> |
---|
2174 | <li><strong>File</strong> (<em>str</em>) – file object [from open()]</li> |
---|
2175 | <li><strong>byteOrd</strong> – ‘<’ (default) or ‘>’</li> |
---|
2176 | <li><strong>IFD</strong> (<em>dict</em>) – <p>?</p> |
---|
2177 | </li> |
---|
2178 | </ul> |
---|
2179 | </td> |
---|
2180 | </tr> |
---|
2181 | </tbody> |
---|
2182 | </table> |
---|
2183 | </dd></dl> |
---|
2184 | |
---|
2185 | </div> |
---|
2186 | <span class="target" id="module-GSASIIpy3"></span><div class="section" id="gsasiipy3-python-3-x-routines"> |
---|
2187 | <h2><em>GSASIIpy3: Python 3.x Routines</em><a class="headerlink" href="#gsasiipy3-python-3-x-routines" title="Permalink to this headline">¶</a></h2> |
---|
2188 | <p>Module to hold python 3-compatible code, to keep it separate from |
---|
2189 | code that will break with __future__ options.</p> |
---|
2190 | <dl class="function"> |
---|
2191 | <dt id="GSASIIpy3.FormatPadValue"> |
---|
2192 | <tt class="descclassname">GSASIIpy3.</tt><tt class="descname">FormatPadValue</tt><big>(</big><em>val</em>, <em>maxdigits=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIpy3.html#FormatPadValue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIpy3.FormatPadValue" title="Permalink to this definition">¶</a></dt> |
---|
2193 | <dd><p>Format a float to fit in <tt class="docutils literal"><span class="pre">maxdigits[0]</span></tt> spaces with maxdigits[1] after decimal.</p> |
---|
2194 | <table class="docutils field-list" frame="void" rules="none"> |
---|
2195 | <col class="field-name" /> |
---|
2196 | <col class="field-body" /> |
---|
2197 | <tbody valign="top"> |
---|
2198 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
2199 | <li><strong>val</strong> (<em>float</em>) – number to be formatted.</li> |
---|
2200 | <li><strong>maxdigits</strong> (<em>list</em>) – the number of digits & places after decimal to be used for display of the |
---|
2201 | number (defaults to [10,2]).</li> |
---|
2202 | </ul> |
---|
2203 | </td> |
---|
2204 | </tr> |
---|
2205 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a string with exactly maxdigits[0] characters (except under error conditions), |
---|
2206 | but last character will always be a space</p> |
---|
2207 | </td> |
---|
2208 | </tr> |
---|
2209 | </tbody> |
---|
2210 | </table> |
---|
2211 | </dd></dl> |
---|
2212 | |
---|
2213 | <dl class="function"> |
---|
2214 | <dt id="GSASIIpy3.FormatSigFigs"> |
---|
2215 | <tt class="descclassname">GSASIIpy3.</tt><tt class="descname">FormatSigFigs</tt><big>(</big><em>val</em>, <em>maxdigits=10</em>, <em>sigfigs=5</em>, <em>treatAsZero=1e-20</em><big>)</big><a class="reference internal" href="_modules/GSASIIpy3.html#FormatSigFigs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIpy3.FormatSigFigs" title="Permalink to this definition">¶</a></dt> |
---|
2216 | <dd><p>Format a float to use <tt class="docutils literal"><span class="pre">maxdigits</span></tt> or fewer digits with <tt class="docutils literal"><span class="pre">sigfigs</span></tt> |
---|
2217 | significant digits showing (if room allows).</p> |
---|
2218 | <table class="docutils field-list" frame="void" rules="none"> |
---|
2219 | <col class="field-name" /> |
---|
2220 | <col class="field-body" /> |
---|
2221 | <tbody valign="top"> |
---|
2222 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
2223 | <li><strong>val</strong> (<em>float</em>) – number to be formatted.</li> |
---|
2224 | <li><strong>maxdigits</strong> (<em>int</em>) – the number of digits to be used for display of the |
---|
2225 | number (defaults to 10).</li> |
---|
2226 | <li><strong>sigfigs</strong> (<em>int</em>) – the number of significant figures to use, if room allows</li> |
---|
2227 | <li><strong>treatAsZero</strong> (<em>float</em>) – numbers that are less than this in magnitude |
---|
2228 | are treated as zero. Defaults to 1.0e-20, but this can be disabled |
---|
2229 | if set to None.</li> |
---|
2230 | </ul> |
---|
2231 | </td> |
---|
2232 | </tr> |
---|
2233 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a string with <= maxdigits characters (I hope).</p> |
---|
2234 | </td> |
---|
2235 | </tr> |
---|
2236 | </tbody> |
---|
2237 | </table> |
---|
2238 | </dd></dl> |
---|
2239 | |
---|
2240 | <dl class="function"> |
---|
2241 | <dt id="GSASIIpy3.FormatValue"> |
---|
2242 | <tt class="descclassname">GSASIIpy3.</tt><tt class="descname">FormatValue</tt><big>(</big><em>val</em>, <em>maxdigits=None</em><big>)</big><a class="reference internal" href="_modules/GSASIIpy3.html#FormatValue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIpy3.FormatValue" title="Permalink to this definition">¶</a></dt> |
---|
2243 | <dd><p>Format a float to fit in at most <tt class="docutils literal"><span class="pre">maxdigits[0]</span></tt> spaces with maxdigits[1] after decimal. |
---|
2244 | Note that this code has been hacked from FormatSigFigs and may have unused sections.</p> |
---|
2245 | <table class="docutils field-list" frame="void" rules="none"> |
---|
2246 | <col class="field-name" /> |
---|
2247 | <col class="field-body" /> |
---|
2248 | <tbody valign="top"> |
---|
2249 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
---|
2250 | <li><strong>val</strong> (<em>float</em>) – number to be formatted.</li> |
---|
2251 | <li><strong>maxdigits</strong> (<em>list</em>) – the number of digits & places after decimal to be used for display of the |
---|
2252 | number (defaults to [10,2]).</li> |
---|
2253 | </ul> |
---|
2254 | </td> |
---|
2255 | </tr> |
---|
2256 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a string with <= maxdigits characters (usually).</p> |
---|
2257 | </td> |
---|
2258 | </tr> |
---|
2259 | </tbody> |
---|
2260 | </table> |
---|
2261 | </dd></dl> |
---|
2262 | |
---|
2263 | <dl class="function"> |
---|
2264 | <dt id="GSASIIpy3.FormulaEval"> |
---|
2265 | <tt class="descclassname">GSASIIpy3.</tt><tt class="descname">FormulaEval</tt><big>(</big><em>string</em><big>)</big><a class="reference internal" href="_modules/GSASIIpy3.html#FormulaEval"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIIpy3.FormulaEval" title="Permalink to this definition">¶</a></dt> |
---|
2266 | <dd><p>Evaluates a algebraic formula into a float, if possible. Works |
---|
2267 | properly on fractions e.g. 2/3 only with python 3.0+ division.</p> |
---|
2268 | <p>Expressions such as 2/3, 3*pi, sin(45)/2, 2*sqrt(2), 2**10 can all |
---|
2269 | be evaluated.</p> |
---|
2270 | <table class="docutils field-list" frame="void" rules="none"> |
---|
2271 | <col class="field-name" /> |
---|
2272 | <col class="field-body" /> |
---|
2273 | <tbody valign="top"> |
---|
2274 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>string</strong> (<em>str</em>) – Character string containing a Python expression |
---|
2275 | to be evaluated.</td> |
---|
2276 | </tr> |
---|
2277 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">the value for the expression as a float or None if the expression does not |
---|
2278 | evaluate to a valid number.</td> |
---|
2279 | </tr> |
---|
2280 | </tbody> |
---|
2281 | </table> |
---|
2282 | </dd></dl> |
---|
2283 | |
---|
2284 | </div> |
---|
2285 | </div> |
---|
2286 | |
---|
2287 | |
---|
2288 | </div> |
---|
2289 | </div> |
---|
2290 | </div> |
---|
2291 | <div class="sphinxsidebar"> |
---|
2292 | <div class="sphinxsidebarwrapper"> |
---|
2293 | <p class="logo"><a href="index.html"> |
---|
2294 | <img class="logo" src="_static/G2_html_logo.png" alt="Logo"/> |
---|
2295 | </a></p> |
---|
2296 | <h3><a href="index.html">Table Of Contents</a></h3> |
---|
2297 | <ul> |
---|
2298 | <li><a class="reference internal" href="#"><em>GSAS-II GUI Routines</em></a><ul> |
---|
2299 | <li><a class="reference internal" href="#gsasiictrls-custom-gui-controls"><em>GSASIIctrls: Custom GUI controls</em></a></li> |
---|
2300 | <li><a class="reference internal" href="#gsasiigrid-basic-gui-routines"><em>GSASIIgrid: Basic GUI routines</em></a></li> |
---|
2301 | <li><a class="reference internal" href="#gsasiiio-misc-i-o-routines"><em>GSASIIIO: Misc I/O routines</em></a></li> |
---|
2302 | <li><a class="reference internal" href="#readmarccdframe-read-mar-files"><em>ReadMarCCDFrame: Read Mar Files</em></a></li> |
---|
2303 | <li><a class="reference internal" href="#gsasiipy3-python-3-x-routines"><em>GSASIIpy3: Python 3.x Routines</em></a></li> |
---|
2304 | </ul> |
---|
2305 | </li> |
---|
2306 | </ul> |
---|
2307 | |
---|
2308 | <h4>Previous topic</h4> |
---|
2309 | <p class="topless"><a href="GSASIIutil.html" |
---|
2310 | title="previous chapter"><em>GSAS-II Utility Modules</em></a></p> |
---|
2311 | <h4>Next topic</h4> |
---|
2312 | <p class="topless"><a href="GSASIIGUI.html" |
---|
2313 | title="next chapter"><em>GSAS-II GUI Submodules</em></a></p> |
---|
2314 | <h3>This Page</h3> |
---|
2315 | <ul class="this-page-menu"> |
---|
2316 | <li><a href="_sources/GSASIIGUIr.txt" |
---|
2317 | rel="nofollow">Show Source</a></li> |
---|
2318 | </ul> |
---|
2319 | <div id="searchbox" style="display: none"> |
---|
2320 | <h3>Quick search</h3> |
---|
2321 | <form class="search" action="search.html" method="get"> |
---|
2322 | <input type="text" name="q" /> |
---|
2323 | <input type="submit" value="Go" /> |
---|
2324 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
2325 | <input type="hidden" name="area" value="default" /> |
---|
2326 | </form> |
---|
2327 | <p class="searchtip" style="font-size: 90%"> |
---|
2328 | Enter search terms or a module, class or function name. |
---|
2329 | </p> |
---|
2330 | </div> |
---|
2331 | <script type="text/javascript">$('#searchbox').show(0);</script> |
---|
2332 | </div> |
---|
2333 | </div> |
---|
2334 | <div class="clearer"></div> |
---|
2335 | </div> |
---|
2336 | <div class="related"> |
---|
2337 | <h3>Navigation</h3> |
---|
2338 | <ul> |
---|
2339 | <li class="right" style="margin-right: 10px"> |
---|
2340 | <a href="genindex.html" title="General Index" |
---|
2341 | >index</a></li> |
---|
2342 | <li class="right" > |
---|
2343 | <a href="py-modindex.html" title="Python Module Index" |
---|
2344 | >modules</a> |</li> |
---|
2345 | <li class="right" > |
---|
2346 | <a href="GSASIIGUI.html" title="GSAS-II GUI Submodules" |
---|
2347 | >next</a> |</li> |
---|
2348 | <li class="right" > |
---|
2349 | <a href="GSASIIutil.html" title="GSAS-II Utility Modules" |
---|
2350 | >previous</a> |</li> |
---|
2351 | <li><a href="index.html">GSAS-II 0.2.0 documentation</a> »</li> |
---|
2352 | </ul> |
---|
2353 | </div> |
---|
2354 | <div class="footer"> |
---|
2355 | © Copyright 2013, Von Dreele and Toby for Argonne National Laboratory. |
---|
2356 | Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2. |
---|
2357 | </div> |
---|
2358 | </body> |
---|
2359 | </html> |
---|