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/GSASIIimgGUI.html

    r1168 r1183  
    5454<span class="c">#GSASII - image data display routines</span>
    5555<span class="c">########### SVN repository information ###################</span>
    56 <span class="c"># $Date: 2013-11-27 14:34:56 -0600 (Wed, 27 Nov 2013) $</span>
     56<span class="c"># $Date: 2014-01-02 11:38:59 -0600 (Thu, 02 Jan 2014) $</span>
    5757<span class="c"># $Author: vondreele $</span>
    58 <span class="c"># $Revision: 1158 $</span>
     58<span class="c"># $Revision: 1180 $</span>
    5959<span class="c"># $URL: https://subversion.xor.aps.anl.gov/pyGSAS/trunk/GSASIIimgGUI.py $</span>
    60 <span class="c"># $Id: GSASIIimgGUI.py 1158 2013-11-27 20:34:56Z vondreele $</span>
     60<span class="c"># $Id: GSASIIimgGUI.py 1180 2014-01-02 17:38:59Z vondreele $</span>
    6161<span class="c">########### SVN repository information ###################</span>
    6262<span class="sd">&#39;&#39;&#39;</span>
     
    7474<span class="kn">import</span> <span class="nn">cPickle</span>
    7575<span class="kn">import</span> <span class="nn">GSASIIpath</span>
    76 <span class="n">GSASIIpath</span><span class="o">.</span><span class="n">SetVersionNumber</span><span class="p">(</span><span class="s">&quot;$Revision: 1158 $&quot;</span><span class="p">)</span>
     76<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>
    7777<span class="kn">import</span> <span class="nn">GSASIIimage</span> <span class="kn">as</span> <span class="nn">G2img</span>
    7878<span class="kn">import</span> <span class="nn">GSASIIplot</span> <span class="kn">as</span> <span class="nn">G2plt</span>
     
    103103        <span class="n">data</span><span class="p">[</span><span class="s">&#39;DetDepth&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0.</span>
    104104        <span class="n">data</span><span class="p">[</span><span class="s">&#39;DetDepthRef&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">False</span>
     105    <span class="k">if</span> <span class="s">&#39;SampleAbs&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">data</span><span class="p">:</span>
     106        <span class="n">data</span><span class="p">[</span><span class="s">&#39;SampleShape&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&#39;Cylinder&#39;</span>
     107        <span class="n">data</span><span class="p">[</span><span class="s">&#39;SampleAbs&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">,</span><span class="bp">False</span><span class="p">]</span>
    105108<span class="c">#end patch</span>
    106109
     
    516519       
    517520        <span class="k">def</span> <span class="nf">OnLRazim</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
    518             <span class="n">Lazm</span> <span class="o">=</span><span class="nb">int</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">Lazim</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
     521            <span class="n">Lazm</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">Lazim</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span><span class="o">%</span><span class="mi">360</span>
     522            <span class="n">Razm</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">Razim</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span><span class="o">%</span><span class="mi">360</span>
     523            <span class="k">if</span> <span class="n">Lazm</span> <span class="o">&gt;</span> <span class="n">Razm</span><span class="p">:</span>
     524                <span class="n">Razm</span> <span class="o">+=</span> <span class="mi">360</span>
    519525            <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>
    520                <span class="n">G2frame</span><span class="o">.</span><span class="n">Razim</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%6d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">Lazm</span><span class="o">+</span><span class="mi">360</span><span class="p">))</span>
    521             <span class="n">Razm</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">Razim</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
    522             <span class="k">if</span> <span class="n">Lazm</span> <span class="o">&gt;</span> <span class="n">Razm</span><span class="p">:</span>
    523                 <span class="n">Lazm</span> <span class="o">-=</span> <span class="mi">360</span>
     526                <span class="n">Razm</span> <span class="o">=</span> <span class="n">Lazm</span><span class="o">+</span><span class="mi">360</span>
     527            <span class="n">G2frame</span><span class="o">.</span><span class="n">Lazim</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%6d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">Lazm</span><span class="p">))</span>
     528            <span class="n">G2frame</span><span class="o">.</span><span class="n">Razim</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%6d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">Razm</span><span class="p">))</span>
    524529            <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="p">[</span><span class="n">Lazm</span><span class="p">,</span><span class="n">Razm</span><span class="p">]</span>
    525530            <span class="n">G2plt</span><span class="o">.</span><span class="n">PlotExposedImage</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">event</span><span class="o">=</span><span class="n">event</span><span class="p">)</span>
     
    562567                <span class="k">pass</span>
    563568            <span class="n">obliqVal</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%.3f</span><span class="s">&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;Oblique&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]))</span>
     569                           
     570        <span class="k">def</span> <span class="nf">OnSamAbs</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     571            <span class="k">if</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;SampleAbs&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]:</span>
     572                <span class="n">data</span><span class="p">[</span><span class="s">&#39;SampleAbs&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="bp">False</span>
     573            <span class="k">else</span><span class="p">:</span>
     574                <span class="n">data</span><span class="p">[</span><span class="s">&#39;SampleAbs&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="bp">True</span>
     575               
     576        <span class="k">def</span> <span class="nf">OnSamAbsVal</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     577            <span class="k">try</span><span class="p">:</span>
     578                <span class="n">value</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">samabsVal</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
     579                <span class="k">if</span> <span class="mf">0.00</span> <span class="o">&lt;=</span> <span class="n">value</span> <span class="o">&lt;=</span> <span class="mf">2.00</span><span class="p">:</span>
     580                    <span class="n">data</span><span class="p">[</span><span class="s">&#39;SampleAbs&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
     581                <span class="k">else</span><span class="p">:</span>
     582                    <span class="k">raise</span> <span class="ne">ValueError</span>
     583            <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
     584                <span class="k">pass</span>
     585            <span class="n">samabsVal</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%.3f</span><span class="s">&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;SampleAbs&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]))</span>
    564586                           
    565587        <span class="k">def</span> <span class="nf">OnShowLines</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     
    664686        <span class="n">outAzim</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_KILL_FOCUS</span><span class="p">,</span><span class="n">OnNumOutAzms</span><span class="p">)</span>
    665687        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">outAzim</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     688        <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">littleSizer</span><span class="p">,</span><span class="mi">0</span><span class="p">,)</span>
     689        <span class="n">littleSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
     690        <span class="n">samabs</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">CheckBox</span><span class="p">(</span><span class="n">parent</span><span class="o">=</span><span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="s">&#39;Apply sample absorption?&#39;</span><span class="p">)</span>
     691        <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">samabs</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     692        <span class="n">samabs</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_CHECKBOX</span><span class="p">,</span> <span class="n">OnSamAbs</span><span class="p">)</span>
     693        <span class="n">samabs</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;SampleAbs&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">])</span>
     694        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="s">&#39;mu/R (0.00-2.0) &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
     695            <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     696        <span class="n">samabsVal</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="n">parent</span><span class="o">=</span><span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">,</span><span class="n">value</span><span class="o">=</span><span class="s">&#39;</span><span class="si">%.3f</span><span class="s">&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;SampleAbs&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]),</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_PROCESS_ENTER</span><span class="p">)</span>
     697        <span class="n">samabsVal</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_TEXT_ENTER</span><span class="p">,</span><span class="n">OnSamAbsVal</span><span class="p">)</span>
     698        <span class="n">samabsVal</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_KILL_FOCUS</span><span class="p">,</span><span class="n">OnSamAbsVal</span><span class="p">)</span>
     699        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">samabsVal</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
    666700        <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">littleSizer</span><span class="p">,</span><span class="mi">0</span><span class="p">,)</span>
    667701        <span class="n">littleSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
     
    14131447            <span class="n">G2gd</span><span class="o">.</span><span class="n">GetPatternTreeItemId</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">G2frame</span><span class="o">.</span><span class="n">Image</span><span class="p">,</span> <span class="s">&#39;Image Controls&#39;</span><span class="p">))</span>
    14141448        <span class="n">G2img</span><span class="o">.</span><span class="n">FitStrSta</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">ImageZ</span><span class="p">,</span><span class="n">data</span><span class="p">,</span><span class="n">Controls</span><span class="p">,</span><span class="n">Masks</span><span class="p">)</span>
     1449        <span class="n">UpdateStressStrain</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">data</span><span class="p">)</span>
    14151450        <span class="n">G2plt</span><span class="o">.</span><span class="n">PlotExposedImage</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">event</span><span class="o">=</span><span class="n">event</span><span class="p">)</span>
     1451        <span class="n">G2plt</span><span class="o">.</span><span class="n">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;Strain&#39;</span><span class="p">)</span>
    14161452       
    14171453    <span class="k">def</span> <span class="nf">SamSizer</span><span class="p">():</span>
Note: See TracChangeset for help on using the changeset viewer.