Ignore:
Timestamp:
Jan 5, 2014 9:22:22 AM (8 years ago)
Author:
toby
Message:

fixup number formatting; update produced doc files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sphinxdocs/build/html/_modules/GSASIIplot.html

    r1168 r1183  
    5858<span class="sd">&#39;&#39;&#39;</span>
    5959<span class="c">########### SVN repository information ###################</span>
    60 <span class="c"># $Date: 2013-11-26 14:32:25 -0600 (Tue, 26 Nov 2013) $</span>
     60<span class="c"># $Date: 2014-01-02 11:38:59 -0600 (Thu, 02 Jan 2014) $</span>
    6161<span class="c"># $Author: vondreele $</span>
    62 <span class="c"># $Revision: 1153 $</span>
     62<span class="c"># $Revision: 1180 $</span>
    6363<span class="c"># $URL: https://subversion.xor.aps.anl.gov/pyGSAS/trunk/GSASIIplot.py $</span>
    64 <span class="c"># $Id: GSASIIplot.py 1153 2013-11-26 20:32:25Z vondreele $</span>
     64<span class="c"># $Id: GSASIIplot.py 1180 2014-01-02 17:38:59Z vondreele $</span>
    6565<span class="c">########### SVN repository information ###################</span>
    6666<span class="kn">import</span> <span class="nn">math</span>
     
    7878<span class="kn">import</span> <span class="nn">mpl_toolkits.mplot3d.axes3d</span> <span class="kn">as</span> <span class="nn">mp3d</span>
    7979<span class="kn">import</span> <span class="nn">GSASIIpath</span>
    80 <span class="n">GSASIIpath</span><span class="o">.</span><span class="n">SetVersionNumber</span><span class="p">(</span><span class="s">&quot;$Revision: 1153 $&quot;</span><span class="p">)</span>
     80<span class="n">GSASIIpath</span><span class="o">.</span><span class="n">SetVersionNumber</span><span class="p">(</span><span class="s">&quot;$Revision: 1180 $&quot;</span><span class="p">)</span>
    8181<span class="kn">import</span> <span class="nn">GSASIIgrid</span> <span class="kn">as</span> <span class="nn">G2gd</span>
    8282<span class="kn">import</span> <span class="nn">GSASIIimage</span> <span class="kn">as</span> <span class="nn">G2img</span>
     
    12451245<span class="c">################################################################################</span>
    12461246            </div>
    1247 <div class="viewcode-block" id="PlotXY"><a class="viewcode-back" href="../GSASIIplot.html#GSASIIplot.PlotXY">[docs]</a><span class="k">def</span> <span class="nf">PlotXY</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">XY</span><span class="p">,</span><span class="n">newPlot</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span><span class="nb">type</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">):</span>
     1247<div class="viewcode-block" id="PlotXY"><a class="viewcode-back" href="../GSASIIplot.html#GSASIIplot.PlotXY">[docs]</a><span class="k">def</span> <span class="nf">PlotXY</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">XY</span><span class="p">,</span><span class="n">XY2</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span><span class="n">labelX</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span><span class="n">labelY</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span><span class="n">newPlot</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span><span class="nb">type</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">):</span>
    12481248    <span class="sd">&#39;&#39;&#39;simple plot of xy data, used for diagnostic purposes</span>
    12491249<span class="sd">    &#39;&#39;&#39;</span>
     
    12771277    <span class="n">G2frame</span><span class="o">.</span><span class="n">G2plotNB</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="n">DestroyChildren</span><span class="p">()</span>
    12781278    <span class="n">Plot</span><span class="o">.</span><span class="n">set_title</span><span class="p">(</span><span class="nb">type</span><span class="p">)</span>
    1279     <span class="n">Plot</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="s">r&#39;X&#39;</span><span class="p">,</span><span class="n">fontsize</span><span class="o">=</span><span class="mi">14</span><span class="p">)</span>
    1280     <span class="n">Plot</span><span class="o">.</span><span class="n">set_ylabel</span><span class="p">(</span><span class="s">r&#39;&#39;</span><span class="o">+</span><span class="nb">type</span><span class="p">,</span><span class="n">fontsize</span><span class="o">=</span><span class="mi">14</span><span class="p">)</span>
     1279    <span class="k">if</span> <span class="n">xLabel</span><span class="p">:</span>
     1280        <span class="n">Plot</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="s">r&#39;&#39;</span><span class="o">+</span><span class="n">xLabel</span><span class="p">,</span><span class="n">fontsize</span><span class="o">=</span><span class="mi">14</span><span class="p">)</span>
     1281    <span class="k">else</span><span class="p">:</span>
     1282        <span class="n">Plot</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="s">r&#39;X&#39;</span><span class="p">,</span><span class="n">fontsize</span><span class="o">=</span><span class="mi">14</span><span class="p">)</span>
     1283    <span class="k">if</span> <span class="n">yLabel</span><span class="p">:</span>
     1284        <span class="n">Plot</span><span class="o">.</span><span class="n">set_ylabel</span><span class="p">(</span><span class="s">r&#39;&#39;</span><span class="o">+</span><span class="n">yLabel</span><span class="p">,</span><span class="n">fontsize</span><span class="o">=</span><span class="mi">14</span><span class="p">)</span>
     1285    <span class="k">else</span><span class="p">:</span>
     1286        <span class="n">Plot</span><span class="o">.</span><span class="n">set_ylabel</span><span class="p">(</span><span class="s">r&#39;Y&#39;</span><span class="p">,</span><span class="n">fontsize</span><span class="o">=</span><span class="mi">14</span><span class="p">)</span>
    12811287    <span class="n">colors</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;b&#39;</span><span class="p">,</span><span class="s">&#39;g&#39;</span><span class="p">,</span><span class="s">&#39;r&#39;</span><span class="p">,</span><span class="s">&#39;c&#39;</span><span class="p">,</span><span class="s">&#39;m&#39;</span><span class="p">,</span><span class="s">&#39;k&#39;</span><span class="p">]</span>
    1282     <span class="n">Ymax</span> <span class="o">=</span> <span class="mf">1.0</span>
    1283     <span class="n">lenX</span> <span class="o">=</span> <span class="mi">0</span>
    1284     <span class="n">X</span><span class="p">,</span><span class="n">Y</span> <span class="o">=</span> <span class="n">XY</span><span class="p">[:</span><span class="mi">2</span><span class="p">]</span>
    1285     <span class="n">Ymax</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">Ymax</span><span class="p">,</span><span class="nb">max</span><span class="p">(</span><span class="n">Y</span><span class="p">))</span>
    1286     <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">X</span><span class="p">,</span><span class="n">Y</span><span class="p">,</span><span class="s">&#39;k&#39;</span><span class="p">,</span><span class="n">picker</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
     1288    <span class="k">for</span> <span class="n">ixy</span><span class="p">,</span><span class="n">xy</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">XY</span><span class="p">):</span>
     1289        <span class="n">X</span><span class="p">,</span><span class="n">Y</span> <span class="o">=</span> <span class="n">xy</span>
     1290        <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">X</span><span class="p">,</span><span class="n">Y</span><span class="p">,</span><span class="n">color</span><span class="p">(</span><span class="n">ixy</span><span class="o">%</span><span class="mi">6</span><span class="p">)</span><span class="o">+</span><span class="s">&#39;+&#39;</span><span class="p">,</span><span class="n">picker</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
     1291    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">XY2</span><span class="p">):</span>
     1292        <span class="k">for</span> <span class="n">ixy</span><span class="p">,</span><span class="n">xy</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">XY2</span><span class="p">):</span>
     1293            <span class="n">X</span><span class="p">,</span><span class="n">Y</span> <span class="o">=</span> <span class="n">xy</span>
     1294            <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">X</span><span class="p">,</span><span class="n">Y</span><span class="p">,</span><span class="n">color</span><span class="p">(</span><span class="n">ixy</span><span class="o">%</span><span class="mi">6</span><span class="p">),</span><span class="n">picker</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
     1295    <span class="k">if</span> <span class="ow">not</span> <span class="n">newPlot</span><span class="p">:</span>
     1296        <span class="n">Page</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">push_current</span><span class="p">()</span>
     1297        <span class="n">Plot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="n">xylim</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
     1298        <span class="n">Plot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="n">xylim</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
     1299        <span class="n">xylim</span> <span class="o">=</span> <span class="p">[]</span>
     1300        <span class="n">Page</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">push_current</span><span class="p">()</span>
     1301        <span class="n">Page</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
     1302    <span class="k">else</span><span class="p">:</span>
     1303        <span class="n">Page</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
     1304
     1305<span class="c">################################################################################</span>
     1306<span class="c">##### PlotStrain</span>
     1307<span class="c">################################################################################</span>
     1308            </div>
     1309<div class="viewcode-block" id="PlotStrain"><a class="viewcode-back" href="../GSASIIplot.html#GSASIIplot.PlotStrain">[docs]</a><span class="k">def</span> <span class="nf">PlotStrain</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">data</span><span class="p">,</span><span class="n">newPlot</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span><span class="nb">type</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">):</span>
     1310    <span class="sd">&#39;&#39;&#39;plot of strain data, used for diagnostic purposes</span>
     1311<span class="sd">    &#39;&#39;&#39;</span>
     1312    <span class="k">def</span> <span class="nf">OnMotion</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     1313        <span class="n">xpos</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">xdata</span>
     1314        <span class="k">if</span> <span class="n">xpos</span><span class="p">:</span>                                        <span class="c">#avoid out of frame mouse position</span>
     1315            <span class="n">ypos</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">ydata</span>
     1316            <span class="n">Page</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">SetCursor</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">CROSS_CURSOR</span><span class="p">)</span>
     1317            <span class="k">try</span><span class="p">:</span>
     1318                <span class="n">G2frame</span><span class="o">.</span><span class="n">G2plotNB</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="n">SetStatusText</span><span class="p">(</span><span class="s">&#39;X =</span><span class="si">%9.3f</span><span class="s"> </span><span class="si">%s</span><span class="s"> =</span><span class="si">%9.3f</span><span class="s">&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">xpos</span><span class="p">,</span><span class="nb">type</span><span class="p">,</span><span class="n">ypos</span><span class="p">),</span><span class="mi">1</span><span class="p">)</span>                   
     1319            <span class="k">except</span> <span class="ne">TypeError</span><span class="p">:</span>
     1320                <span class="n">G2frame</span><span class="o">.</span><span class="n">G2plotNB</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="n">SetStatusText</span><span class="p">(</span><span class="s">&#39;Select &#39;</span><span class="o">+</span><span class="nb">type</span><span class="o">+</span><span class="s">&#39; pattern first&#39;</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>
     1321
     1322    <span class="k">try</span><span class="p">:</span>
     1323        <span class="n">plotNum</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">G2plotNB</span><span class="o">.</span><span class="n">plotList</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="nb">type</span><span class="p">)</span>
     1324        <span class="n">Page</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">G2plotNB</span><span class="o">.</span><span class="n">nb</span><span class="o">.</span><span class="n">GetPage</span><span class="p">(</span><span class="n">plotNum</span><span class="p">)</span>
     1325        <span class="k">if</span> <span class="ow">not</span> <span class="n">newPlot</span><span class="p">:</span>
     1326            <span class="n">Plot</span> <span class="o">=</span> <span class="n">Page</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">gca</span><span class="p">()</span>
     1327            <span class="n">xylim</span> <span class="o">=</span> <span class="n">Plot</span><span class="o">.</span><span class="n">get_xlim</span><span class="p">(),</span><span class="n">Plot</span><span class="o">.</span><span class="n">get_ylim</span><span class="p">()</span>
     1328        <span class="n">Page</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">clf</span><span class="p">()</span>
     1329        <span class="n">Plot</span> <span class="o">=</span> <span class="n">Page</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">gca</span><span class="p">()</span>
     1330    <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
     1331        <span class="n">newPlot</span> <span class="o">=</span> <span class="bp">True</span>
     1332        <span class="n">Plot</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">G2plotNB</span><span class="o">.</span><span class="n">addMpl</span><span class="p">(</span><span class="nb">type</span><span class="p">)</span><span class="o">.</span><span class="n">gca</span><span class="p">()</span>
     1333        <span class="n">plotNum</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">G2plotNB</span><span class="o">.</span><span class="n">plotList</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="nb">type</span><span class="p">)</span>
     1334        <span class="n">Page</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">G2plotNB</span><span class="o">.</span><span class="n">nb</span><span class="o">.</span><span class="n">GetPage</span><span class="p">(</span><span class="n">plotNum</span><span class="p">)</span>
     1335        <span class="n">Page</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;motion_notify_event&#39;</span><span class="p">,</span> <span class="n">OnMotion</span><span class="p">)</span>
     1336   
     1337    <span class="n">Page</span><span class="o">.</span><span class="n">Choice</span> <span class="o">=</span> <span class="bp">None</span>
     1338    <span class="n">Page</span><span class="o">.</span><span class="n">SetFocus</span><span class="p">()</span>
     1339    <span class="n">G2frame</span><span class="o">.</span><span class="n">G2plotNB</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="n">DestroyChildren</span><span class="p">()</span>
     1340    <span class="n">Plot</span><span class="o">.</span><span class="n">set_title</span><span class="p">(</span><span class="nb">type</span><span class="p">)</span>
     1341    <span class="n">Plot</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="s">r&#39;$\mathsf{2\theta}$&#39;</span><span class="p">,</span><span class="n">fontsize</span><span class="o">=</span><span class="mi">14</span><span class="p">)</span>
     1342    <span class="n">Plot</span><span class="o">.</span><span class="n">set_ylabel</span><span class="p">(</span><span class="s">r&#39;Azimuth&#39;</span><span class="p">,</span><span class="n">fontsize</span><span class="o">=</span><span class="mi">14</span><span class="p">)</span>
     1343    <span class="n">colors</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;b&#39;</span><span class="p">,</span><span class="s">&#39;g&#39;</span><span class="p">,</span><span class="s">&#39;r&#39;</span><span class="p">,</span><span class="s">&#39;c&#39;</span><span class="p">,</span><span class="s">&#39;m&#39;</span><span class="p">,</span><span class="s">&#39;k&#39;</span><span class="p">]</span>
     1344    <span class="k">for</span> <span class="n">N</span><span class="p">,</span><span class="n">item</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">]):</span>
     1345        <span class="n">X</span><span class="p">,</span><span class="n">Y</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="n">item</span><span class="p">[</span><span class="s">&#39;ImtaObs&#39;</span><span class="p">])</span>
     1346        <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">X</span><span class="p">,</span><span class="n">Y</span><span class="p">,</span><span class="n">colors</span><span class="p">[</span><span class="n">N</span><span class="o">%</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="s">&#39;+&#39;</span><span class="p">,</span><span class="n">picker</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
     1347        <span class="n">X</span><span class="p">,</span><span class="n">Y</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="n">item</span><span class="p">[</span><span class="s">&#39;ImtaCalc&#39;</span><span class="p">])</span>
     1348        <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">X</span><span class="p">,</span><span class="n">Y</span><span class="p">,</span><span class="n">colors</span><span class="p">[</span><span class="n">N</span><span class="o">%</span><span class="mi">6</span><span class="p">],</span><span class="n">picker</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
    12871349    <span class="k">if</span> <span class="ow">not</span> <span class="n">newPlot</span><span class="p">:</span>
    12881350        <span class="n">Page</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">push_current</span><span class="p">()</span>
     
    23752437                    <span class="k">elif</span> <span class="s">&#39;line3&#39;</span> <span class="ow">in</span> <span class="n">itemPicked</span><span class="p">:</span>
    23762438                        <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">azm</span><span class="p">)</span>
    2377                         <span class="k">if</span> <span class="n">Data</span><span class="p">[</span><span class="s">&#39;fullIntegrate&#39;</span><span class="p">]:</span>
    2378                             <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">+</span><span class="mi">360</span>
    23792439                    <span class="k">elif</span> <span class="s">&#39;line4&#39;</span> <span class="ow">in</span> <span class="n">itemPicked</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">Data</span><span class="p">[</span><span class="s">&#39;fullIntegrate&#39;</span><span class="p">]:</span>
    23802440                        <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">azm</span><span class="p">)</span>
    2381                        
     2441                   
     2442                    <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">%=</span> <span class="mi">360</span>
     2443                    <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">%=</span> <span class="mi">360</span>
    23822444                    <span class="k">if</span> <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">&gt;</span> <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]:</span>
    2383                         <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">-=</span> <span class="mi">360</span>
    2384                        
    2385                     <span class="n">azLim</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="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">])</span>   
    2386                     <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">azLim</span><span class="o">&gt;</span><span class="mi">360</span><span class="p">):</span>
    2387                         <span class="n">azLim</span> <span class="o">-=</span> <span class="mi">360</span>
    2388                         <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">azLim</span><span class="p">)</span>
     2445                        <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">+=</span> <span class="mi">360</span>                       
     2446                    <span class="k">if</span> <span class="n">Data</span><span class="p">[</span><span class="s">&#39;fullIntegrate&#39;</span><span class="p">]:</span>
     2447                        <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">Data</span><span class="p">[</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">+</span><span class="mi">360</span>
    23892448                       
    23902449                    <span class="k">if</span>  <span class="n">Data</span><span class="p">[</span><span class="s">&#39;IOtth&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">&gt;</span> <span class="n">Data</span><span class="p">[</span><span class="s">&#39;IOtth&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]:</span>
     
    25462605                <span class="n">xyI</span> <span class="o">=</span> <span class="p">[]</span>
    25472606                <span class="k">for</span> <span class="n">azm</span> <span class="ow">in</span> <span class="n">Azm</span><span class="p">:</span>
    2548                     <span class="n">xyI</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">G2img</span><span class="o">.</span><span class="n">GetDetectorXY</span><span class="p">(</span><span class="n">dspI</span><span class="p">,</span><span class="n">azm</span><span class="p">,</span><span class="n">Data</span><span class="p">))</span>      <span class="c">#what about hyperbola?</span>
    2549                 <span class="n">xyI</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="n">xyI</span><span class="p">)</span>
    2550                 <span class="n">arcxI</span><span class="p">,</span><span class="n">arcyI</span> <span class="o">=</span> <span class="n">xyI</span><span class="o">.</span><span class="n">T</span>
    2551                 <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">arcxI</span><span class="p">,</span><span class="n">arcyI</span><span class="p">,</span><span class="n">picker</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
     2607                    <span class="n">xy</span> <span class="o">=</span> <span class="n">G2img</span><span class="o">.</span><span class="n">GetDetectorXY</span><span class="p">(</span><span class="n">dspI</span><span class="p">,</span><span class="n">azm</span><span class="p">,</span><span class="n">Data</span><span class="p">)</span>
     2608                    <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">xy</span><span class="p">):</span>
     2609                        <span class="n">xyI</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">xy</span><span class="p">)</span>
     2610                <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">xyI</span><span class="p">):</span>
     2611                    <span class="n">xyI</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="n">xyI</span><span class="p">)</span>
     2612                    <span class="n">arcxI</span><span class="p">,</span><span class="n">arcyI</span> <span class="o">=</span> <span class="n">xyI</span><span class="o">.</span><span class="n">T</span>
     2613                    <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">arcxI</span><span class="p">,</span><span class="n">arcyI</span><span class="p">,</span><span class="n">picker</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
    25522614            <span class="k">if</span> <span class="n">ellO</span><span class="p">:</span>
    25532615                <span class="n">xyO</span> <span class="o">=</span> <span class="p">[]</span>
    25542616                <span class="k">for</span> <span class="n">azm</span> <span class="ow">in</span> <span class="n">Azm</span><span class="p">:</span>
    2555                     <span class="n">xyO</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">G2img</span><span class="o">.</span><span class="n">GetDetectorXY</span><span class="p">(</span><span class="n">dspO</span><span class="p">,</span><span class="n">azm</span><span class="p">,</span><span class="n">Data</span><span class="p">))</span>      <span class="c">#what about hyperbola?</span>
    2556                 <span class="n">xyO</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="n">xyO</span><span class="p">)</span>
    2557                 <span class="n">arcxO</span><span class="p">,</span><span class="n">arcyO</span> <span class="o">=</span> <span class="n">xyO</span><span class="o">.</span><span class="n">T</span>
    2558                 <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">arcxO</span><span class="p">,</span><span class="n">arcyO</span><span class="p">,</span><span class="n">picker</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
     2617                    <span class="n">xy</span> <span class="o">=</span> <span class="n">G2img</span><span class="o">.</span><span class="n">GetDetectorXY</span><span class="p">(</span><span class="n">dspO</span><span class="p">,</span><span class="n">azm</span><span class="p">,</span><span class="n">Data</span><span class="p">)</span>
     2618                    <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">any</span><span class="p">(</span><span class="n">xy</span><span class="p">):</span>
     2619                        <span class="n">xyO</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">xy</span><span class="p">)</span>
     2620                <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">xyO</span><span class="p">):</span>
     2621                    <span class="n">xyO</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="n">xyO</span><span class="p">)</span>
     2622                    <span class="n">arcxO</span><span class="p">,</span><span class="n">arcyO</span> <span class="o">=</span> <span class="n">xyO</span><span class="o">.</span><span class="n">T</span>               
     2623                    <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">arcxO</span><span class="p">,</span><span class="n">arcyO</span><span class="p">,</span><span class="n">picker</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
    25592624            <span class="k">if</span> <span class="n">ellO</span> <span class="ow">and</span> <span class="n">ellI</span><span class="p">:</span>
    25602625                <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="n">arcxI</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">arcxO</span><span class="p">[</span><span class="mi">0</span><span class="p">]],[</span><span class="n">arcyI</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">arcyO</span><span class="p">[</span><span class="mi">0</span><span class="p">]],</span><span class="n">picker</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
     
    25832648        <span class="k">if</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemText</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">PickId</span><span class="p">)</span> <span class="ow">in</span> <span class="s">&#39;Stress/Strain&#39;</span><span class="p">:</span>
    25842649            <span class="k">print</span> <span class="s">&#39;plot stress/strain stuff&#39;</span>
    2585             <span class="k">for</span> <span class="n">ring</span> <span class="ow">in</span> <span class="n">StrSta</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">]:</span>
     2650            <span class="k">for</span> <span class="n">N</span><span class="p">,</span><span class="n">ring</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">StrSta</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">]):</span>
    25862651                <span class="n">xring</span><span class="p">,</span><span class="n">yring</span> <span class="o">=</span> <span class="n">ring</span><span class="p">[</span><span class="s">&#39;ImxyObs&#39;</span><span class="p">]</span>
    2587                 <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">xring</span><span class="p">,</span><span class="n">yring</span><span class="p">,</span><span class="s">&#39;r+&#39;</span><span class="p">)</span>
    2588 <span class="c">#                for xring,yring in ring[&#39;ImxyCalc&#39;].T:</span>
    2589 <span class="c">#                    Plot.add_artist(Polygon(ring[&#39;ImxyCalc&#39;].T,ec=&#39;b&#39;,fc=&#39;none&#39;))</span>
    2590 <span class="c">#                    Plot.plot(xring,yring)</span>
     2652                <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">xring</span><span class="p">,</span><span class="n">yring</span><span class="p">,</span><span class="n">colors</span><span class="p">[</span><span class="n">N</span><span class="o">%</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="s">&#39;+&#39;</span><span class="p">)</span>
     2653                <span class="k">for</span> <span class="n">xring</span><span class="p">,</span><span class="n">yring</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">ring</span><span class="p">[</span><span class="s">&#39;ImxyCalc&#39;</span><span class="p">])</span><span class="o">.</span><span class="n">T</span><span class="p">:</span>
     2654                    <span class="n">Plot</span><span class="o">.</span><span class="n">add_artist</span><span class="p">(</span><span class="n">Polygon</span><span class="p">(</span><span class="n">ring</span><span class="p">[</span><span class="s">&#39;ImxyCalc&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">T</span><span class="p">,</span><span class="n">ec</span><span class="o">=</span><span class="s">&#39;b&#39;</span><span class="p">,</span><span class="n">fc</span><span class="o">=</span><span class="s">&#39;none&#39;</span><span class="p">))</span>
     2655                    <span class="n">Plot</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">xring</span><span class="p">,</span><span class="n">yring</span><span class="p">)</span>
    25912656        <span class="c">#masks - mask lines numbered after integration limit lines</span>
    25922657        <span class="n">spots</span> <span class="o">=</span> <span class="n">Masks</span><span class="p">[</span><span class="s">&#39;Points&#39;</span><span class="p">]</span>
Note: See TracChangeset for help on using the changeset viewer.