source: trunk/sphinxdocs/build/html/_modules/G2sfact_CIF.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: 53.7 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>G2sfact_CIF &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 G2sfact_CIF</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/G2sfact_CIF.py $</span>
59<span class="c"># $Id: G2sfact_CIF.py 1168 2013-12-16 16:43:01Z toby $</span>
60<span class="c">########### SVN repository information ###################</span>
61<span class="sd">&#39;&#39;&#39;</span>
62<span class="sd">*Module G2sfact_CIF: CIF import*</span>
63<span class="sd">-----------------------------------</span>
64<span class="sd">Read structure factors from a CIF reflection table.</span>
65
66<span class="sd">&#39;&#39;&#39;</span>
67<span class="c"># routines to read in structure factors from a CIF</span>
68<span class="c"># </span>
69<span class="kn">import</span> <span class="nn">sys</span>
70<span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
71<span class="kn">import</span> <span class="nn">os.path</span>
72<span class="kn">import</span> <span class="nn">GSASIIIO</span> <span class="kn">as</span> <span class="nn">G2IO</span>
73<span class="kn">import</span> <span class="nn">GSASIIpath</span>
74<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>
75<span class="kn">import</span> <span class="nn">CifFile</span> <span class="kn">as</span> <span class="nn">cif</span> <span class="c"># PyCifRW from James Hester</span>
76
77<div class="viewcode-block" id="CIFhklReader"><a class="viewcode-back" href="../imports.html#G2sfact_CIF.CIFhklReader">[docs]</a><span class="k">class</span> <span class="nc">CIFhklReader</span><span class="p">(</span><span class="n">G2IO</span><span class="o">.</span><span class="n">ImportStructFactor</span><span class="p">):</span>
78    <span class="s">&#39;Routines to import Phase information from a CIF file&#39;</span>
79    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
80        <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 self-reference</span>
81            <span class="n">extensionlist</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;.CIF&#39;</span><span class="p">,</span><span class="s">&#39;.cif&#39;</span><span class="p">,</span><span class="s">&#39;.FCF&#39;</span><span class="p">,</span><span class="s">&#39;.fcf&#39;</span><span class="p">,</span><span class="s">&#39;.HKL&#39;</span><span class="p">,</span><span class="s">&#39;.hkl&#39;</span><span class="p">),</span>
82            <span class="n">strictExtension</span> <span class="o">=</span> <span class="bp">False</span><span class="p">,</span>
83            <span class="n">formatName</span> <span class="o">=</span> <span class="s">&#39;CIF&#39;</span><span class="p">,</span>
84            <span class="n">longFormatName</span> <span class="o">=</span> <span class="s">&#39;CIF format structure factor file (.cif or .hkl)&#39;</span>
85            <span class="p">)</span>
86    <span class="c"># Validate the contents</span>
87<div class="viewcode-block" id="CIFhklReader.ContentsValidator"><a class="viewcode-back" href="../imports.html#G2sfact_CIF.CIFhklReader.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>
88        <span class="s">&#39;Use standard CIF validator&#39;</span>
89        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">CIFValidator</span><span class="p">(</span><span class="n">filepointer</span><span class="p">)</span>
90</div>
91<div class="viewcode-block" id="CIFhklReader.Reader"><a class="viewcode-back" href="../imports.html#G2sfact_CIF.CIFhklReader.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">kwarg</span><span class="p">):</span>
92        <span class="sd">&#39;&#39;&#39;Read single crystal data from a CIF.</span>
93<span class="sd">        If multiple datasets are requested, use self.repeat and buffer caching.</span>
94<span class="sd">        &#39;&#39;&#39;</span>
95        <span class="n">hklitems</span> <span class="o">=</span> <span class="p">[(</span><span class="s">&#39;_refln_index_h&#39;</span><span class="p">,</span><span class="s">&#39;_refln_index_k&#39;</span><span class="p">,</span><span class="s">&#39;_refln_index_l&#39;</span><span class="p">),</span>
96                    <span class="p">(</span><span class="s">&#39;_refln.index_h&#39;</span><span class="p">,</span><span class="s">&#39;_refln.index_k&#39;</span><span class="p">,</span><span class="s">&#39;_refln.index_l&#39;</span><span class="p">)]</span>
97        <span class="n">cellitems</span> <span class="o">=</span> <span class="p">[</span>
98            <span class="p">(</span><span class="s">&#39;_cell_length_a&#39;</span><span class="p">,</span><span class="s">&#39;_cell_length_b&#39;</span><span class="p">,</span><span class="s">&#39;_cell_length_c&#39;</span><span class="p">,</span>
99             <span class="s">&#39;_cell_angle_alpha&#39;</span><span class="p">,</span><span class="s">&#39;_cell_angle_beta&#39;</span><span class="p">,</span><span class="s">&#39;_cell_angle_gamma&#39;</span><span class="p">,),</span>
100            <span class="p">(</span><span class="s">&#39;_cell.length_a&#39;</span><span class="p">,</span><span class="s">&#39;_cell.length_b&#39;</span><span class="p">,</span><span class="s">&#39;_cell.length_c&#39;</span><span class="p">,</span>
101             <span class="s">&#39;_cell.angle_alpha&#39;</span><span class="p">,</span><span class="s">&#39;_cell.angle_beta&#39;</span><span class="p">,</span><span class="s">&#39;_cell.angle_gamma&#39;</span><span class="p">,),]</span>
102
103        <span class="n">Fdatanames</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_refln_f_meas&#39;</span><span class="p">,</span><span class="s">&#39;_refln.f_meas&#39;</span><span class="p">,</span><span class="s">&#39;_refln.f_meas_au&#39;</span><span class="p">,</span>
104                      <span class="p">)</span>
105       
106        <span class="n">F2datanames</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_refln_f_squared_meas&#39;</span><span class="p">,</span><span class="s">&#39;_refln.f_squared_meas&#39;</span><span class="p">,</span>
107                      <span class="p">)</span>
108
109        <span class="n">Idatanames</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_refln_intensity_meas&#39;</span><span class="p">,</span><span class="s">&#39;_refln.intensity_meas&#39;</span><span class="p">,</span>
110                      <span class="p">)</span> <span class="c"># not used yet</span>
111
112        <span class="n">Isignames</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_refln_intensity_meas_sigma&#39;</span><span class="p">,</span><span class="s">&#39;_refln.intensity_meas_sigma&#39;</span><span class="p">,</span>
113                      <span class="p">)</span> <span class="c"># not used yet</span>
114
115        <span class="n">Fcalcnames</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_refln_f_calc&#39;</span><span class="p">,</span><span class="s">&#39;_refln.f_calc&#39;</span><span class="p">,</span><span class="s">&#39;_refln.f_calc_au&#39;</span><span class="p">,</span>
116                      <span class="p">)</span>
117       
118        <span class="n">F2calcnames</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_refln_f_squared_calc&#39;</span><span class="p">,</span><span class="s">&#39;_refln.f_squared_calc&#39;</span><span class="p">,</span>
119                      <span class="p">)</span>
120
121        <span class="n">Fsignames</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_refln_f_meas_sigma&#39;</span><span class="p">,</span><span class="s">&#39;_refln.f_meas_sigma&#39;</span><span class="p">,</span><span class="s">&#39;_refln.f_meas_sigma_au&#39;</span><span class="p">,</span>
122                      <span class="p">)</span>
123       
124        <span class="n">F2signames</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_refln_f_squared_meas_sigma&#39;</span><span class="p">,</span><span class="s">&#39;_refln.f_squared_meas_sigma&#39;</span><span class="p">,</span>
125                      <span class="p">)</span>
126
127        <span class="n">phasenames</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_refln_phase_calc&#39;</span><span class="p">,</span><span class="s">&#39;_refln.phase_calc&#39;</span><span class="p">,</span>
128                      <span class="p">)</span>
129
130
131        <span class="n">SGdataname</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;_symmetry_space_group_name_H-M&#39;</span><span class="p">,</span> <span class="s">&#39;_symmetry.space_group_name_H-M&#39;</span><span class="p">)</span>
132                     
133        <span class="n">phasenamefields</span> <span class="o">=</span> <span class="p">(</span>
134            <span class="s">&#39;_chemical_name_common&#39;</span><span class="p">,</span>
135            <span class="s">&#39;_pd_phase_name&#39;</span><span class="p">,</span>
136            <span class="s">&#39;_chemical_formula_sum&#39;</span>
137            <span class="p">)</span>
138        <span class="n">rdbuffer</span> <span class="o">=</span> <span class="n">kwarg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;buffer&#39;</span><span class="p">)</span>
139        <span class="n">cf</span> <span class="o">=</span> <span class="bp">None</span>
140        <span class="k">try</span><span class="p">:</span>
141            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">repeat</span> <span class="ow">and</span> <span class="n">rdbuffer</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
142                <span class="n">cf</span> <span class="o">=</span> <span class="n">rdbuffer</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;lastcif&#39;</span><span class="p">)</span>
143                <span class="k">print</span> <span class="s">&#39;Reusing previously parsed CIF&#39;</span>
144            <span class="k">if</span> <span class="n">cf</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
145                <span class="bp">self</span><span class="o">.</span><span class="n">ShowBusy</span><span class="p">()</span> <span class="c"># this can take a while</span>
146                <span class="k">try</span><span class="p">:</span>
147                    <span class="n">cf</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">ReadCIF</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
148                <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">detail</span><span class="p">:</span>
149                    <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&quot;Parse or reading of file failed in pyCifRW; check syntax of file in enCIFer or CheckCIF&quot;</span>
150                    <span class="k">return</span> <span class="bp">False</span>
151                <span class="k">finally</span><span class="p">:</span>
152                    <span class="bp">self</span><span class="o">.</span><span class="n">DoneBusy</span><span class="p">()</span>
153            <span class="c"># scan blocks for reflections</span>
154            <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;Error during scan of blocks for datasets&#39;</span>
155            <span class="n">blklist</span> <span class="o">=</span> <span class="p">[]</span>
156            <span class="k">for</span> <span class="n">blk</span> <span class="ow">in</span> <span class="n">cf</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span> <span class="c"># scan for reflections, F or F2 values and cell lengths.</span>
157                <span class="c"># Ignore blocks that do not have structure factors and a cell</span>
158                <span class="n">blkkeys</span> <span class="o">=</span> <span class="p">[</span><span class="n">k</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">cf</span><span class="p">[</span><span class="n">blk</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()]</span>
159                <span class="n">gotFo</span> <span class="o">=</span> <span class="bp">False</span>
160                <span class="n">gotFo2</span> <span class="o">=</span> <span class="bp">False</span>
161                <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">2</span><span class="p">):</span>
162                    <span class="k">if</span> <span class="n">hklitems</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="ow">in</span> <span class="n">blkkeys</span> <span class="ow">and</span> <span class="n">hklitems</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="ow">in</span> <span class="n">blkkeys</span> <span class="ow">and</span> <span class="n">hklitems</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="mi">2</span><span class="p">]</span> <span class="ow">in</span> <span class="n">blkkeys</span><span class="p">:</span>
163                        <span class="n">dnIndex</span> <span class="o">=</span> <span class="n">i</span>
164                        <span class="k">break</span>
165                <span class="k">else</span><span class="p">:</span>
166                    <span class="k">break</span> <span class="c"># no reflections</span>
167                <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">Fdatanames</span><span class="p">:</span> 
168                    <span class="k">if</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">blkkeys</span><span class="p">:</span>
169                        <span class="n">blklist</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">blk</span><span class="p">)</span>
170                        <span class="n">gotFo</span> <span class="o">=</span> <span class="bp">True</span>
171                        <span class="k">break</span>
172                <span class="k">if</span> <span class="n">gotFo</span><span class="p">:</span> <span class="k">break</span>
173                <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">F2datanames</span><span class="p">:</span> 
174                    <span class="k">if</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">blkkeys</span><span class="p">:</span>
175                        <span class="n">blklist</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">blk</span><span class="p">)</span>
176                        <span class="k">break</span>
177                <span class="k">else</span><span class="p">:</span>
178                    <span class="k">break</span>
179            <span class="k">if</span> <span class="ow">not</span> <span class="n">blklist</span><span class="p">:</span>
180                <span class="n">selblk</span> <span class="o">=</span> <span class="bp">None</span> <span class="c"># no block to choose</span>
181            <span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">blklist</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span> <span class="c"># only one choice</span>
182                <span class="n">selblk</span> <span class="o">=</span> <span class="mi">0</span>
183            <span class="k">else</span><span class="p">:</span>                       <span class="c"># choose from options</span>
184                <span class="n">choice</span> <span class="o">=</span> <span class="p">[]</span>
185                <span class="k">for</span> <span class="n">blknm</span> <span class="ow">in</span> <span class="n">blklist</span><span class="p">:</span>
186                    <span class="n">choice</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;&#39;</span><span class="p">)</span>
187                    <span class="c"># accumumlate some info about this phase</span>
188                    <span class="n">choice</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">blknm</span> <span class="o">+</span> <span class="s">&#39;: &#39;</span>
189                    <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">phasenamefields</span><span class="p">:</span> <span class="c"># get a name for the phase</span>
190                        <span class="n">name</span> <span class="o">=</span> <span class="n">cf</span><span class="p">[</span><span class="n">blknm</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
191                        <span class="k">if</span> <span class="n">name</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> <span class="n">name</span> <span class="o">==</span> <span class="s">&#39;?&#39;</span> <span class="ow">or</span> <span class="n">name</span> <span class="o">==</span> <span class="s">&#39;.&#39;</span><span class="p">:</span>
192                            <span class="k">continue</span>
193                        <span class="k">else</span><span class="p">:</span>
194                            <span class="n">choice</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">name</span><span class="o">.</span><span class="n">strip</span><span class="p">()[:</span><span class="mi">20</span><span class="p">]</span> <span class="o">+</span> <span class="s">&#39;, &#39;</span>
195                            <span class="k">break</span>
196                    <span class="n">s</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
197                    <span class="n">fmt</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%.2f</span><span class="s">,&quot;</span>
198                    <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">key</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">cellitems</span><span class="p">[</span><span class="n">dnIndex</span><span class="p">]):</span>
199                        <span class="k">if</span> <span class="n">i</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span> <span class="n">fmt</span> <span class="o">=</span> <span class="s">&quot;%.f,&quot;</span>
200                        <span class="k">if</span> <span class="n">i</span> <span class="o">==</span> <span class="mi">5</span><span class="p">:</span> <span class="n">fmt</span> <span class="o">=</span> <span class="s">&quot;%.f&quot;</span>
201                        <span class="n">val</span> <span class="o">=</span> <span class="n">cf</span><span class="p">[</span><span class="n">blknm</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>
202                        <span class="k">if</span> <span class="n">val</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span> <span class="k">break</span>
203                        <span class="n">s</span> <span class="o">+=</span> <span class="n">fmt</span> <span class="o">%</span> <span class="n">cif</span><span class="o">.</span><span class="n">get_number_with_esd</span><span class="p">(</span><span class="n">val</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
204                    <span class="k">if</span> <span class="n">s</span><span class="p">:</span> <span class="n">choice</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;, cell: &#39;</span> <span class="o">+</span> <span class="n">s</span>
205                    <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">SGdataname</span><span class="p">:</span>
206                        <span class="n">sg</span> <span class="o">=</span> <span class="n">cf</span><span class="p">[</span><span class="n">blknm</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">dn</span><span class="p">)</span>
207                        <span class="k">if</span> <span class="n">sg</span><span class="p">:</span> 
208                            <span class="n">choice</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;, (&#39;</span> <span class="o">+</span> <span class="n">sg</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="o">+</span> <span class="s">&#39;)&#39;</span>
209                            <span class="k">break</span>
210                <span class="n">choice</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;Import all of the above&#39;</span><span class="p">)</span>
211                <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">repeat</span><span class="p">:</span> <span class="c"># we were called to repeat the read</span>
212                    <span class="n">selblk</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">repeatcount</span>
213                    <span class="bp">self</span><span class="o">.</span><span class="n">repeatcount</span> <span class="o">+=</span> <span class="mi">1</span>
214                    <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">repeatcount</span> <span class="o">&gt;=</span> <span class="nb">len</span><span class="p">(</span><span class="n">blklist</span><span class="p">):</span> <span class="bp">self</span><span class="o">.</span><span class="n">repeat</span> <span class="o">=</span> <span class="bp">False</span>
215                <span class="k">else</span><span class="p">:</span>
216                    <span class="n">selblk</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">BlockSelector</span><span class="p">(</span>
217                        <span class="n">choice</span><span class="p">,</span>
218                        <span class="n">ParentFrame</span><span class="o">=</span><span class="n">ParentFrame</span><span class="p">,</span>
219                        <span class="n">title</span><span class="o">=</span><span class="s">&#39;Select a dataset from one the CIF data_ blocks below&#39;</span><span class="p">,</span>
220                        <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">600</span><span class="p">,</span><span class="mi">100</span><span class="p">),</span>
221                        <span class="n">header</span><span class="o">=</span><span class="s">&#39;Dataset Selector&#39;</span><span class="p">)</span>
222            <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;Error during reading of selected block&#39;</span>
223            <span class="k">if</span> <span class="n">selblk</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
224                <span class="k">return</span> <span class="bp">False</span> <span class="c"># no block selected or available</span>
225            <span class="k">if</span> <span class="n">selblk</span> <span class="o">&gt;=</span> <span class="nb">len</span><span class="p">(</span><span class="n">blklist</span><span class="p">):</span> <span class="c"># all blocks selected</span>
226                <span class="n">selblk</span> <span class="o">=</span> <span class="mi">0</span>
227                <span class="bp">self</span><span class="o">.</span><span class="n">repeat</span> <span class="o">=</span> <span class="bp">True</span>
228                <span class="k">if</span> <span class="n">rdbuffer</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
229                    <span class="n">rdbuffer</span><span class="p">[</span><span class="s">&#39;lastcif&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">cf</span> <span class="c"># save the parsed cif for the next loop</span>
230                <span class="bp">self</span><span class="o">.</span><span class="n">repeatcount</span> <span class="o">=</span> <span class="mi">1</span>
231            <span class="n">blknm</span> <span class="o">=</span> <span class="n">blklist</span><span class="p">[</span><span class="n">selblk</span><span class="p">]</span>
232            <span class="n">blk</span> <span class="o">=</span> <span class="n">cf</span><span class="p">[</span><span class="n">blklist</span><span class="p">[</span><span class="n">selblk</span><span class="p">]]</span>
233            <span class="bp">self</span><span class="o">.</span><span class="n">objname</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span><span class="o">+</span><span class="s">&#39;:&#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">blknm</span><span class="p">)</span>
234            <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;Error during reading of reflections&#39;</span>
235            <span class="c"># read in reflections</span>
236            <span class="k">try</span><span class="p">:</span>
237                <span class="n">refloop</span> <span class="o">=</span> <span class="n">blk</span><span class="o">.</span><span class="n">GetLoop</span><span class="p">(</span><span class="n">hklitems</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span>
238                <span class="n">dnIndex</span> <span class="o">=</span> <span class="mi">0</span>
239            <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
240                <span class="k">try</span><span class="p">:</span>
241                    <span class="n">refloop</span> <span class="o">=</span> <span class="n">blk</span><span class="o">.</span><span class="n">GetLoop</span><span class="p">(</span><span class="n">hklitems</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span>
242                    <span class="n">dnIndex</span> <span class="o">=</span> <span class="mi">1</span>
243                <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
244                    <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">+=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">Unexpected: &#39;_refln[-.]index_h not found!&quot;</span>
245                    <span class="k">return</span> <span class="bp">False</span>
246            <span class="n">itemkeys</span> <span class="o">=</span> <span class="p">{}</span>
247            <span class="c"># prepare an index to the CIF reflection loop</span>
248            <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">key</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">refloop</span><span class="o">.</span><span class="n">keys</span><span class="p">()):</span>
249                <span class="n">itemkeys</span><span class="p">[</span><span class="n">key</span><span class="o">.</span><span class="n">lower</span><span class="p">()]</span> <span class="o">=</span> <span class="n">i</span>
250               
251            <span class="c"># scan for data names:</span>
252            <span class="n">F2dn</span> <span class="o">=</span> <span class="bp">None</span>
253            <span class="n">Fdn</span> <span class="o">=</span> <span class="bp">None</span>
254            <span class="n">F2cdn</span> <span class="o">=</span> <span class="bp">None</span>
255            <span class="n">Fcdn</span> <span class="o">=</span> <span class="bp">None</span>
256            <span class="n">F2sdn</span> <span class="o">=</span> <span class="bp">None</span>
257            <span class="n">Fsdn</span> <span class="o">=</span> <span class="bp">None</span>
258            <span class="n">Phdn</span> <span class="o">=</span> <span class="bp">None</span>
259            <span class="n">FcalcPresent</span> <span class="o">=</span> <span class="bp">False</span>
260            <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">F2datanames</span><span class="p">:</span>
261                <span class="k">if</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">itemkeys</span><span class="p">:</span>
262                    <span class="n">F2dn</span> <span class="o">=</span> <span class="n">dn</span>
263                    <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">F2calcnames</span><span class="p">:</span>
264                        <span class="k">if</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">itemkeys</span><span class="p">:</span>
265                            <span class="n">F2cdn</span> <span class="o">=</span> <span class="n">dn</span>
266                            <span class="n">FcalcPresent</span> <span class="o">=</span> <span class="bp">True</span>
267                            <span class="k">break</span>
268                    <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">F2signames</span><span class="p">:</span>
269                        <span class="k">if</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">itemkeys</span><span class="p">:</span>
270                            <span class="n">F2sdn</span> <span class="o">=</span> <span class="n">dn</span>
271                            <span class="k">break</span>
272                    <span class="k">break</span>
273            <span class="k">else</span><span class="p">:</span>
274                <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">Fdatanames</span><span class="p">:</span>
275                    <span class="k">if</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">itemkeys</span><span class="p">:</span>
276                        <span class="n">Fdn</span> <span class="o">=</span> <span class="n">dn</span>
277                        <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">Fcalcnames</span><span class="p">:</span>
278                            <span class="k">if</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">itemkeys</span><span class="p">:</span>
279                                <span class="n">Fcdn</span> <span class="o">=</span> <span class="n">dn</span>
280                                <span class="n">FcalcPresent</span> <span class="o">=</span> <span class="bp">True</span>
281                                <span class="k">break</span>
282                        <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">Fsignames</span><span class="p">:</span>
283                            <span class="k">if</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">itemkeys</span><span class="p">:</span>
284                                <span class="n">Fsdn</span> <span class="o">=</span> <span class="n">dn</span>
285                                <span class="k">break</span>
286                        <span class="k">break</span>
287                <span class="k">else</span><span class="p">:</span>
288                    <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">no F or F2 loop value found in file</span><span class="se">\n</span><span class="s">&quot;</span>
289                    <span class="n">msg</span> <span class="o">+=</span> <span class="s">&quot;A CIF reflection file needs to have at least one of</span><span class="se">\n</span><span class="s">&quot;</span>
290                    <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">F2datanames</span><span class="o">+</span><span class="n">Fdatanames</span><span class="p">:</span>
291                        <span class="n">msg</span> <span class="o">+=</span> <span class="n">dn</span> <span class="o">+</span> <span class="s">&#39;, &#39;</span>
292                    <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">+=</span> <span class="n">msg</span>                       
293                    <span class="k">return</span> <span class="bp">False</span>
294            <span class="k">for</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">phasenames</span><span class="p">:</span>
295                <span class="k">if</span> <span class="n">dn</span> <span class="ow">in</span> <span class="n">itemkeys</span><span class="p">:</span>
296                    <span class="n">Phdn</span> <span class="o">=</span> <span class="n">dn</span>
297                    <span class="k">break</span>
298               
299            <span class="c"># loop over all reflections</span>
300            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">refloop</span><span class="p">:</span>
301                <span class="n">F2c</span> <span class="o">=</span> <span class="mf">0.0</span>
302                <span class="n">sigF2</span> <span class="o">=</span> <span class="mf">0.0</span>
303                <span class="n">HKL</span> <span class="o">=</span> <span class="p">[]</span>
304                <span class="k">try</span><span class="p">:</span>
305                    <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">hklitems</span><span class="p">[</span><span class="n">dnIndex</span><span class="p">]:</span> <span class="c"># &#39;_refln[._]index_[hkl]&#39;</span>
306                        <span class="n">num</span> <span class="o">=</span> <span class="n">itemkeys</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
307                        <span class="k">try</span><span class="p">:</span>
308                            <span class="n">HKL</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">item</span><span class="p">[</span><span class="n">num</span><span class="p">]))</span>
309                        <span class="k">except</span><span class="p">:</span>
310                            <span class="n">HKL</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)</span>
311                    <span class="c">#h,k,l,m,dsp,Fo2,sig,Fc2,Fot2,Fct2,phase,...</span>
312                    <span class="n">ref</span> <span class="o">=</span> <span class="n">HKL</span><span class="o">+</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><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> 
313                    <span class="k">if</span> <span class="n">F2dn</span><span class="p">:</span>
314                        <span class="n">F2</span> <span class="o">=</span> <span class="n">item</span><span class="p">[</span><span class="n">itemkeys</span><span class="p">[</span><span class="n">F2dn</span><span class="p">]]</span>
315                        <span class="k">if</span> <span class="s">&#39;(&#39;</span> <span class="ow">in</span> <span class="n">F2</span><span class="p">:</span>
316                            <span class="n">F2</span><span class="p">,</span> <span class="n">sigF2</span> <span class="o">=</span> <span class="n">cif</span><span class="o">.</span><span class="n">get_number_with_esd</span><span class="p">(</span><span class="n">F2</span><span class="p">)</span>
317                            <span class="n">F2</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">F2</span><span class="p">)</span>
318                            <span class="n">sigF2</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">sigF2</span><span class="p">)</span>
319                        <span class="k">elif</span> <span class="n">F2sdn</span><span class="p">:</span>
320                            <span class="n">F2</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">F2</span><span class="p">)</span>
321                            <span class="n">sigF2</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">item</span><span class="p">[</span><span class="n">itemkeys</span><span class="p">[</span><span class="n">F2sdn</span><span class="p">]])</span>
322                        <span class="k">else</span><span class="p">:</span>
323                            <span class="n">F2</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">F2</span><span class="p">)</span>
324                        <span class="k">try</span><span class="p">:</span>
325                            <span class="k">if</span> <span class="n">F2cdn</span><span class="p">:</span>
326                                <span class="n">F2c</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">item</span><span class="p">[</span><span class="n">itemkeys</span><span class="p">[</span><span class="n">F2cdn</span><span class="p">]])</span>
327                        <span class="k">except</span><span class="p">:</span>
328                            <span class="k">pass</span>
329                    <span class="k">else</span><span class="p">:</span>
330                        <span class="n">F</span> <span class="o">=</span> <span class="n">item</span><span class="p">[</span><span class="n">itemkeys</span><span class="p">[</span><span class="n">Fdn</span><span class="p">]]</span>
331                        <span class="k">if</span> <span class="s">&#39;(&#39;</span> <span class="ow">in</span> <span class="n">F</span><span class="p">:</span>
332                            <span class="n">F</span><span class="p">,</span> <span class="n">sig</span> <span class="o">=</span> <span class="n">cif</span><span class="o">.</span><span class="n">get_number_with_esd</span><span class="p">(</span><span class="n">F</span><span class="p">)</span>
333                        <span class="k">elif</span> <span class="n">Fsdn</span><span class="p">:</span>
334                            <span class="n">F</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">F</span><span class="p">)</span>
335                            <span class="n">sig</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">item</span><span class="p">[</span><span class="n">itemkeys</span><span class="p">[</span><span class="n">Fsdn</span><span class="p">]])</span>
336                        <span class="k">else</span><span class="p">:</span>
337                            <span class="n">F</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">F</span><span class="p">)</span>
338                            <span class="n">sig</span> <span class="o">=</span> <span class="mf">0.0</span>
339                        <span class="n">F2</span> <span class="o">=</span> <span class="n">F</span><span class="o">**</span><span class="mi">2</span>
340                        <span class="n">sigF2</span> <span class="o">=</span> <span class="mf">2.0</span><span class="o">*</span><span class="n">F</span><span class="o">*</span><span class="n">sig</span>
341                        <span class="k">try</span><span class="p">:</span>
342                            <span class="k">if</span> <span class="n">Fcdn</span><span class="p">:</span>
343                                <span class="n">Fc</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">item</span><span class="p">[</span><span class="n">itemkeys</span><span class="p">[</span><span class="n">Fcdn</span><span class="p">]])</span>
344                                <span class="n">F2c</span> <span class="o">=</span> <span class="n">Fc</span><span class="o">*</span><span class="n">Fc</span>
345                        <span class="k">except</span><span class="p">:</span>
346                            <span class="k">pass</span>
347                               
348                    <span class="n">ref</span><span class="p">[</span><span class="mi">8</span><span class="p">]</span> <span class="o">=</span> <span class="n">F2</span>
349                    <span class="n">ref</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span> <span class="o">=</span> <span class="n">F2</span>
350                    <span class="n">ref</span><span class="p">[</span><span class="mi">6</span><span class="p">]</span> <span class="o">=</span> <span class="n">sigF2</span>
351                    <span class="n">ref</span><span class="p">[</span><span class="mi">9</span><span class="p">]</span> <span class="o">=</span> <span class="n">F2c</span>
352                    <span class="n">ref</span><span class="p">[</span><span class="mi">7</span><span class="p">]</span> <span class="o">=</span> <span class="n">F2c</span>
353                    <span class="k">try</span><span class="p">:</span>
354                        <span class="k">if</span> <span class="n">Phdn</span><span class="p">:</span>
355                            <span class="n">ref</span><span class="p">[</span><span class="mi">10</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">item</span><span class="p">[</span><span class="n">itemkeys</span><span class="p">[</span><span class="n">Phdn</span><span class="p">]])</span>
356                    <span class="k">except</span><span class="p">:</span>
357                        <span class="k">pass</span>
358                <span class="k">except</span><span class="p">:</span>
359                    <span class="k">continue</span> <span class="c"># skip over incompletely parsed reflections</span>
360                <span class="bp">self</span><span class="o">.</span><span class="n">RefDict</span><span class="p">[</span><span class="s">&#39;RefList&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ref</span><span class="p">)</span>
361                <span class="bp">self</span><span class="o">.</span><span class="n">RefDict</span><span class="p">[</span><span class="s">&#39;FF&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">({})</span>
362            <span class="bp">self</span><span class="o">.</span><span class="n">RefDict</span><span class="p">[</span><span class="s">&#39;RefList&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">RefDict</span><span class="p">[</span><span class="s">&#39;RefList&#39;</span><span class="p">])</span>
363            <span class="bp">self</span><span class="o">.</span><span class="n">errors</span> <span class="o">=</span> <span class="s">&#39;Error during reading of dataset parameters&#39;</span>
364            <span class="bp">self</span><span class="o">.</span><span class="n">UpdateControls</span><span class="p">(</span><span class="n">Type</span><span class="o">=</span><span class="s">&#39;Fosq&#39;</span><span class="p">,</span><span class="n">FcalcPresent</span><span class="o">=</span><span class="n">FcalcPresent</span><span class="p">)</span> <span class="c"># set Fobs type &amp; if Fcalc values are loaded</span>
365            <span class="k">if</span> <span class="n">blk</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;_diffrn_radiation_probe&#39;</span><span class="p">):</span>
366                <span class="k">if</span> <span class="n">blk</span><span class="p">[</span><span class="s">&#39;_diffrn_radiation_probe&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;neutron&#39;</span><span class="p">:</span>
367                    <span class="nb">type</span> <span class="o">=</span> <span class="s">&#39;SNC&#39;</span>
368            <span class="k">elif</span> <span class="n">blk</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;_diffrn_radiation.probe&#39;</span><span class="p">):</span>
369                <span class="k">if</span> <span class="n">blk</span><span class="p">[</span><span class="s">&#39;_diffrn_radiation.probe&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;neutron&#39;</span><span class="p">:</span>
370                    <span class="nb">type</span> <span class="o">=</span> <span class="s">&#39;SNC&#39;</span>
371            <span class="k">else</span><span class="p">:</span>
372                <span class="nb">type</span> <span class="o">=</span> <span class="s">&#39;SXC&#39;</span>
373            <span class="k">if</span> <span class="n">blk</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;_diffrn_radiation_wavelength&#39;</span><span class="p">):</span>
374                <span class="n">wave</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">blk</span><span class="p">[</span><span class="s">&#39;_diffrn_radiation_wavelength&#39;</span><span class="p">])</span>
375            <span class="k">elif</span> <span class="n">blk</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;_diffrn_radiation.wavelength&#39;</span><span class="p">):</span>
376                <span class="n">wave</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">blk</span><span class="p">[</span><span class="s">&#39;_diffrn_radiation.wavelength&#39;</span><span class="p">])</span>
377            <span class="k">else</span><span class="p">:</span>
378                <span class="n">wave</span> <span class="o">=</span> <span class="bp">None</span>
379            <span class="bp">self</span><span class="o">.</span><span class="n">UpdateParameters</span><span class="p">(</span><span class="n">Type</span><span class="o">=</span><span class="nb">type</span><span class="p">,</span><span class="n">Wave</span><span class="o">=</span><span class="n">wave</span><span class="p">)</span> <span class="c"># histogram type</span>
380            <span class="k">return</span> <span class="bp">True</span>
381        <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">detail</span><span class="p">:</span>
382            <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>
383            <span class="k">print</span> <span class="bp">self</span><span class="o">.</span><span class="n">formatName</span><span class="o">+</span><span class="s">&#39; read error:&#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">detail</span><span class="p">)</span> <span class="c"># for testing</span>
384            <span class="kn">import</span> <span class="nn">traceback</span>
385            <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>
386        <span class="k">return</span> <span class="bp">False</span></div></div>
387</pre></div>
388
389          </div>
390        </div>
391      </div>
392      <div class="sphinxsidebar">
393        <div class="sphinxsidebarwrapper">
394            <p class="logo"><a href="../index.html">
395              <img class="logo" src="../_static/G2_html_logo.png" alt="Logo"/>
396            </a></p>
397<div id="searchbox" style="display: none">
398  <h3>Quick search</h3>
399    <form class="search" action="../search.html" method="get">
400      <input type="text" name="q" />
401      <input type="submit" value="Go" />
402      <input type="hidden" name="check_keywords" value="yes" />
403      <input type="hidden" name="area" value="default" />
404    </form>
405    <p class="searchtip" style="font-size: 90%">
406    Enter search terms or a module, class or function name.
407    </p>
408</div>
409<script type="text/javascript">$('#searchbox').show(0);</script>
410        </div>
411      </div>
412      <div class="clearer"></div>
413    </div>
414    <div class="related">
415      <h3>Navigation</h3>
416      <ul>
417        <li class="right" style="margin-right: 10px">
418          <a href="../genindex.html" title="General Index"
419             >index</a></li>
420        <li class="right" >
421          <a href="../py-modindex.html" title="Python Module Index"
422             >modules</a> |</li>
423        <li><a href="../index.html">GSAS-II 0.2.0 documentation</a> &raquo;</li>
424          <li><a href="index.html" >Module code</a> &raquo;</li> 
425      </ul>
426    </div>
427    <div class="footer">
428        &copy; Copyright 2013, Von Dreele and Toby for Argonne National Laboratory.
429      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
430    </div>
431  </body>
432</html>
Note: See TracBrowser for help on using the repository browser.