source: trunk/sphinxdocs/build/html/_modules/G2phase.html @ 1183

Last change on this file since 1183 was 1183, checked in by toby, 8 years ago

fixup number formatting; update produced doc files

  • Property svn:mime-type set to text/html
File size: 78.9 KB
Line 
1
2
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6
7<html xmlns="http://www.w3.org/1999/xhtml">
8  <head>
9    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10   
11    <title>G2phase &mdash; GSAS-II 0.2.0 documentation</title>
12   
13    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
14    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
15   
16    <script type="text/javascript">
17      var DOCUMENTATION_OPTIONS = {
18        URL_ROOT:    '../',
19        VERSION:     '0.2.0',
20        COLLAPSE_INDEX: false,
21        FILE_SUFFIX: '.html',
22        HAS_SOURCE:  true
23      };
24    </script>
25    <script type="text/javascript" src="../_static/jquery.js"></script>
26    <script type="text/javascript" src="../_static/underscore.js"></script>
27    <script type="text/javascript" src="../_static/doctools.js"></script>
28    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
29    <link rel="top" title="GSAS-II 0.2.0 documentation" href="../index.html" />
30    <link rel="up" title="Module code" href="index.html" /> 
31  </head>
32  <body>
33    <div class="related">
34      <h3>Navigation</h3>
35      <ul>
36        <li class="right" style="margin-right: 10px">
37          <a href="../genindex.html" title="General Index"
38             accesskey="I">index</a></li>
39        <li class="right" >
40          <a href="../py-modindex.html" title="Python Module Index"
41             >modules</a> |</li>
42        <li><a href="../index.html">GSAS-II 0.2.0 documentation</a> &raquo;</li>
43          <li><a href="index.html" accesskey="U">Module code</a> &raquo;</li> 
44      </ul>
45    </div> 
46
47    <div class="document">
48      <div class="documentwrapper">
49        <div class="bodywrapper">
50          <div class="body">
51           
52  <h1>Source code for G2phase</h1><div class="highlight"><pre>
53<span class="c"># -*- coding: utf-8 -*-</span>
54<span class="c">########### SVN repository information ###################</span>
55<span class="c"># $Date: 2013-12-16 10:43:01 -0600 (Mon, 16 Dec 2013) $</span>
56<span class="c"># $Author: toby $</span>
57<span class="c"># $Revision: 1168 $</span>
58<span class="c"># $URL: https://subversion.xor.aps.anl.gov/pyGSAS/trunk/imports/G2phase.py $</span>
59<span class="c"># $Id: G2phase.py 1168 2013-12-16 16:43:01Z toby $</span>
60<span class="c">########### SVN repository information ###################</span>
61<span class="c">#</span>
62<span class="sd">&#39;&#39;&#39;</span>
63<span class="sd">*Module G2phase: PDB and .EXP*</span>
64<span class="sd">------------------------------------</span>
65
66<span class="sd">A set of short routines to read in phases using routines that were</span>
67<span class="sd">previously implemented in GSAS-II: PDB and GSAS .EXP file formats</span>
68
69<span class="sd">&#39;&#39;&#39;</span>
70
71<span class="kn">import</span> <span class="nn">sys</span>
72<span class="kn">import</span> <span class="nn">math</span>
73<span class="kn">import</span> <span class="nn">random</span> <span class="kn">as</span> <span class="nn">ran</span>
74<span class="kn">import</span> <span class="nn">traceback</span>
75<span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
76<span class="kn">import</span> <span class="nn">wx</span>
77<span class="kn">import</span> <span class="nn">GSASIIIO</span> <span class="kn">as</span> <span class="nn">G2IO</span>
78<span class="kn">import</span> <span class="nn">GSASIIspc</span> <span class="kn">as</span> <span class="nn">G2spc</span>
79<span class="kn">import</span> <span class="nn">GSASIIlattice</span> <span class="kn">as</span> <span class="nn">G2lat</span>
80<span class="kn">import</span> <span class="nn">GSASIIpath</span>
81<span class="n">GSASIIpath</span><span class="o">.</span><span class="n">SetVersionNumber</span><span class="p">(</span><span class="s">&quot;$Revision: 1168 $&quot;</span><span class="p">)</span>
82
83<div class="viewcode-block" id="PDB_ReaderClass"><a class="viewcode-back" href="../imports.html#G2phase.PDB_ReaderClass">[docs]</a><span class="k">class</span> <span class="nc">PDB_ReaderClass</span><span class="p">(</span><span class="n">G2IO</span><span class="o">.</span><span class="n">ImportPhase</span><span class="p">):</span>
84    <span class="s">&#39;Routine to import Phase information from a PDB file&#39;</span>
85    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
86        <span class="nb">super</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="p">,</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span> <span class="c"># fancy way to say ImportPhase.__init__</span>
87            <span class="n">extensionlist</span><span class="o">=</span><span class="p">(</span><span class="s">&#39;.pdb&#39;</span><span class="p">,</span><span class="s">&#39;.ent&#39;</span><span class="p">,</span><span class="s">&#39;.PDB&#39;</span><span class="p">,</span><span class="s">&#39;.ENT&#39;</span><span class="p">),</span>
88            <span class="n">strictExtension</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
89            <span class="n">formatName</span> <span class="o">=</span> <span class="s">&#39;PDB&#39;</span><span class="p">,</span>
90            <span class="n">longFormatName</span> <span class="o">=</span> <span class="s">&#39;Original Protein Data Bank (.pdb file) import&#39;</span>
91            <span class="p">)</span>
92<div class="viewcode-block" id="PDB_ReaderClass.ContentsValidator"><a class="viewcode-back" href="../imports.html#G2phase.PDB_ReaderClass.ContentsValidator">[docs]</a>    <span class="k">def</span> <span class="nf">ContentsValidator</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filepointer</span><span class="p">):</span>
93        <span class="sd">&#39;&#39;&#39;Taking a stab a validating a PDB file</span>
94<span class="sd">        (look for cell &amp; at least one atom)</span>
95<span class="sd">        &#39;&#39;&#39;</span>
96        <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">l</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">filepointer</span><span class="p">):</span>
97            <span class="k">if</span> <span class="n">l</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&#39;CRYST1&#39;</span><span class="p">):</span>
98                <span class="k">break</span>
99        <span class="k">else</span><span class="p">:</span>
100            <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;no CRYST1 record found&#39;</span>
101            <span class="k">return</span> <span class="bp">False</span>
102        <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">l</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">filepointer</span><span class="p">):</span>
103            <span class="k">if</span> <span class="n">l</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&#39;ATOM&#39;</span><span class="p">):</span>
104                <span class="k">return</span> <span class="bp">True</span>
105        <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;no ATOM records found after CRYST1 record&#39;</span>
106        <span class="k">return</span> <span class="bp">False</span>
107</div>
108<div class="viewcode-block" id="PDB_ReaderClass.Reader"><a class="viewcode-back" href="../imports.html#G2phase.PDB_ReaderClass.Reader">[docs]</a>    <span class="k">def</span> <span class="nf">Reader</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">filename</span><span class="p">,</span><span class="n">filepointer</span><span class="p">,</span> <span class="n">ParentFrame</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="o">**</span><span class="n">unused</span><span class="p">):</span>
109        <span class="s">&#39;Read a PDF file using :meth:`ReadPDBPhase`&#39;</span>
110        <span class="k">try</span><span class="p">:</span>
111            <span class="bp">self</span><span class="o">.</span><span class="n">Phase</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ReadPDBPhase</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">ParentFrame</span><span class="p">)</span>
112            <span class="k">return</span> <span class="bp">True</span>
113        <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">detail</span><span class="p">:</span>
114            <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\n</span><span class="s">  &#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">detail</span><span class="p">)</span>
115            <span class="k">print</span> <span class="s">&#39;PDB read error:&#39;</span><span class="p">,</span><span class="n">detail</span> <span class="c"># for testing</span>
116            <span class="n">traceback</span><span class="o">.</span><span class="n">print_exc</span><span class="p">(</span><span class="nb">file</span><span class="o">=</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">)</span>
117            <span class="k">return</span> <span class="bp">False</span>
118        </div>
119<div class="viewcode-block" id="PDB_ReaderClass.ReadPDBPhase"><a class="viewcode-back" href="../imports.html#G2phase.PDB_ReaderClass.ReadPDBPhase">[docs]</a>    <span class="k">def</span> <span class="nf">ReadPDBPhase</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">filename</span><span class="p">,</span><span class="n">parent</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
120        <span class="sd">&#39;&#39;&#39;Read a phase from a PDB file.</span>
121<span class="sd">        &#39;&#39;&#39;</span>
122        <span class="n">EightPiSq</span> <span class="o">=</span> <span class="mf">8.</span><span class="o">*</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">**</span><span class="mi">2</span>
123        <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;Error opening file&#39;</span>
124        <span class="nb">file</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="s">&#39;Ur&#39;</span><span class="p">)</span>
125        <span class="n">Phase</span> <span class="o">=</span> <span class="p">{}</span>
126        <span class="n">Title</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
127        <span class="n">Compnd</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
128        <span class="n">Atoms</span> <span class="o">=</span> <span class="p">[]</span>
129        <span class="n">A</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="n">shape</span><span class="o">=</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">3</span><span class="p">))</span>
130        <span class="n">S</span> <span class="o">=</span> <span class="nb">file</span><span class="o">.</span><span class="n">readline</span><span class="p">()</span>
131        <span class="n">line</span> <span class="o">=</span> <span class="mi">1</span>
132        <span class="n">SGData</span> <span class="o">=</span> <span class="bp">None</span>
133        <span class="n">cell</span> <span class="o">=</span> <span class="bp">None</span>
134        <span class="k">while</span> <span class="n">S</span><span class="p">:</span>
135            <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;Error reading at line &#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
136            <span class="n">Atom</span> <span class="o">=</span> <span class="p">[]</span>
137            <span class="k">if</span> <span class="s">&#39;TITLE&#39;</span> <span class="ow">in</span> <span class="n">S</span><span class="p">[:</span><span class="mi">5</span><span class="p">]:</span>
138                <span class="n">Title</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">10</span><span class="p">:</span><span class="mi">72</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
139            <span class="k">elif</span> <span class="s">&#39;COMPND    &#39;</span> <span class="ow">in</span> <span class="n">S</span><span class="p">[:</span><span class="mi">10</span><span class="p">]:</span>
140                <span class="n">Compnd</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">10</span><span class="p">:</span><span class="mi">72</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
141            <span class="k">elif</span> <span class="s">&#39;CRYST&#39;</span> <span class="ow">in</span> <span class="n">S</span><span class="p">[:</span><span class="mi">5</span><span class="p">]:</span>
142                <span class="n">abc</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">7</span><span class="p">:</span><span class="mi">34</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
143                <span class="n">angles</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">34</span><span class="p">:</span><span class="mi">55</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
144                <span class="n">cell</span><span class="o">=</span><span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="n">abc</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">abc</span><span class="p">[</span><span class="mi">1</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">abc</span><span class="p">[</span><span class="mi">2</span><span class="p">]),</span>
145                    <span class="nb">float</span><span class="p">(</span><span class="n">angles</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">angles</span><span class="p">[</span><span class="mi">1</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">angles</span><span class="p">[</span><span class="mi">2</span><span class="p">])]</span>
146                <span class="n">Volume</span> <span class="o">=</span> <span class="n">G2lat</span><span class="o">.</span><span class="n">calc_V</span><span class="p">(</span><span class="n">G2lat</span><span class="o">.</span><span class="n">cell2A</span><span class="p">(</span><span class="n">cell</span><span class="p">))</span>
147                <span class="n">AA</span><span class="p">,</span><span class="n">AB</span> <span class="o">=</span> <span class="n">G2lat</span><span class="o">.</span><span class="n">cell2AB</span><span class="p">(</span><span class="n">cell</span><span class="p">)</span>
148                <span class="n">SpGrp</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">55</span><span class="p">:</span><span class="mi">65</span><span class="p">]</span>
149                <span class="n">E</span><span class="p">,</span><span class="n">SGData</span> <span class="o">=</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">SpcGroup</span><span class="p">(</span><span class="n">SpGrp</span><span class="p">)</span>
150                <span class="c"># space group processing failed, try to look up name in table</span>
151                <span class="k">if</span> <span class="n">E</span><span class="p">:</span>
152                    <span class="n">SpGrpNorm</span> <span class="o">=</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">StandardizeSpcName</span><span class="p">(</span><span class="n">SpGrp</span><span class="p">)</span>
153                    <span class="k">if</span> <span class="n">SpGrpNorm</span><span class="p">:</span>
154                        <span class="n">E</span><span class="p">,</span><span class="n">SGData</span> <span class="o">=</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">SpcGroup</span><span class="p">(</span><span class="n">SpGrpNorm</span><span class="p">)</span>
155                <span class="k">while</span> <span class="n">E</span><span class="p">:</span>
156                    <span class="k">print</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">SGErrors</span><span class="p">(</span><span class="n">E</span><span class="p">)</span>
157                    <span class="n">dlg</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextEntryDialog</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span>
158                        <span class="n">SpGrp</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">+</span><span class="s">&#39; is invalid </span><span class="se">\n</span><span class="s">N.B.: make sure spaces separate axial fields in symbol&#39;</span><span class="p">,</span>
159                        <span class="s">&#39;ERROR in space group symbol&#39;</span><span class="p">,</span><span class="s">&#39;&#39;</span><span class="p">,</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">OK</span><span class="p">)</span>
160                    <span class="k">if</span> <span class="n">dlg</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">:</span>
161                        <span class="n">SpGrp</span> <span class="o">=</span> <span class="n">dlg</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
162                        <span class="n">E</span><span class="p">,</span><span class="n">SGData</span> <span class="o">=</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">SpcGroup</span><span class="p">(</span><span class="n">SpGrp</span><span class="p">)</span>
163                    <span class="k">else</span><span class="p">:</span>
164                        <span class="n">SGData</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">SGData</span> <span class="c"># P 1</span>
165                        <span class="bp">self</span><span class="o">.</span><span class="n">warnings</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\n</span><span class="s">The space group was not interpreted and has been set to &quot;P 1&quot;.&#39;</span>
166                        <span class="bp">self</span><span class="o">.</span><span class="n">warnings</span> <span class="o">+=</span> <span class="s">&quot;Change this in phase&#39;s General tab.&quot;</span>           
167                    <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
168                <span class="n">SGlines</span> <span class="o">=</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">SGPrint</span><span class="p">(</span><span class="n">SGData</span><span class="p">)</span>
169                <span class="k">for</span> <span class="n">l</span> <span class="ow">in</span> <span class="n">SGlines</span><span class="p">:</span> <span class="k">print</span> <span class="n">l</span>
170            <span class="k">elif</span> <span class="s">&#39;SCALE&#39;</span> <span class="ow">in</span> <span class="n">S</span><span class="p">[:</span><span class="mi">5</span><span class="p">]:</span>
171                <span class="n">V</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">10</span><span class="p">:</span><span class="mi">41</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
172                <span class="n">A</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">5</span><span class="p">])</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="n">V</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">V</span><span class="p">[</span><span class="mi">1</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">V</span><span class="p">[</span><span class="mi">2</span><span class="p">])]</span>
173            <span class="k">elif</span> <span class="s">&#39;ATOM&#39;</span> <span class="ow">in</span> <span class="n">S</span><span class="p">[:</span><span class="mi">4</span><span class="p">]</span> <span class="ow">or</span> <span class="s">&#39;HETATM&#39;</span> <span class="ow">in</span> <span class="n">S</span><span class="p">[:</span><span class="mi">6</span><span class="p">]:</span>
174                <span class="k">if</span> <span class="ow">not</span> <span class="n">SGData</span><span class="p">:</span>
175                    <span class="bp">self</span><span class="o">.</span><span class="n">warnings</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\n</span><span class="s">The space group was not read before atoms and has been set to &quot;P 1&quot;. &#39;</span>
176                    <span class="bp">self</span><span class="o">.</span><span class="n">warnings</span> <span class="o">+=</span> <span class="s">&quot;Change this in phase&#39;s General tab.&quot;</span>
177                    <span class="n">SGData</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">SGData</span> <span class="c"># P 1</span>
178                <span class="n">XYZ</span> <span class="o">=</span> <span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">31</span><span class="p">:</span><span class="mi">39</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">39</span><span class="p">:</span><span class="mi">47</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">47</span><span class="p">:</span><span class="mi">55</span><span class="p">])]</span>
179                <span class="n">XYZ</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">inner</span><span class="p">(</span><span class="n">AB</span><span class="p">,</span><span class="n">XYZ</span><span class="p">)</span>
180                <span class="n">XYZ</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="nb">abs</span><span class="p">(</span><span class="n">XYZ</span><span class="p">)</span><span class="o">&lt;</span><span class="mf">0.00001</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">XYZ</span><span class="p">)</span>
181                <span class="n">SytSym</span><span class="p">,</span><span class="n">Mult</span> <span class="o">=</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">SytSym</span><span class="p">(</span><span class="n">XYZ</span><span class="p">,</span><span class="n">SGData</span><span class="p">)</span>
182                <span class="n">Uiso</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">61</span><span class="p">:</span><span class="mi">67</span><span class="p">])</span><span class="o">/</span><span class="n">EightPiSq</span>
183                <span class="n">Type</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">12</span><span class="p">:</span><span class="mi">14</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
184                <span class="k">if</span> <span class="n">Type</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">in</span> <span class="s">&#39;123456789&#39;</span><span class="p">:</span>
185                    <span class="n">Type</span> <span class="o">=</span> <span class="n">Type</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
186                <span class="n">Atom</span> <span class="o">=</span> <span class="p">[</span><span class="n">S</span><span class="p">[</span><span class="mi">22</span><span class="p">:</span><span class="mi">27</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">(),</span><span class="n">S</span><span class="p">[</span><span class="mi">17</span><span class="p">:</span><span class="mi">20</span><span class="p">]</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span><span class="n">S</span><span class="p">[</span><span class="mi">20</span><span class="p">:</span><span class="mi">22</span><span class="p">],</span>
187                    <span class="n">S</span><span class="p">[</span><span class="mi">12</span><span class="p">:</span><span class="mi">17</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">(),</span><span class="n">Type</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">capitalize</span><span class="p">(),</span><span class="s">&#39;&#39;</span><span class="p">,</span><span class="n">XYZ</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">XYZ</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span><span class="n">XYZ</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span>
188                    <span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">55</span><span class="p">:</span><span class="mi">61</span><span class="p">]),</span><span class="n">SytSym</span><span class="p">,</span><span class="n">Mult</span><span class="p">,</span><span class="s">&#39;I&#39;</span><span class="p">,</span><span class="n">Uiso</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">]</span>
189                <span class="n">S</span> <span class="o">=</span> <span class="nb">file</span><span class="o">.</span><span class="n">readline</span><span class="p">()</span>
190                <span class="n">line</span> <span class="o">+=</span> <span class="mi">1</span>
191                <span class="k">if</span> <span class="s">&#39;ANISOU&#39;</span> <span class="ow">in</span> <span class="n">S</span><span class="p">[:</span><span class="mi">6</span><span class="p">]:</span>
192                    <span class="n">Uij</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">30</span><span class="p">:</span><span class="mi">72</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
193                    <span class="n">Uij</span> <span class="o">=</span> <span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="n">Uij</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span><span class="o">/</span><span class="mf">10000.</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">Uij</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span><span class="o">/</span><span class="mf">10000.</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">Uij</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span><span class="o">/</span><span class="mf">10000.</span><span class="p">,</span>
194                        <span class="nb">float</span><span class="p">(</span><span class="n">Uij</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span><span class="o">/</span><span class="mf">10000.</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">Uij</span><span class="p">[</span><span class="mi">4</span><span class="p">])</span><span class="o">/</span><span class="mf">10000.</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">Uij</span><span class="p">[</span><span class="mi">5</span><span class="p">])</span><span class="o">/</span><span class="mf">10000.</span><span class="p">]</span>
195                    <span class="n">Atom</span> <span class="o">=</span> <span class="n">Atom</span><span class="p">[:</span><span class="mi">14</span><span class="p">]</span><span class="o">+</span><span class="n">Uij</span>
196                    <span class="n">Atom</span><span class="p">[</span><span class="mi">12</span><span class="p">]</span> <span class="o">=</span> <span class="s">&#39;A&#39;</span>
197                <span class="n">Atom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ran</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">sys</span><span class="o">.</span><span class="n">maxint</span><span class="p">))</span>
198                <span class="n">Atoms</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Atom</span><span class="p">)</span>
199            <span class="n">S</span> <span class="o">=</span> <span class="nb">file</span><span class="o">.</span><span class="n">readline</span><span class="p">()</span>
200            <span class="n">line</span> <span class="o">+=</span> <span class="mi">1</span>
201        <span class="nb">file</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
202        <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;Error after read complete&#39;</span>
203        <span class="k">if</span> <span class="n">Title</span><span class="p">:</span>
204            <span class="n">PhaseName</span> <span class="o">=</span> <span class="n">Title</span>
205        <span class="k">elif</span> <span class="n">Compnd</span><span class="p">:</span>
206            <span class="n">PhaseName</span> <span class="o">=</span> <span class="n">Compnd</span>
207        <span class="k">else</span><span class="p">:</span>
208            <span class="n">PhaseName</span> <span class="o">=</span> <span class="s">&#39;None&#39;</span>
209        <span class="k">if</span> <span class="ow">not</span> <span class="n">SGData</span><span class="p">:</span>
210            <span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">ImportException</span><span class="p">(</span><span class="s">&quot;No space group (CRYST entry) found&quot;</span><span class="p">)</span>
211        <span class="k">if</span> <span class="ow">not</span> <span class="n">cell</span><span class="p">:</span>
212            <span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">ImportException</span><span class="p">(</span><span class="s">&quot;No cell (CRYST entry) found&quot;</span><span class="p">)</span>
213        <span class="n">Phase</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">SetNewPhase</span><span class="p">(</span><span class="n">Name</span><span class="o">=</span><span class="n">PhaseName</span><span class="p">,</span><span class="n">SGData</span><span class="o">=</span><span class="n">SGData</span><span class="p">,</span><span class="n">cell</span><span class="o">=</span><span class="n">cell</span><span class="o">+</span><span class="p">[</span><span class="n">Volume</span><span class="p">,])</span>
214        <span class="n">Phase</span><span class="p">[</span><span class="s">&#39;General&#39;</span><span class="p">][</span><span class="s">&#39;Type&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&#39;macromolecular&#39;</span>
215        <span class="n">Phase</span><span class="p">[</span><span class="s">&#39;General&#39;</span><span class="p">][</span><span class="s">&#39;AtomPtrs&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mi">6</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">12</span><span class="p">]</span>
216        <span class="n">Phase</span><span class="p">[</span><span class="s">&#39;Atoms&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">Atoms</span>
217        <span class="k">return</span> <span class="n">Phase</span>
218</div></div>
219<div class="viewcode-block" id="EXP_ReaderClass"><a class="viewcode-back" href="../imports.html#G2phase.EXP_ReaderClass">[docs]</a><span class="k">class</span> <span class="nc">EXP_ReaderClass</span><span class="p">(</span><span class="n">G2IO</span><span class="o">.</span><span class="n">ImportPhase</span><span class="p">):</span>
220    <span class="s">&#39;Routine to import Phase information from GSAS .EXP files&#39;</span>
221    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
222        <span class="nb">super</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="p">,</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span> <span class="c"># fancy way to say ImportPhase.__init__</span>
223            <span class="n">extensionlist</span><span class="o">=</span><span class="p">(</span><span class="s">&#39;.EXP&#39;</span><span class="p">,</span><span class="s">&#39;.exp&#39;</span><span class="p">),</span>
224            <span class="n">strictExtension</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
225            <span class="n">formatName</span> <span class="o">=</span> <span class="s">&#39;GSAS .EXP&#39;</span><span class="p">,</span>
226            <span class="n">longFormatName</span> <span class="o">=</span> <span class="s">&#39;GSAS Experiment (.EXP file) import&#39;</span>
227            <span class="p">)</span>
228       
229<div class="viewcode-block" id="EXP_ReaderClass.ContentsValidator"><a class="viewcode-back" href="../imports.html#G2phase.EXP_ReaderClass.ContentsValidator">[docs]</a>    <span class="k">def</span> <span class="nf">ContentsValidator</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filepointer</span><span class="p">):</span>
230        <span class="s">&#39;Look for a VERSION tag in 1st line&#39;</span> 
231        <span class="k">if</span> <span class="n">filepointer</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">13</span><span class="p">)</span> <span class="o">==</span> <span class="s">&#39;     VERSION &#39;</span><span class="p">:</span>
232            <span class="k">return</span> <span class="bp">True</span>
233        <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;File does not begin with VERSION tag&#39;</span>
234        <span class="k">return</span> <span class="bp">False</span>
235</div>
236<div class="viewcode-block" id="EXP_ReaderClass.Reader"><a class="viewcode-back" href="../imports.html#G2phase.EXP_ReaderClass.Reader">[docs]</a>    <span class="k">def</span> <span class="nf">Reader</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">filename</span><span class="p">,</span><span class="n">filepointer</span><span class="p">,</span> <span class="n">ParentFrame</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="o">**</span><span class="n">unused</span><span class="p">):</span>
237        <span class="s">&#39;Read a phase from a GSAS .EXP file using :meth:`ReadEXPPhase`&#39;</span>
238        <span class="k">try</span><span class="p">:</span>
239            <span class="bp">self</span><span class="o">.</span><span class="n">Phase</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ReadEXPPhase</span><span class="p">(</span><span class="n">ParentFrame</span><span class="p">,</span> <span class="n">filepointer</span><span class="p">)</span>
240            <span class="k">return</span> <span class="bp">True</span>
241        <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">detail</span><span class="p">:</span>
242            <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\n</span><span class="s">  &#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">detail</span><span class="p">)</span>
243            <span class="k">print</span> <span class="s">&#39;GSAS .EXP read error:&#39;</span><span class="p">,</span><span class="n">detail</span> <span class="c"># for testing</span>
244            <span class="n">traceback</span><span class="o">.</span><span class="n">print_exc</span><span class="p">(</span><span class="nb">file</span><span class="o">=</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">)</span>
245            <span class="k">return</span> <span class="bp">False</span>
246</div>
247<div class="viewcode-block" id="EXP_ReaderClass.ReadEXPPhase"><a class="viewcode-back" href="../imports.html#G2phase.EXP_ReaderClass.ReadEXPPhase">[docs]</a>    <span class="k">def</span> <span class="nf">ReadEXPPhase</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">G2frame</span><span class="p">,</span><span class="n">filepointer</span><span class="p">):</span>
248        <span class="sd">&#39;&#39;&#39;Read a phase from a GSAS .EXP file.</span>
249<span class="sd">        &#39;&#39;&#39;</span>
250        <span class="n">shModels</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;cylindrical&#39;</span><span class="p">,</span><span class="s">&#39;none&#39;</span><span class="p">,</span><span class="s">&#39;shear - 2/m&#39;</span><span class="p">,</span><span class="s">&#39;rolling - mmm&#39;</span><span class="p">]</span>
251        <span class="n">textureData</span> <span class="o">=</span> <span class="p">{</span><span class="s">&#39;Order&#39;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span><span class="s">&#39;Model&#39;</span><span class="p">:</span><span class="s">&#39;cylindrical&#39;</span><span class="p">,</span><span class="s">&#39;Sample omega&#39;</span><span class="p">:[</span><span class="bp">False</span><span class="p">,</span><span class="mf">0.0</span><span class="p">],</span>
252            <span class="s">&#39;Sample chi&#39;</span><span class="p">:[</span><span class="bp">False</span><span class="p">,</span><span class="mf">0.0</span><span class="p">],</span><span class="s">&#39;Sample phi&#39;</span><span class="p">:[</span><span class="bp">False</span><span class="p">,</span><span class="mf">0.0</span><span class="p">],</span><span class="s">&#39;SH Coeff&#39;</span><span class="p">:[</span><span class="bp">False</span><span class="p">,{}],</span>
253            <span class="s">&#39;SHShow&#39;</span><span class="p">:</span><span class="bp">False</span><span class="p">,</span><span class="s">&#39;PFhkl&#39;</span><span class="p">:[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span><span class="s">&#39;PFxyz&#39;</span><span class="p">:[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span><span class="s">&#39;PlotType&#39;</span><span class="p">:</span><span class="s">&#39;Pole figure&#39;</span><span class="p">}</span>
254        <span class="n">shNcof</span> <span class="o">=</span> <span class="mi">0</span>
255        <span class="n">S</span> <span class="o">=</span> <span class="mi">1</span>
256        <span class="n">NPhas</span> <span class="o">=</span> <span class="p">[]</span>
257        <span class="n">Expr</span> <span class="o">=</span> <span class="p">[{},{},{},{},{},{},{},{},{}]</span> <span class="c"># GSAS can have at most 9 phases</span>
258        <span class="k">for</span> <span class="n">line</span><span class="p">,</span><span class="n">S</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">filepointer</span><span class="p">):</span>
259            <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;Error reading at line &#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">line</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
260            <span class="k">if</span> <span class="s">&#39;EXPR NPHAS&#39;</span> <span class="ow">in</span> <span class="n">S</span><span class="p">[:</span><span class="mi">12</span><span class="p">]:</span>
261                <span class="n">Num</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">12</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&#39;0&#39;</span><span class="p">)</span>
262                <span class="n">NPhas</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">12</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
263            <span class="k">if</span> <span class="s">&#39;CRS&#39;</span> <span class="ow">in</span> <span class="n">S</span><span class="p">[:</span><span class="mi">3</span><span class="p">]:</span>
264                <span class="n">N</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">3</span><span class="p">:</span><span class="mi">4</span><span class="p">])</span><span class="o">-</span><span class="mi">1</span>
265                <span class="n">Expr</span><span class="p">[</span><span class="n">N</span><span class="p">][</span><span class="n">S</span><span class="p">[:</span><span class="mi">12</span><span class="p">]]</span> <span class="o">=</span> <span class="n">S</span><span class="p">[</span><span class="mi">12</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
266        <span class="n">PNames</span> <span class="o">=</span> <span class="p">[]</span>
267        <span class="k">if</span> <span class="ow">not</span> <span class="n">NPhas</span><span class="p">:</span>
268            <span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">ImportException</span><span class="p">(</span><span class="s">&quot;No EXPR NPHAS record found&quot;</span><span class="p">)</span>
269        <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;Error interpreting file&#39;</span>
270        <span class="k">for</span> <span class="n">n</span><span class="p">,</span><span class="n">N</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">NPhas</span><span class="p">):</span>
271            <span class="k">if</span> <span class="n">N</span> <span class="o">!=</span> <span class="s">&#39;0&#39;</span><span class="p">:</span>
272                <span class="n">result</span> <span class="o">=</span> <span class="n">n</span>
273                <span class="n">key</span> <span class="o">=</span> <span class="s">&#39;CRS&#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">n</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="o">+</span><span class="s">&#39;    PNAM&#39;</span>
274                <span class="n">PNames</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Expr</span><span class="p">[</span><span class="n">n</span><span class="p">][</span><span class="n">key</span><span class="p">])</span>
275        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">PNames</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
276            <span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">ImportException</span><span class="p">(</span><span class="s">&quot;No phases found&quot;</span><span class="p">)</span>           
277        <span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">PNames</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
278            <span class="n">dlg</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">SingleChoiceDialog</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span> <span class="s">&#39;Which phase to read?&#39;</span><span class="p">,</span> <span class="s">&#39;Read phase data&#39;</span><span class="p">,</span> <span class="n">PNames</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">CHOICEDLG_STYLE</span><span class="p">)</span>
279            <span class="k">try</span><span class="p">:</span>
280                <span class="k">if</span> <span class="n">dlg</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">:</span>
281                    <span class="n">result</span> <span class="o">=</span> <span class="n">dlg</span><span class="o">.</span><span class="n">GetSelection</span><span class="p">()</span> <span class="c"># I think this breaks is there are skipped phases. Cant this happen?</span>
282            <span class="k">finally</span><span class="p">:</span>
283                <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>       
284        <span class="n">EXPphase</span> <span class="o">=</span> <span class="n">Expr</span><span class="p">[</span><span class="n">result</span><span class="p">]</span>
285        <span class="n">keyList</span> <span class="o">=</span> <span class="n">EXPphase</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
286        <span class="n">keyList</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span>
287        <span class="n">SGData</span> <span class="o">=</span> <span class="p">{}</span>
288        <span class="k">if</span> <span class="n">NPhas</span><span class="p">[</span><span class="n">result</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;1&#39;</span><span class="p">:</span>
289            <span class="n">Ptype</span> <span class="o">=</span> <span class="s">&#39;nuclear&#39;</span>
290        <span class="k">elif</span> <span class="n">NPhas</span><span class="p">[</span><span class="n">result</span><span class="p">]</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;2&#39;</span><span class="p">,</span><span class="s">&#39;3&#39;</span><span class="p">]:</span>
291            <span class="n">Ptype</span> <span class="o">=</span> <span class="s">&#39;magnetic&#39;</span>
292        <span class="k">elif</span> <span class="n">NPhas</span><span class="p">[</span><span class="n">result</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;4&#39;</span><span class="p">:</span>
293            <span class="n">Ptype</span> <span class="o">=</span> <span class="s">&#39;macromolecular&#39;</span>
294        <span class="k">elif</span> <span class="n">NPhas</span><span class="p">[</span><span class="n">result</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;10&#39;</span><span class="p">:</span>
295            <span class="n">Ptype</span> <span class="o">=</span> <span class="s">&#39;Pawley&#39;</span>
296        <span class="k">else</span><span class="p">:</span>
297            <span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">ImportException</span><span class="p">(</span><span class="s">&quot;Phase type not recognized&quot;</span><span class="p">)</span>           
298        <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keyList</span><span class="p">:</span>
299            <span class="k">if</span> <span class="s">&#39;PNAM&#39;</span> <span class="ow">in</span> <span class="n">key</span><span class="p">:</span>
300               <span class="n">PhaseName</span> <span class="o">=</span> <span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
301            <span class="k">elif</span> <span class="s">&#39;ABC   &#39;</span> <span class="ow">in</span> <span class="n">key</span><span class="p">:</span>
302                <span class="n">abc</span> <span class="o">=</span> <span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">][:</span><span class="mi">10</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">][</span><span class="mi">10</span><span class="p">:</span><span class="mi">20</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">][</span><span class="mi">20</span><span class="p">:</span><span class="mi">30</span><span class="p">])]</span>                       
303            <span class="k">elif</span> <span class="s">&#39;ANGLES&#39;</span> <span class="ow">in</span> <span class="n">key</span><span class="p">:</span>
304                <span class="n">angles</span> <span class="o">=</span> <span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">][:</span><span class="mi">10</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">][</span><span class="mi">10</span><span class="p">:</span><span class="mi">20</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">][</span><span class="mi">20</span><span class="p">:</span><span class="mi">30</span><span class="p">])]</span>                                               
305            <span class="k">elif</span> <span class="s">&#39;SG SYM&#39;</span> <span class="ow">in</span> <span class="n">key</span><span class="p">:</span>
306                <span class="n">SpGrp</span> <span class="o">=</span> <span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">][:</span><span class="mi">15</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
307                <span class="n">E</span><span class="p">,</span><span class="n">SGData</span> <span class="o">=</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">SpcGroup</span><span class="p">(</span><span class="n">SpGrp</span><span class="p">)</span>
308                <span class="k">if</span> <span class="n">E</span><span class="p">:</span>
309                    <span class="n">SGData</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">SGData</span> <span class="c"># P 1 -- unlikely to need this!</span>
310                    <span class="bp">self</span><span class="o">.</span><span class="n">warnings</span> <span class="o">+=</span> <span class="s">&#39;</span><span class="se">\n</span><span class="s">The GSAS space group was not interpreted(!) and has been set to &quot;P 1&quot;.&#39;</span>
311                    <span class="bp">self</span><span class="o">.</span><span class="n">warnings</span> <span class="o">+=</span> <span class="s">&quot;Change this in phase&#39;s General tab.&quot;</span>                       
312            <span class="k">elif</span> <span class="s">&#39;OD    &#39;</span> <span class="ow">in</span> <span class="n">key</span><span class="p">:</span>
313                <span class="n">SHdata</span> <span class="o">=</span> <span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span> <span class="c"># may not have all 9 values</span>
314                <span class="n">SHvals</span> <span class="o">=</span> <span class="mi">9</span><span class="o">*</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
315                <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">9</span><span class="p">):</span>
316                    <span class="k">try</span><span class="p">:</span>
317                        <span class="nb">float</span><span class="p">(</span><span class="n">SHdata</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
318                        <span class="n">SHvals</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">SHdata</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
319                    <span class="k">except</span><span class="p">:</span>
320                        <span class="k">pass</span>
321                <span class="n">textureData</span><span class="p">[</span><span class="s">&#39;Order&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">SHvals</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
322                <span class="n">textureData</span><span class="p">[</span><span class="s">&#39;Model&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">shModels</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">SHvals</span><span class="p">[</span><span class="mi">2</span><span class="p">])]</span>
323                <span class="n">textureData</span><span class="p">[</span><span class="s">&#39;Sample omega&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="bp">False</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">SHvals</span><span class="p">[</span><span class="mi">6</span><span class="p">])]</span>
324                <span class="n">textureData</span><span class="p">[</span><span class="s">&#39;Sample chi&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="bp">False</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">SHvals</span><span class="p">[</span><span class="mi">7</span><span class="p">])]</span>
325                <span class="n">textureData</span><span class="p">[</span><span class="s">&#39;Sample phi&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="bp">False</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">SHvals</span><span class="p">[</span><span class="mi">8</span><span class="p">])]</span>
326                <span class="n">shNcof</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">SHvals</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
327        <span class="n">Atoms</span> <span class="o">=</span> <span class="p">[]</span>
328        <span class="k">if</span> <span class="n">Ptype</span> <span class="o">==</span> <span class="s">&#39;nuclear&#39;</span><span class="p">:</span>
329            <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keyList</span><span class="p">:</span>
330                <span class="k">if</span> <span class="s">&#39;AT&#39;</span> <span class="ow">in</span> <span class="n">key</span><span class="p">:</span>
331                    <span class="k">if</span> <span class="n">key</span><span class="p">[</span><span class="mi">11</span><span class="p">:]</span> <span class="o">==</span> <span class="s">&#39;A&#39;</span><span class="p">:</span>
332                        <span class="n">S</span> <span class="o">=</span> <span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
333                    <span class="k">elif</span> <span class="n">key</span><span class="p">[</span><span class="mi">11</span><span class="p">:]</span> <span class="o">==</span> <span class="s">&#39;B&#39;</span><span class="p">:</span>
334                        <span class="n">S</span> <span class="o">+=</span> <span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
335                        <span class="n">Atom</span> <span class="o">=</span> <span class="p">[</span><span class="n">S</span><span class="p">[</span><span class="mi">50</span><span class="p">:</span><span class="mi">58</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">(),</span><span class="n">S</span><span class="p">[:</span><span class="mi">10</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">capitalize</span><span class="p">(),</span><span class="s">&#39;&#39;</span><span class="p">,</span>
336                            <span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">10</span><span class="p">:</span><span class="mi">20</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">20</span><span class="p">:</span><span class="mi">30</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">30</span><span class="p">:</span><span class="mi">40</span><span class="p">]),</span>
337                            <span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">40</span><span class="p">:</span><span class="mi">50</span><span class="p">]),</span><span class="s">&#39;&#39;</span><span class="p">,</span><span class="nb">int</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">60</span><span class="p">:</span><span class="mi">62</span><span class="p">]),</span><span class="n">S</span><span class="p">[</span><span class="mi">130</span><span class="p">:</span><span class="mi">131</span><span class="p">]]</span>
338                        <span class="k">if</span> <span class="n">Atom</span><span class="p">[</span><span class="mi">9</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;I&#39;</span><span class="p">:</span>
339                            <span class="n">Atom</span> <span class="o">+=</span> <span class="p">[</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">68</span><span class="p">:</span><span class="mi">78</span><span class="p">]),</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">]</span>
340                        <span class="k">elif</span> <span class="n">Atom</span><span class="p">[</span><span class="mi">9</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;A&#39;</span><span class="p">:</span>
341                            <span class="n">Atom</span> <span class="o">+=</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">68</span><span class="p">:</span><span class="mi">78</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">78</span><span class="p">:</span><span class="mi">88</span><span class="p">]),</span>
342                                <span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">88</span><span class="p">:</span><span class="mi">98</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">98</span><span class="p">:</span><span class="mi">108</span><span class="p">]),</span>
343                                <span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">108</span><span class="p">:</span><span class="mi">118</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">118</span><span class="p">:</span><span class="mi">128</span><span class="p">])]</span>
344                        <span class="n">XYZ</span> <span class="o">=</span> <span class="n">Atom</span><span class="p">[</span><span class="mi">3</span><span class="p">:</span><span class="mi">6</span><span class="p">]</span>
345                        <span class="n">Atom</span><span class="p">[</span><span class="mi">7</span><span class="p">],</span><span class="n">Atom</span><span class="p">[</span><span class="mi">8</span><span class="p">]</span> <span class="o">=</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">SytSym</span><span class="p">(</span><span class="n">XYZ</span><span class="p">,</span><span class="n">SGData</span><span class="p">)</span>
346                        <span class="n">Atom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ran</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">sys</span><span class="o">.</span><span class="n">maxint</span><span class="p">))</span>
347                        <span class="n">Atoms</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Atom</span><span class="p">)</span>
348        <span class="k">elif</span> <span class="n">Ptype</span> <span class="o">==</span> <span class="s">&#39;macromolecular&#39;</span><span class="p">:</span>
349            <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keyList</span><span class="p">:</span>
350                <span class="k">if</span> <span class="s">&#39;AT&#39;</span> <span class="ow">in</span> <span class="n">key</span><span class="p">[</span><span class="mi">6</span><span class="p">:</span><span class="mi">8</span><span class="p">]:</span>
351                    <span class="n">S</span> <span class="o">=</span> <span class="n">EXPphase</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
352                    <span class="n">Atom</span> <span class="o">=</span> <span class="p">[</span><span class="n">S</span><span class="p">[</span><span class="mi">56</span><span class="p">:</span><span class="mi">60</span><span class="p">],</span><span class="n">S</span><span class="p">[</span><span class="mi">50</span><span class="p">:</span><span class="mi">54</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span><span class="n">S</span><span class="p">[</span><span class="mi">54</span><span class="p">:</span><span class="mi">56</span><span class="p">],</span>
353                        <span class="n">S</span><span class="p">[</span><span class="mi">46</span><span class="p">:</span><span class="mi">51</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">(),</span><span class="n">S</span><span class="p">[:</span><span class="mi">8</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">capitalize</span><span class="p">(),</span><span class="s">&#39;&#39;</span><span class="p">,</span>
354                        <span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">16</span><span class="p">:</span><span class="mi">24</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">24</span><span class="p">:</span><span class="mi">32</span><span class="p">]),</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">32</span><span class="p">:</span><span class="mi">40</span><span class="p">]),</span>
355                        <span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">8</span><span class="p">:</span><span class="mi">16</span><span class="p">]),</span><span class="s">&#39;1&#39;</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39;I&#39;</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">S</span><span class="p">[</span><span class="mi">40</span><span class="p">:</span><span class="mi">46</span><span class="p">]),</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">]</span>
356                    <span class="n">XYZ</span> <span class="o">=</span> <span class="n">Atom</span><span class="p">[</span><span class="mi">6</span><span class="p">:</span><span class="mi">9</span><span class="p">]</span>
357                    <span class="n">Atom</span><span class="p">[</span><span class="mi">10</span><span class="p">],</span><span class="n">Atom</span><span class="p">[</span><span class="mi">11</span><span class="p">]</span> <span class="o">=</span> <span class="n">G2spc</span><span class="o">.</span><span class="n">SytSym</span><span class="p">(</span><span class="n">XYZ</span><span class="p">,</span><span class="n">SGData</span><span class="p">)</span>
358                    <span class="n">Atom</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ran</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">sys</span><span class="o">.</span><span class="n">maxint</span><span class="p">))</span>
359                    <span class="n">Atoms</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Atom</span><span class="p">)</span>
360        <span class="n">Volume</span> <span class="o">=</span> <span class="n">G2lat</span><span class="o">.</span><span class="n">calc_V</span><span class="p">(</span><span class="n">G2lat</span><span class="o">.</span><span class="n">cell2A</span><span class="p">(</span><span class="n">abc</span><span class="o">+</span><span class="n">angles</span><span class="p">))</span>
361        <span class="k">if</span> <span class="n">shNcof</span><span class="p">:</span>
362            <span class="n">shCoef</span> <span class="o">=</span> <span class="p">{}</span>
363            <span class="n">nRec</span> <span class="o">=</span> <span class="p">[</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">((</span><span class="n">shNcof</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">6</span><span class="o">+</span><span class="mi">1</span><span class="p">)]</span>
364            <span class="k">for</span> <span class="n">irec</span> <span class="ow">in</span> <span class="n">nRec</span><span class="p">:</span>
365                <span class="n">ODkey</span> <span class="o">=</span> <span class="n">keyList</span><span class="p">[</span><span class="mi">0</span><span class="p">][:</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="s">&#39;OD&#39;</span><span class="o">+</span><span class="s">&#39;</span><span class="si">%3d</span><span class="s">A&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">irec</span><span class="p">)</span>
366                <span class="n">indx</span> <span class="o">=</span> <span class="n">EXPphase</span><span class="p">[</span><span class="n">ODkey</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
367                <span class="n">ODkey</span> <span class="o">=</span> <span class="n">ODkey</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">+</span><span class="s">&#39;B&#39;</span>
368                <span class="n">vals</span> <span class="o">=</span> <span class="n">EXPphase</span><span class="p">[</span><span class="n">ODkey</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
369                <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">val</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">vals</span><span class="p">):</span>
370                    <span class="n">key</span> <span class="o">=</span> <span class="s">&#39;C(</span><span class="si">%s</span><span class="s">,</span><span class="si">%s</span><span class="s">,</span><span class="si">%s</span><span class="s">)&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">indx</span><span class="p">[</span><span class="mi">3</span><span class="o">*</span><span class="n">i</span><span class="p">],</span><span class="n">indx</span><span class="p">[</span><span class="mi">3</span><span class="o">*</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">],</span><span class="n">indx</span><span class="p">[</span><span class="mi">3</span><span class="o">*</span><span class="n">i</span><span class="o">+</span><span class="mi">2</span><span class="p">])</span>
371                    <span class="n">shCoef</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">val</span><span class="p">)</span>
372            <span class="n">textureData</span><span class="p">[</span><span class="s">&#39;SH Coeff&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="bp">False</span><span class="p">,</span><span class="n">shCoef</span><span class="p">]</span>
373        <span class="k">if</span> <span class="ow">not</span> <span class="n">SGData</span><span class="p">:</span>
374            <span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">ImportException</span><span class="p">(</span><span class="s">&quot;No space group found in phase&quot;</span><span class="p">)</span>
375        <span class="k">if</span> <span class="ow">not</span> <span class="n">abc</span><span class="p">:</span>
376            <span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">ImportException</span><span class="p">(</span><span class="s">&quot;No cell lengths found in phase&quot;</span><span class="p">)</span>
377        <span class="k">if</span> <span class="ow">not</span> <span class="n">angles</span><span class="p">:</span>
378            <span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">ImportException</span><span class="p">(</span><span class="s">&quot;No cell angles found in phase&quot;</span><span class="p">)</span>
379        <span class="k">if</span> <span class="ow">not</span> <span class="n">Atoms</span><span class="p">:</span>
380            <span class="k">raise</span> <span class="bp">self</span><span class="o">.</span><span class="n">ImportException</span><span class="p">(</span><span class="s">&quot;No atoms found in phase&quot;</span><span class="p">)</span>
381        <span class="n">Phase</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">SetNewPhase</span><span class="p">(</span><span class="n">Name</span><span class="o">=</span><span class="n">PhaseName</span><span class="p">,</span><span class="n">SGData</span><span class="o">=</span><span class="n">SGData</span><span class="p">,</span><span class="n">cell</span><span class="o">=</span><span class="n">abc</span><span class="o">+</span><span class="n">angles</span><span class="o">+</span><span class="p">[</span><span class="n">Volume</span><span class="p">,])</span>
382        <span class="n">general</span> <span class="o">=</span> <span class="n">Phase</span><span class="p">[</span><span class="s">&#39;General&#39;</span><span class="p">]</span>
383        <span class="n">general</span><span class="p">[</span><span class="s">&#39;Type&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">Ptype</span>
384        <span class="k">if</span> <span class="n">general</span><span class="p">[</span><span class="s">&#39;Type&#39;</span><span class="p">]</span> <span class="o">==</span><span class="s">&#39;macromolecular&#39;</span><span class="p">:</span>
385            <span class="n">general</span><span class="p">[</span><span class="s">&#39;AtomPtrs&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mi">6</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="mi">12</span><span class="p">]</span>
386        <span class="k">else</span><span class="p">:</span>
387            <span class="n">general</span><span class="p">[</span><span class="s">&#39;AtomPtrs&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">9</span><span class="p">]</span>   
388        <span class="n">general</span><span class="p">[</span><span class="s">&#39;SH Texture&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">textureData</span>
389        <span class="n">Phase</span><span class="p">[</span><span class="s">&#39;Atoms&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">Atoms</span>
390        <span class="k">return</span> <span class="n">Phase</span></div></div>
391</pre></div>
392
393          </div>
394        </div>
395      </div>
396      <div class="sphinxsidebar">
397        <div class="sphinxsidebarwrapper">
398            <p class="logo"><a href="../index.html">
399              <img class="logo" src="../_static/G2_html_logo.png" alt="Logo"/>
400            </a></p>
401<div id="searchbox" style="display: none">
402  <h3>Quick search</h3>
403    <form class="search" action="../search.html" method="get">
404      <input type="text" name="q" />
405      <input type="submit" value="Go" />
406      <input type="hidden" name="check_keywords" value="yes" />
407      <input type="hidden" name="area" value="default" />
408    </form>
409    <p class="searchtip" style="font-size: 90%">
410    Enter search terms or a module, class or function name.
411    </p>
412</div>
413<script type="text/javascript">$('#searchbox').show(0);</script>
414        </div>
415      </div>
416      <div class="clearer"></div>
417    </div>
418    <div class="related">
419      <h3>Navigation</h3>
420      <ul>
421        <li class="right" style="margin-right: 10px">
422          <a href="../genindex.html" title="General Index"
423             >index</a></li>
424        <li class="right" >
425          <a href="../py-modindex.html" title="Python Module Index"
426             >modules</a> |</li>
427        <li><a href="../index.html">GSAS-II 0.2.0 documentation</a> &raquo;</li>
428          <li><a href="index.html" >Module code</a> &raquo;</li> 
429      </ul>
430    </div>
431    <div class="footer">
432        &copy; Copyright 2013, Von Dreele and Toby for Argonne National Laboratory.
433      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
434    </div>
435  </body>
436</html>
Note: See TracBrowser for help on using the repository browser.