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 Scripts — 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 Export Modules" href="exports.html" /> |
---|
29 | <link rel="prev" title="GSAS-II Small Angle Scattering Submodules" href="SAS.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="exports.html" title="GSAS-II Export Modules" |
---|
43 | accesskey="N">next</a> |</li> |
---|
44 | <li class="right" > |
---|
45 | <a href="SAS.html" title="GSAS-II Small Angle Scattering Submodules" |
---|
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-testDeriv"> |
---|
57 | <span id="gsas-ii-scripts"></span><h1><em>GSAS-II Scripts</em><a class="headerlink" href="#module-testDeriv" title="Permalink to this headline">¶</a></h1> |
---|
58 | <div class="section" id="testderiv-check-derivative-computation"> |
---|
59 | <h2><em>testDeriv: Check derivative computation</em><a class="headerlink" href="#testderiv-check-derivative-computation" title="Permalink to this headline">¶</a></h2> |
---|
60 | <p>Use this to check derivatives used in structure least squares |
---|
61 | refinement against numerical values computed in this script.</p> |
---|
62 | <p>To use set <tt class="docutils literal"><span class="pre">DEBUG=True</span></tt> in GSASIIstrMain.py (line 22, as of version |
---|
63 | 1110); run the least squares - one cycle is sufficient. Do the “Save |
---|
64 | Results”; this will write the file testDeriv.dat in the local |
---|
65 | directory.</p> |
---|
66 | <p>Then run this program to see plots of derivatives for all |
---|
67 | parameters refined in the last least squares. Shown will be numerical |
---|
68 | derivatives generated over all observations (including penalty terms) |
---|
69 | and the corresponding analytical ones produced in the least |
---|
70 | squares. They should match.</p> |
---|
71 | <dl class="function"> |
---|
72 | <dt id="testDeriv.main"> |
---|
73 | <tt class="descclassname">testDeriv.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/testDeriv.html#main"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#testDeriv.main" title="Permalink to this definition">¶</a></dt> |
---|
74 | <dd><p>Starts main application to compute and plot derivatives</p> |
---|
75 | </dd></dl> |
---|
76 | |
---|
77 | </div> |
---|
78 | <span class="target" id="module-GSASIItestplot"></span><div class="section" id="gsasiitestplot-plotting-for-testderiv"> |
---|
79 | <h2><em>GSASIItestplot: Plotting for testDeriv</em><a class="headerlink" href="#gsasiitestplot-plotting-for-testderiv" title="Permalink to this headline">¶</a></h2> |
---|
80 | <p>Plotting module used for script testDeriv.</p> |
---|
81 | <dl class="class"> |
---|
82 | <dt id="GSASIItestplot.Plot"> |
---|
83 | <em class="property">class </em><tt class="descclassname">GSASIItestplot.</tt><tt class="descname">Plot</tt><big>(</big><em>parent</em>, <em>id=-1</em>, <em>dpi=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/GSASIItestplot.html#Plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIItestplot.Plot" title="Permalink to this definition">¶</a></dt> |
---|
84 | <dd><p>Creates a plotting window</p> |
---|
85 | </dd></dl> |
---|
86 | |
---|
87 | <dl class="class"> |
---|
88 | <dt id="GSASIItestplot.PlotNotebook"> |
---|
89 | <em class="property">class </em><tt class="descclassname">GSASIItestplot.</tt><tt class="descname">PlotNotebook</tt><big>(</big><em>id=-1</em><big>)</big><a class="reference internal" href="_modules/GSASIItestplot.html#PlotNotebook"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#GSASIItestplot.PlotNotebook" title="Permalink to this definition">¶</a></dt> |
---|
90 | <dd><p>creates a Wx application and a plotting notebook</p> |
---|
91 | </dd></dl> |
---|
92 | |
---|
93 | </div> |
---|
94 | <span class="target" id="module-scanCCD"></span><div class="section" id="scanccd-reduce-data-from-scanning-ccd"> |
---|
95 | <h2><em>scanCCD: reduce data from scanning CCD</em><a class="headerlink" href="#scanccd-reduce-data-from-scanning-ccd" title="Permalink to this headline">¶</a></h2> |
---|
96 | <p>Quickly prototyped routine for reduction of data from detector described in |
---|
97 | B.H. Toby, T.J. Madden, M.R. Suchomel, J.D. Baldwin, and R.B. Von Dreele, |
---|
98 | “A Scanning CCD Detector for Powder Diffraction Measurements”. |
---|
99 | Journal of Applied Crystallography. 46(4): p. 1058-63 (2013).</p> |
---|
100 | <dl class="function"> |
---|
101 | <dt id="scanCCD.main"> |
---|
102 | <tt class="descclassname">scanCCD.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/scanCCD.html#main"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#scanCCD.main" title="Permalink to this definition">¶</a></dt> |
---|
103 | <dd><p>starts main application to merge data from scanning CCD</p> |
---|
104 | </dd></dl> |
---|
105 | |
---|
106 | </div> |
---|
107 | <span class="target" id="module-makeMacApp"></span><div class="section" id="makemacapp-create-mac-applet"> |
---|
108 | <h2><em>makeMacApp: Create Mac Applet</em><a class="headerlink" href="#makemacapp-create-mac-applet" title="Permalink to this headline">¶</a></h2> |
---|
109 | <p>This script creates an AppleScript app to launch GSAS-II. The app is |
---|
110 | created in the directory where the GSAS-II script is located. |
---|
111 | A softlink to Python is created, but is named GSAS-II, so that |
---|
112 | GSAS-II shows up as the name of the app rather than Python in the |
---|
113 | menu bar, etc. Note that this requires finding an app version of Python |
---|
114 | (expected name .../Resources/Python.app/Contents/MacOS/Python in |
---|
115 | directory tree of the calling python interpreter).</p> |
---|
116 | <p>Run this script with one optional argument, the path to the GSASII.py |
---|
117 | The script path may be specified relative to the current path or given |
---|
118 | an absolute path, but will be accessed via an absolute path. |
---|
119 | If no arguments are supplied, the GSASII.py script is assumed to be in the |
---|
120 | same directory as this file.</p> |
---|
121 | <dl class="data"> |
---|
122 | <dt id="makeMacApp.AppleScript"> |
---|
123 | <tt class="descclassname">makeMacApp.</tt><tt class="descname">AppleScript</tt><em class="property"> = '(* GSAS-II AppleScript by B. Toby (brian.toby@anl.gov)\n It can launch GSAS-II by double clicking or by dropping a data file\n or folder over the app.\n It runs GSAS-II in a terminal window.\n*)\n\n(* test if a file is present and exit with an error message if it is not *)\non TestFilePresent(appwithpath)\n\ttell application "System Events"\n\t\tif (file appwithpath exists) then\n\t\telse\n\t\t\tdisplay dialog "Error: file " & appwithpath & " not found. If you have moved this file recreate the AppleScript with bootstrap.py." with icon caution buttons {{"Quit"}}\n\t\t\treturn\n\t\tend if\n\tend tell\nend TestFilePresent\n\n(* \n------------------------------------------------------------------------\nthis section responds to a double-click. No file is supplied to GSAS-II\n------------------------------------------------------------------------ \n*)\non run\n\tset python to "{:s}"\n\tset appwithpath to "{:s}"\n\tset env to "{:s}"\n\tTestFilePresent(appwithpath)\n\tTestFilePresent(python)\n\ttell application "Terminal"\n\t\tactivate\n\t\tdo script env & python & " " & appwithpath & "; exit"\n\tend tell\nend run\n\n(*\n-----------------------------------------------------------------------------------------------\nthis section handles starting with files dragged into the AppleScript\n o it goes through the list of file(s) dragged in\n o then it converts the colon-delimited macintosh file location to a POSIX filename\n o for every non-directory file dragged into the icon, it starts GSAS-II, passing the file name\n------------------------------------------------------------------------------------------------\n*)\n\non open names\n\tset python to "{:s}"\n\tset appwithpath to "{:s}"\n\tset env to "{:s}"\n \n\tTestFilePresent(appwithpath)\n\trepeat with filename in names\n\t\tset filestr to (filename as string)\n\t\tif filestr ends with ":" then\n (* should not happen, skip directories *)\n\t\telse\n\t\t\t(* if this is an input file, open it *)\n\t\t\tset filename to the quoted form of the POSIX path of filename\n\t\t\ttell application "Terminal"\n\t\t\t\tactivate\n\t\t\t\tdo script env & python & " " & appwithpath & " " & filename & "; exit"\n\t\t\tend tell\n\t\tend if\n\tend repeat\nend open\n'</em><a class="headerlink" href="#makeMacApp.AppleScript" title="Permalink to this definition">¶</a></dt> |
---|
124 | <dd><p>Contains an AppleScript to start GSAS-II launching python and the |
---|
125 | GSAS-II python script</p> |
---|
126 | </dd></dl> |
---|
127 | |
---|
128 | <dl class="function"> |
---|
129 | <dt id="makeMacApp.RunPython"> |
---|
130 | <tt class="descclassname">makeMacApp.</tt><tt class="descname">RunPython</tt><big>(</big><em>image</em>, <em>cmd</em><big>)</big><a class="reference internal" href="_modules/makeMacApp.html#RunPython"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#makeMacApp.RunPython" title="Permalink to this definition">¶</a></dt> |
---|
131 | <dd><p>Run a command in a python image</p> |
---|
132 | </dd></dl> |
---|
133 | |
---|
134 | </div> |
---|
135 | <span class="target" id="module-unit_tests"></span><div class="section" id="unit-tests-self-test-module"> |
---|
136 | <h2><em>unit_tests: Self-test Module</em><a class="headerlink" href="#unit-tests-self-test-module" title="Permalink to this headline">¶</a></h2> |
---|
137 | <p>A script that can be run to test a series of self-tests in GSAS-II. At present, |
---|
138 | only modules <tt class="docutils literal"><span class="pre">GSASIIspc</span></tt> and <tt class="docutils literal"><span class="pre">GSASIIlattice</span></tt> have self-tests.</p> |
---|
139 | <dl class="function"> |
---|
140 | <dt id="unit_tests.test_GSASIIlattice"> |
---|
141 | <tt class="descclassname">unit_tests.</tt><tt class="descname">test_GSASIIlattice</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/unit_tests.html#test_GSASIIlattice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#unit_tests.test_GSASIIlattice" title="Permalink to this definition">¶</a></dt> |
---|
142 | <dd><p>Test registered self-tests in <tt class="docutils literal"><span class="pre">GSASIIlattice</span></tt>. |
---|
143 | Takes no input and returns nothing. Throws an Exception if a test fails.</p> |
---|
144 | </dd></dl> |
---|
145 | |
---|
146 | <dl class="function"> |
---|
147 | <dt id="unit_tests.test_GSASIIspc"> |
---|
148 | <tt class="descclassname">unit_tests.</tt><tt class="descname">test_GSASIIspc</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/unit_tests.html#test_GSASIIspc"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#unit_tests.test_GSASIIspc" title="Permalink to this definition">¶</a></dt> |
---|
149 | <dd><p>Test registered self-tests in <tt class="docutils literal"><span class="pre">GSASIIspc</span></tt>. |
---|
150 | Takes no input and returns nothing. Throws an Exception if a test fails.</p> |
---|
151 | </dd></dl> |
---|
152 | |
---|
153 | </div> |
---|
154 | </div> |
---|
155 | |
---|
156 | |
---|
157 | </div> |
---|
158 | </div> |
---|
159 | </div> |
---|
160 | <div class="sphinxsidebar"> |
---|
161 | <div class="sphinxsidebarwrapper"> |
---|
162 | <p class="logo"><a href="index.html"> |
---|
163 | <img class="logo" src="_static/G2_html_logo.png" alt="Logo"/> |
---|
164 | </a></p> |
---|
165 | <h3><a href="index.html">Table Of Contents</a></h3> |
---|
166 | <ul> |
---|
167 | <li><a class="reference internal" href="#"><em>GSAS-II Scripts</em></a><ul> |
---|
168 | <li><a class="reference internal" href="#testderiv-check-derivative-computation"><em>testDeriv: Check derivative computation</em></a></li> |
---|
169 | <li><a class="reference internal" href="#gsasiitestplot-plotting-for-testderiv"><em>GSASIItestplot: Plotting for testDeriv</em></a></li> |
---|
170 | <li><a class="reference internal" href="#scanccd-reduce-data-from-scanning-ccd"><em>scanCCD: reduce data from scanning CCD</em></a></li> |
---|
171 | <li><a class="reference internal" href="#makemacapp-create-mac-applet"><em>makeMacApp: Create Mac Applet</em></a></li> |
---|
172 | <li><a class="reference internal" href="#unit-tests-self-test-module"><em>unit_tests: Self-test Module</em></a></li> |
---|
173 | </ul> |
---|
174 | </li> |
---|
175 | </ul> |
---|
176 | |
---|
177 | <h4>Previous topic</h4> |
---|
178 | <p class="topless"><a href="SAS.html" |
---|
179 | title="previous chapter"><em>GSAS-II Small Angle Scattering Submodules</em></a></p> |
---|
180 | <h4>Next topic</h4> |
---|
181 | <p class="topless"><a href="exports.html" |
---|
182 | title="next chapter"><em>GSAS-II Export Modules</em></a></p> |
---|
183 | <h3>This Page</h3> |
---|
184 | <ul class="this-page-menu"> |
---|
185 | <li><a href="_sources/GSASIIscripts.txt" |
---|
186 | rel="nofollow">Show Source</a></li> |
---|
187 | </ul> |
---|
188 | <div id="searchbox" style="display: none"> |
---|
189 | <h3>Quick search</h3> |
---|
190 | <form class="search" action="search.html" method="get"> |
---|
191 | <input type="text" name="q" /> |
---|
192 | <input type="submit" value="Go" /> |
---|
193 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
194 | <input type="hidden" name="area" value="default" /> |
---|
195 | </form> |
---|
196 | <p class="searchtip" style="font-size: 90%"> |
---|
197 | Enter search terms or a module, class or function name. |
---|
198 | </p> |
---|
199 | </div> |
---|
200 | <script type="text/javascript">$('#searchbox').show(0);</script> |
---|
201 | </div> |
---|
202 | </div> |
---|
203 | <div class="clearer"></div> |
---|
204 | </div> |
---|
205 | <div class="related"> |
---|
206 | <h3>Navigation</h3> |
---|
207 | <ul> |
---|
208 | <li class="right" style="margin-right: 10px"> |
---|
209 | <a href="genindex.html" title="General Index" |
---|
210 | >index</a></li> |
---|
211 | <li class="right" > |
---|
212 | <a href="py-modindex.html" title="Python Module Index" |
---|
213 | >modules</a> |</li> |
---|
214 | <li class="right" > |
---|
215 | <a href="exports.html" title="GSAS-II Export Modules" |
---|
216 | >next</a> |</li> |
---|
217 | <li class="right" > |
---|
218 | <a href="SAS.html" title="GSAS-II Small Angle Scattering Submodules" |
---|
219 | >previous</a> |</li> |
---|
220 | <li><a href="index.html">GSAS-II 0.2.0 documentation</a> »</li> |
---|
221 | </ul> |
---|
222 | </div> |
---|
223 | <div class="footer"> |
---|
224 | © Copyright 2013, Von Dreele and Toby for Argonne National Laboratory. |
---|
225 | Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2. |
---|
226 | </div> |
---|
227 | </body> |
---|
228 | </html> |
---|