Ignore:
Timestamp:
Apr 23, 2014 5:11:13 PM (8 years ago)
Author:
toby
Message:

Start on parametric fitting; Time for new manual; fix minor formatting

File:
1 edited

Legend:

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

    r1183 r1298  
    5454<span class="c">#GSASII - image data display routines</span>
    5555<span class="c">########### SVN repository information ###################</span>
    56 <span class="c"># $Date: 2014-01-02 11:38:59 -0600 (Thu, 02 Jan 2014) $</span>
     56<span class="c"># $Date: 2014-04-11 10:17:01 -0500 (Fri, 11 Apr 2014) $</span>
    5757<span class="c"># $Author: vondreele $</span>
    58 <span class="c"># $Revision: 1180 $</span>
     58<span class="c"># $Revision: 1274 $</span>
    5959<span class="c"># $URL: https://subversion.xor.aps.anl.gov/pyGSAS/trunk/GSASIIimgGUI.py $</span>
    60 <span class="c"># $Id: GSASIIimgGUI.py 1180 2014-01-02 17:38:59Z vondreele $</span>
     60<span class="c"># $Id: GSASIIimgGUI.py 1274 2014-04-11 15:17:01Z vondreele $</span>
    6161<span class="c">########### SVN repository information ###################</span>
    6262<span class="sd">&#39;&#39;&#39;</span>
     
    6868<span class="sd">&#39;&#39;&#39;</span>
    6969<span class="kn">import</span> <span class="nn">wx</span>
     70<span class="kn">import</span> <span class="nn">wx.lib.scrolledpanel</span> <span class="kn">as</span> <span class="nn">wxscroll</span>
    7071<span class="kn">import</span> <span class="nn">matplotlib</span> <span class="kn">as</span> <span class="nn">mpl</span>
    7172<span class="kn">import</span> <span class="nn">math</span>
     
    7475<span class="kn">import</span> <span class="nn">cPickle</span>
    7576<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: 1180 $&quot;</span><span class="p">)</span>
     77<span class="n">GSASIIpath</span><span class="o">.</span><span class="n">SetVersionNumber</span><span class="p">(</span><span class="s">&quot;$Revision: 1274 $&quot;</span><span class="p">)</span>
    7778<span class="kn">import</span> <span class="nn">GSASIIimage</span> <span class="kn">as</span> <span class="nn">G2img</span>
     79<span class="kn">import</span> <span class="nn">GSASIImath</span> <span class="kn">as</span> <span class="nn">G2mth</span>
    7880<span class="kn">import</span> <span class="nn">GSASIIplot</span> <span class="kn">as</span> <span class="nn">G2plt</span>
    7981<span class="kn">import</span> <span class="nn">GSASIIIO</span> <span class="kn">as</span> <span class="nn">G2IO</span>
     
    8284
    8385<span class="n">VERY_LIGHT_GREY</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Colour</span><span class="p">(</span><span class="mi">235</span><span class="p">,</span><span class="mi">235</span><span class="p">,</span><span class="mi">235</span><span class="p">)</span>
     86<span class="n">WACV</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span>
    8487
    8588<span class="c"># trig functions in degrees</span>
     
    106109        <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>
    107110        <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>
     111    <span class="k">if</span> <span class="s">&#39;binType&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">data</span><span class="p">:</span>
     112        <span class="k">if</span> <span class="s">&#39;PWDR&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     113            <span class="n">data</span><span class="p">[</span><span class="s">&#39;binType&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&#39;2-theta&#39;</span>
     114        <span class="k">elif</span> <span class="s">&#39;SASD&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     115            <span class="n">data</span><span class="p">[</span><span class="s">&#39;binType&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&#39;log(q)&#39;</span>
    108116<span class="c">#end patch</span>
    109117
     
    136144            <span class="n">style</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">PD_ELAPSED_TIME</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">PD_AUTO_HIDE</span><span class="p">)</span>
    137145        <span class="k">try</span><span class="p">:</span>
    138             <span class="k">if</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]:</span>
    139                 <span class="n">maskCopy</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">masks</span><span class="p">)</span>
    140                 <span class="n">backImg</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
    141                 <span class="n">backScale</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span>
    142                 <span class="nb">id</span> <span class="o">=</span> <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">root</span><span class="p">,</span> <span class="n">backImg</span><span class="p">)</span>
    143                 <span class="n">Npix</span><span class="p">,</span><span class="n">imagefile</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span>
    144                 <span class="n">backImage</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">GetImageData</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">imagefile</span><span class="p">,</span><span class="bp">True</span><span class="p">)</span><span class="o">*</span><span class="n">backScale</span>
    145                 <span class="n">sumImage</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">ImageZ</span><span class="o">+</span><span class="n">backImage</span>
    146                 <span class="n">sumMin</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">min</span><span class="p">(</span><span class="n">sumImage</span><span class="p">)</span>
    147                 <span class="n">sumMax</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">max</span><span class="p">(</span><span class="n">sumImage</span><span class="p">)</span>
    148                 <span class="n">maskCopy</span><span class="p">[</span><span class="s">&#39;Thresholds&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[(</span><span class="n">sumMin</span><span class="p">,</span><span class="n">sumMax</span><span class="p">),[</span><span class="n">sumMin</span><span class="p">,</span><span class="n">sumMax</span><span class="p">]]</span>
    149                 <span class="n">G2frame</span><span class="o">.</span><span class="n">Integrate</span> <span class="o">=</span> <span class="n">G2img</span><span class="o">.</span><span class="n">ImageIntegrate</span><span class="p">(</span><span class="n">sumImage</span><span class="p">,</span><span class="n">data</span><span class="p">,</span><span class="n">maskCopy</span><span class="p">,</span><span class="n">blkSize</span><span class="p">,</span><span class="n">dlg</span><span class="p">)</span>
    150             <span class="k">else</span><span class="p">:</span>
    151                 <span class="n">G2frame</span><span class="o">.</span><span class="n">Integrate</span> <span class="o">=</span> <span class="n">G2img</span><span class="o">.</span><span class="n">ImageIntegrate</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">masks</span><span class="p">,</span><span class="n">blkSize</span><span class="p">,</span><span class="n">dlg</span><span class="p">)</span>
     146            <span class="n">sumImg</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">ImageZ</span>
     147            <span class="n">darkImg</span><span class="p">,</span><span class="n">darkScale</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;dark image&#39;</span><span class="p">]</span>
     148            <span class="k">if</span> <span class="n">darkImg</span><span class="p">:</span>
     149                <span class="n">Did</span> <span class="o">=</span> <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">root</span><span class="p">,</span> <span class="n">darkImg</span><span class="p">)</span>
     150                <span class="n">Npix</span><span class="p">,</span><span class="n">imagefile</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span><span class="n">Did</span><span class="p">)</span>
     151                <span class="n">darkImage</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">GetImageData</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">imagefile</span><span class="p">,</span><span class="bp">True</span><span class="p">)</span>
     152                <span class="n">sumImg</span> <span class="o">+=</span> <span class="n">darkImage</span><span class="o">*</span><span class="n">darkScale</span>
     153            <span class="n">backImg</span><span class="p">,</span><span class="n">backScale</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">]</span>           
     154            <span class="k">if</span> <span class="n">backImg</span><span class="p">:</span>     <span class="c">#ignores any transmission effect in the background image</span>
     155                <span class="n">Bid</span> <span class="o">=</span> <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">root</span><span class="p">,</span> <span class="n">backImg</span><span class="p">)</span>
     156                <span class="n">Npix</span><span class="p">,</span><span class="n">imagefile</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span><span class="n">Bid</span><span class="p">)</span>
     157                <span class="n">backImage</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">GetImageData</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">imagefile</span><span class="p">,</span><span class="bp">True</span><span class="p">)</span>
     158                <span class="n">Bdata</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span><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">Bid</span><span class="p">,</span><span class="s">&#39;Image Controls&#39;</span><span class="p">))</span>
     159                <span class="n">BdarkImg</span><span class="p">,</span><span class="n">BdarkScale</span> <span class="o">=</span> <span class="n">Bdata</span><span class="p">[</span><span class="s">&#39;dark image&#39;</span><span class="p">]</span>
     160                <span class="k">if</span> <span class="n">BdarkImg</span><span class="p">:</span>
     161                    <span class="n">BDid</span> <span class="o">=</span> <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">root</span><span class="p">,</span><span class="n">BdarkImg</span><span class="p">)</span>
     162                    <span class="n">Npix</span><span class="p">,</span><span class="n">imagefile</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span><span class="n">BDid</span><span class="p">)</span>
     163                    <span class="n">BdarkImage</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">GetImageData</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">imagefile</span><span class="p">,</span><span class="bp">True</span><span class="p">)</span>
     164                    <span class="n">backImage</span> <span class="o">+=</span> <span class="n">BdarkImage</span><span class="o">*</span><span class="n">BdarkScale</span>               
     165                <span class="n">sumImg</span> <span class="o">+=</span> <span class="n">backImage</span><span class="o">*</span><span class="n">backScale</span>
     166            <span class="n">G2frame</span><span class="o">.</span><span class="n">Integrate</span> <span class="o">=</span> <span class="n">G2img</span><span class="o">.</span><span class="n">ImageIntegrate</span><span class="p">(</span><span class="n">sumImg</span><span class="p">,</span><span class="n">data</span><span class="p">,</span><span class="n">masks</span><span class="p">,</span><span class="n">blkSize</span><span class="p">,</span><span class="n">dlg</span><span class="p">)</span>
    152167    <span class="c">#        G2plt.PlotIntegration(G2frame,newPlot=True)</span>
    153168            <span class="n">G2IO</span><span class="o">.</span><span class="n">SaveIntegration</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">PickId</span><span class="p">,</span><span class="n">data</span><span class="p">)</span>
     
    275290                <span class="n">keys</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">,</span><span class="s">&#39;wavelength&#39;</span><span class="p">,</span><span class="s">&#39;calibrant&#39;</span><span class="p">,</span><span class="s">&#39;distance&#39;</span><span class="p">,</span><span class="s">&#39;center&#39;</span><span class="p">,</span>
    276291                    <span class="s">&#39;tilt&#39;</span><span class="p">,</span><span class="s">&#39;rotation&#39;</span><span class="p">,</span><span class="s">&#39;azmthOff&#39;</span><span class="p">,</span><span class="s">&#39;fullIntegrate&#39;</span><span class="p">,</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">,</span>
    277                     <span class="s">&#39;IOtth&#39;</span><span class="p">,</span><span class="s">&#39;outAzimuths&#39;</span><span class="p">,</span><span class="s">&#39;invert_x&#39;</span><span class="p">,</span><span class="s">&#39;invert_y&#39;</span><span class="p">]</span>
     292                    <span class="s">&#39;IOtth&#39;</span><span class="p">,</span><span class="s">&#39;outAzimuths&#39;</span><span class="p">,</span><span class="s">&#39;invert_x&#39;</span><span class="p">,</span><span class="s">&#39;invert_y&#39;</span><span class="p">,</span><span class="s">&#39;DetDepth&#39;</span><span class="p">]</span>
    278293                <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keys</span><span class="p">:</span>
    279294                    <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;rotation&#39;</span><span class="p">]:</span>
     
    286301       
    287302    <span class="k">def</span> <span class="nf">OnLoadControls</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
    288         <span class="n">cntlList</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;wavelength&#39;</span><span class="p">,</span><span class="s">&#39;distance&#39;</span><span class="p">,</span><span class="s">&#39;tilt&#39;</span><span class="p">,</span><span class="s">&#39;invert_x&#39;</span><span class="p">,</span><span class="s">&#39;invert_y&#39;</span><span class="p">,</span>
    289             <span class="s">&#39;fullIntegrate&#39;</span><span class="p">,</span><span class="s">&#39;outAzimuths&#39;</span><span class="p">,</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">,</span><span class="s">&#39;IOtth&#39;</span><span class="p">,</span><span class="s">&#39;azmthOff&#39;</span><span class="p">]</span>
     303        <span class="n">cntlList</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;wavelength&#39;</span><span class="p">,</span><span class="s">&#39;distance&#39;</span><span class="p">,</span><span class="s">&#39;tilt&#39;</span><span class="p">,</span><span class="s">&#39;invert_x&#39;</span><span class="p">,</span><span class="s">&#39;invert_y&#39;</span><span class="p">,</span><span class="s">&#39;type&#39;</span><span class="p">,</span>
     304            <span class="s">&#39;fullIntegrate&#39;</span><span class="p">,</span><span class="s">&#39;outAzimuths&#39;</span><span class="p">,</span><span class="s">&#39;LRazimuth&#39;</span><span class="p">,</span><span class="s">&#39;IOtth&#39;</span><span class="p">,</span><span class="s">&#39;azmthOff&#39;</span><span class="p">,</span><span class="s">&#39;DetDepth&#39;</span><span class="p">]</span>
    290305        <span class="n">dlg</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FileDialog</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span> <span class="s">&#39;Choose image controls file&#39;</span><span class="p">,</span> <span class="s">&#39;.&#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">,</span>
    291306            <span class="s">&#39;image control files (*.imctrl)|*.imctrl&#39;</span><span class="p">,</span><span class="n">wx</span><span class="o">.</span><span class="n">OPEN</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CHANGE_DIR</span><span class="p">)</span>
     
    328343        <span class="k">def</span> <span class="nf">OnDataType</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
    329344            <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">typeSel</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()[:</span><span class="mi">4</span><span class="p">]</span>
     345            <span class="k">if</span> <span class="s">&#39;SASD&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     346                <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">np</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</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="c">#switch from muT to trans!</span>
     347                <span class="k">if</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;binType&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;2-theta&#39;</span><span class="p">:</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;binType&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&#39;log(q)&#39;</span>  <span class="c">#switch default bin type</span>
     348            <span class="k">elif</span> <span class="s">&#39;PWDR&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     349                <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="o">-</span><span class="n">np</span><span class="o">.</span><span class="n">log</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="c">#switch from trans to muT!</span>
     350                <span class="k">if</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;binType&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;log(q)&#39;</span><span class="p">:</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;binType&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s">&#39;2-theta&#39;</span>  <span class="c">#switch default bin type                 </span>
    330351            <span class="n">wx</span><span class="o">.</span><span class="n">CallAfter</span><span class="p">(</span><span class="n">UpdateImageControls</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">masks</span><span class="p">)</span>
    331352   
     
    344365       
    345366        <span class="n">comboSizer</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>
    346         <span class="n">comboSizer</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">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; Type of image data: &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    347             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     367        <span class="n">comboSizer</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">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; Type of image data: &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    348368        <span class="n">typeSel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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="n">typeDict</span><span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]],</span><span class="n">choices</span><span class="o">=</span><span class="n">typeList</span><span class="p">,</span>
    349369            <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_DROPDOWN</span><span class="p">)</span>
    350370        <span class="n">typeSel</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;type&#39;</span><span class="p">])</span>
    351371        <span class="n">typeSel</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_COMBOBOX</span><span class="p">,</span> <span class="n">OnDataType</span><span class="p">)</span>
    352         <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">typeSel</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>
    353         <span class="n">comboSizer</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">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; Color bar &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    354             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     372        <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">typeSel</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     373        <span class="n">comboSizer</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">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; Color bar &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    355374        <span class="n">colSel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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="n">data</span><span class="p">[</span><span class="s">&#39;color&#39;</span><span class="p">],</span><span class="n">choices</span><span class="o">=</span><span class="n">colorList</span><span class="p">,</span>
    356375            <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_DROPDOWN</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_SORT</span><span class="p">)</span>
    357376        <span class="n">colSel</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_COMBOBOX</span><span class="p">,</span> <span class="n">OnNewColorBar</span><span class="p">)</span>
    358         <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">colSel</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>
    359         <span class="n">comboSizer</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">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; Azimuth offset &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    360             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     377        <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">colSel</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     378        <span class="n">comboSizer</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">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; Azimuth offset &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    361379        <span class="n">azmthOff</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="p">(</span><span class="s">&quot;</span><span class="si">%.2f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;azmthOff&#39;</span><span class="p">])),</span>
    362380            <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>
    363381        <span class="n">azmthOff</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">OnAzmthOff</span><span class="p">)</span>
    364382        <span class="n">azmthOff</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">OnAzmthOff</span><span class="p">)</span>
    365         <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">azmthOff</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>
     383        <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">azmthOff</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    366384        <span class="k">return</span> <span class="n">comboSizer</span>
    367385       
     
    418436        <span class="n">DeltOne</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;range&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="nb">max</span><span class="p">(</span><span class="mf">0.0</span><span class="p">,</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;range&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span>
    419437        <span class="n">sqrtDeltOne</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">DeltOne</span><span class="p">)</span>
    420         <span class="n">maxSizer</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">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; Max intensity&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    421             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     438        <span class="n">maxSizer</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">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; Max intensity&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    422439        <span class="n">maxSel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Slider</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">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">SL_HORIZONTAL</span><span class="p">,</span>
    423440            <span class="n">value</span><span class="o">=</span><span class="nb">int</span><span class="p">(</span><span class="mi">100</span><span class="o">*</span><span class="n">sqrtDeltOne</span><span class="o">/</span><span class="n">sqrtDeltZero</span><span class="p">))</span>
     
    427444        <span class="n">maxVal</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">OnMaxVal</span><span class="p">)</span>   
    428445        <span class="n">maxVal</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">OnMaxVal</span><span class="p">)</span>
    429         <span class="n">maxSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">maxVal</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>   
    430         <span class="n">maxSizer</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">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; Min intensity&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    431             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     446        <span class="n">maxSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">maxVal</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>   
     447        <span class="n">maxSizer</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">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; Min intensity&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    432448        <span class="n">minSel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Slider</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">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">SL_HORIZONTAL</span><span class="p">,</span>
    433449            <span class="n">value</span><span class="o">=</span><span class="nb">int</span><span class="p">(</span><span class="mi">100</span><span class="o">*</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;range&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span><span class="o">-</span><span class="nb">max</span><span class="p">(</span><span class="mf">0.0</span><span class="p">,</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;range&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">]))</span><span class="o">/</span><span class="n">DeltOne</span><span class="p">))</span>
     
    437453        <span class="n">minVal</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">OnMinVal</span><span class="p">)</span>   
    438454        <span class="n">minVal</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">OnMinVal</span><span class="p">)</span>
    439         <span class="n">maxSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">minVal</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>
     455        <span class="n">maxSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">minVal</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    440456        <span class="k">return</span> <span class="n">maxSizer</span>
    441457       
     
    450466            <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
    451467                <span class="k">pass</span>
    452             <span class="n">waveSel</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%6.5f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;wavelength&#39;</span><span class="p">]))</span>          <span class="c">#reset in case of error</span>
     468            <span class="n">waveSel</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%7.5f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;wavelength&#39;</span><span class="p">]))</span>          <span class="c">#reset in case of error</span>
    453469           
    454470        <span class="k">def</span> <span class="nf">OnDetDepthRef</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     
    463479           
    464480        <span class="n">calibSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    465         <span class="n">calibSizer</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">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; Calibration coefficients&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    466             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>   
     481        <span class="n">calibSizer</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">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; Calibration coefficients&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>   
    467482        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>       
    468         <span class="n">calibSizer</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">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; Beam center X,Y&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    469             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     483        <span class="n">calibSizer</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">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; Beam center X,Y&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    470484        <span class="n">cent</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;center&#39;</span><span class="p">]</span>
    471         <span class="n">centText</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="p">(</span><span class="s">&quot;</span><span class="si">%8.3f</span><span class="s">,</span><span class="si">%8.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">cent</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">cent</span><span class="p">[</span><span class="mi">1</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_READONLY</span><span class="p">)</span>
     485        <span class="n">centText</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="p">(</span><span class="s">&quot;</span><span class="si">%7.2f</span><span class="s">,</span><span class="si">%7.2f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">cent</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">cent</span><span class="p">[</span><span class="mi">1</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_READONLY</span><span class="p">)</span>
    472486        <span class="n">centText</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    473         <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">centText</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>       
    474         <span class="n">calibSizer</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">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; Wavelength&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    475             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
    476         <span class="n">waveSel</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="p">(</span><span class="s">&quot;</span><span class="si">%6.5f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;wavelength&#39;</span><span class="p">])),</span>
     487        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">centText</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>       
     488        <span class="n">calibSizer</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">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; Wavelength&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     489        <span class="n">waveSel</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="p">(</span><span class="s">&quot;</span><span class="si">%7.5f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;wavelength&#39;</span><span class="p">])),</span>
    477490            <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>
    478491        <span class="n">waveSel</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">OnWavelength</span><span class="p">)</span>
    479492        <span class="n">waveSel</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">OnWavelength</span><span class="p">)</span>
    480         <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">waveSel</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>             
    481         <span class="n">calibSizer</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">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; Distance&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    482             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
    483         <span class="n">distSel</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="p">(</span><span class="s">&quot;</span><span class="si">%8.3f</span><span class="s">&quot;</span><span class="o">%</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;distance&#39;</span><span class="p">])),</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_READONLY</span><span class="p">)</span>
     493        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">waveSel</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>             
     494        <span class="n">calibSizer</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">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; Distance&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     495        <span class="n">distSel</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="p">(</span><span class="s">&quot;</span><span class="si">%8.2f</span><span class="s">&quot;</span><span class="o">%</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;distance&#39;</span><span class="p">])),</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_READONLY</span><span class="p">)</span>
    484496        <span class="n">distSel</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    485         <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">distSel</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>
    486         <span class="n">calibSizer</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">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; Tilt angle&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    487             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     497        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">distSel</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     498        <span class="n">calibSizer</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">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; Tilt angle&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    488499        <span class="n">tiltSel</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="p">(</span><span class="s">&quot;</span><span class="si">%9.3f</span><span class="s">&quot;</span><span class="o">%</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;tilt&#39;</span><span class="p">])),</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_READONLY</span><span class="p">)</span>
    489500        <span class="n">tiltSel</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    490         <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">tiltSel</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>
    491         <span class="n">calibSizer</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">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; Tilt rotation&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    492             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     501        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">tiltSel</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     502        <span class="n">calibSizer</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">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; Tilt rotation&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    493503        <span class="n">rotSel</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="p">(</span><span class="s">&quot;</span><span class="si">%9.3f</span><span class="s">&quot;</span><span class="o">%</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;rotation&#39;</span><span class="p">])),</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_READONLY</span><span class="p">)</span>
    494504        <span class="n">rotSel</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    495         <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">rotSel</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>
    496         <span class="n">penSel</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;Penetration?&#39;</span><span class="p">)</span>
    497         <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">penSel</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>
    498         <span class="n">penSel</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">OnDetDepthRef</span><span class="p">)</span>
    499         <span class="n">penSel</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;DetDepthRef&#39;</span><span class="p">])</span>
    500         <span class="n">penVal</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="p">(</span><span class="s">&quot;</span><span class="si">%6.5f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;DetDepth&#39;</span><span class="p">])),</span>
    501             <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>
    502         <span class="n">penVal</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">OnDetDepth</span><span class="p">)</span>
    503         <span class="n">penVal</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">OnDetDepth</span><span class="p">)</span>
    504         <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">penVal</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>             
     505        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">rotSel</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     506        <span class="k">if</span> <span class="s">&#39;PWDR&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     507            <span class="n">penSel</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;Penetration?&#39;</span><span class="p">)</span>
     508            <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">penSel</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     509            <span class="n">penSel</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">OnDetDepthRef</span><span class="p">)</span>
     510            <span class="n">penSel</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;DetDepthRef&#39;</span><span class="p">])</span>
     511            <span class="n">penVal</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="p">(</span><span class="s">&quot;</span><span class="si">%6.5f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;DetDepth&#39;</span><span class="p">])),</span>
     512                <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>
     513            <span class="n">penVal</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">OnDetDepth</span><span class="p">)</span>
     514            <span class="n">penVal</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">OnDetDepth</span><span class="p">)</span>
     515            <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">penVal</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>             
    505516       
    506517        <span class="k">return</span> <span class="n">calibSizer</span>
    507518   
    508519    <span class="k">def</span> <span class="nf">IntegrateSizer</span><span class="p">():</span>
     520       
     521        <span class="k">def</span> <span class="nf">OnNewBinType</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     522            <span class="n">data</span><span class="p">[</span><span class="s">&#39;binType&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">binSel</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
    509523       
    510524        <span class="k">def</span> <span class="nf">OnIOtth</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     
    533547            <span class="k">try</span><span class="p">:</span>
    534548                <span class="n">numChans</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">outChan</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
    535                 <span class="k">if</span> <span class="n">numChans</span> <span class="o">&lt;</span> <span class="mi">1</span><span class="p">:</span>
     549                <span class="k">if</span> <span class="n">numChans</span> <span class="o">&lt;</span> <span class="mi">10</span><span class="p">:</span>
    536550                    <span class="k">raise</span> <span class="ne">ValueError</span>
    537551                <span class="n">data</span><span class="p">[</span><span class="s">&#39;outChannels&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">numChans</span>
     
    577591            <span class="k">try</span><span class="p">:</span>
    578592                <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>
     593                <span class="n">minmax</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.</span><span class="p">,</span><span class="mf">2.</span><span class="p">]</span>
     594                <span class="k">if</span> <span class="s">&#39;SASD&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     595                    <span class="n">minmax</span> <span class="o">=</span> <span class="p">[</span><span class="o">.</span><span class="mo">05</span><span class="p">,</span><span class="mf">1.0</span><span class="p">]</span>
     596                <span class="k">if</span> <span class="n">minmax</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">&lt;=</span> <span class="n">value</span> <span class="o">&lt;=</span> <span class="n">minmax</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span>
    580597                    <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>
    581598                <span class="k">else</span><span class="p">:</span>
     
    637654                           
    638655        <span class="n">dataSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">3</span><span class="p">)</span>
    639         <span class="n">dataSizer</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">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; Integration coefficients&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    640             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>   
     656        <span class="n">dataSizer</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">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; Integration coefficients&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>   
    641657        <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    642         <span class="n">dataSizer</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">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; Inner/Outer 2-theta&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    643             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
    644            
     658        <span class="k">if</span> <span class="s">&#39;PWDR&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     659            <span class="n">binChoice</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;2-theta&#39;</span><span class="p">,</span><span class="s">&#39;q&#39;</span><span class="p">]</span>
     660        <span class="k">elif</span> <span class="s">&#39;SASD&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     661            <span class="n">binChoice</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;q&#39;</span><span class="p">,</span><span class="s">&#39;log(q)&#39;</span><span class="p">]</span>
     662        <span class="n">dataSizer</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">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; Bin style: Constant step bins in&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>           
     663        <span class="n">binSel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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="n">data</span><span class="p">[</span><span class="s">&#39;binType&#39;</span><span class="p">],</span><span class="n">choices</span><span class="o">=</span><span class="n">binChoice</span><span class="p">,</span>
     664            <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_DROPDOWN</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_SORT</span><span class="p">)</span>
     665        <span class="n">binSel</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_COMBOBOX</span><span class="p">,</span> <span class="n">OnNewBinType</span><span class="p">)</span>
     666        <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">binSel</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     667        <span class="n">dataSizer</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">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; Inner/Outer 2-theta&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>           
    645668        <span class="n">IOtth</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;IOtth&#39;</span><span class="p">]</span>
    646669        <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>
     
    649672        <span class="n">G2frame</span><span class="o">.</span><span class="n">InnerTth</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">OnIOtth</span><span class="p">)</span>
    650673        <span class="n">G2frame</span><span class="o">.</span><span class="n">InnerTth</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">OnIOtth</span><span class="p">)</span>
    651         <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">InnerTth</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>
     674        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">InnerTth</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    652675        <span class="n">G2frame</span><span class="o">.</span><span class="n">OuterTth</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>
    653676            <span class="n">value</span><span class="o">=</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%8.2f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">IOtth</span><span class="p">[</span><span class="mi">1</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>
    654677        <span class="n">G2frame</span><span class="o">.</span><span class="n">OuterTth</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">OnIOtth</span><span class="p">)</span>
    655678        <span class="n">G2frame</span><span class="o">.</span><span class="n">OuterTth</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">OnIOtth</span><span class="p">)</span>
    656         <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">OuterTth</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>
     679        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">OuterTth</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    657680        <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>
    658         <span class="n">dataSizer</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">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; Start/End azimuth&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    659             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     681        <span class="n">dataSizer</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">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; Start/End azimuth&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    660682        <span class="n">LRazim</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>
    661683        <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>
     
    664686        <span class="n">G2frame</span><span class="o">.</span><span class="n">Lazim</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">OnLRazim</span><span class="p">)</span>
    665687        <span class="n">G2frame</span><span class="o">.</span><span class="n">Lazim</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">OnLRazim</span><span class="p">)</span>
    666         <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">Lazim</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">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">Lazim</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    667689        <span class="n">G2frame</span><span class="o">.</span><span class="n">Razim</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>
    668690            <span class="n">value</span><span class="o">=</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">LRazim</span><span class="p">[</span><span class="mi">1</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>
     
    673695            <span class="n">G2frame</span><span class="o">.</span><span class="n">Razim</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    674696            <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">LRazim</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">+</span><span class="mi">360</span><span class="p">))</span>
    675         <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">Razim</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>
     697        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">Razim</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    676698        <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>
    677         <span class="n">dataSizer</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">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; No. 2-theta/azimuth bins&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    678             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     699        <span class="n">dataSizer</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">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; No. 2-theta/azimuth bins&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    679700        <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>
    680701        <span class="n">outChan</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="nb">str</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;outChannels&#39;</span><span class="p">]),</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_PROCESS_ENTER</span><span class="p">)</span>
    681702        <span class="n">outChan</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">OnNumOutChans</span><span class="p">)</span>
    682703        <span class="n">outChan</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">OnNumOutChans</span><span class="p">)</span>
    683         <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">outChan</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>
     704        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">outChan</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    684705        <span class="n">outAzim</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="nb">str</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;outAzimuths&#39;</span><span class="p">]),</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_PROCESS_ENTER</span><span class="p">)</span>
    685706        <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_TEXT_ENTER</span><span class="p">,</span><span class="n">OnNumOutAzms</span><span class="p">)</span>
    686707        <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>
    687         <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>
     708        <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">WACV</span><span class="p">)</span>
    688709        <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>
    689710        <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>
    690711        <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>
     712        <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">WACV</span><span class="p">)</span>
    692713        <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>
    693714        <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>
     715        <span class="k">if</span> <span class="s">&#39;PWDR&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     716            <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><span class="n">WACV</span><span class="p">)</span>
     717        <span class="k">elif</span> <span class="s">&#39;SASD&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     718            <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;transmission &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     719        <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>           
    697720        <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>
    698721        <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>
     722        <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">WACV</span><span class="p">)</span>
    700723        <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>
    701         <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>
    702         <span class="n">oblique</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 detector absorption?&#39;</span><span class="p">)</span>
    703         <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">oblique</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>
    704         <span class="n">oblique</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">OnOblique</span><span class="p">)</span>
    705         <span class="n">oblique</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;Oblique&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">])</span>
    706         <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;Value (0.01-0.99)  &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    707             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
    708         <span class="n">obliqVal</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;Oblique&#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>
    709         <span class="n">obliqVal</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">OnObliqVal</span><span class="p">)</span>
    710         <span class="n">obliqVal</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">OnObliqVal</span><span class="p">)</span>
    711         <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">obliqVal</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>
    712         <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>
     724        <span class="k">if</span> <span class="s">&#39;PWDR&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
     725            <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>
     726            <span class="n">oblique</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 detector absorption?&#39;</span><span class="p">)</span>
     727            <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">oblique</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     728            <span class="n">oblique</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">OnOblique</span><span class="p">)</span>
     729            <span class="n">oblique</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;Oblique&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">])</span>
     730            <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;Value (0.01-0.99)  &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     731            <span class="n">obliqVal</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;Oblique&#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>
     732            <span class="n">obliqVal</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">OnObliqVal</span><span class="p">)</span>
     733            <span class="n">obliqVal</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">OnObliqVal</span><span class="p">)</span>
     734            <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">obliqVal</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     735            <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>
    713736        <span class="k">if</span> <span class="s">&#39;SASD&#39;</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;type&#39;</span><span class="p">]:</span>
    714737            <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>
    715738            <span class="n">setPolariz</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 polarization?&#39;</span><span class="p">)</span>
    716             <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">setPolariz</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>
     739            <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">setPolariz</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    717740            <span class="n">setPolariz</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">OnApplyPola</span><span class="p">)</span>
    718741            <span class="n">setPolariz</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;PolaVal&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">])</span>
    719             <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;Value (0.001-0.999)  &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    720                 <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     742            <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;Value (0.001-0.999)  &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    721743            <span class="n">polaVal</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;PolaVal&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]),</span>
    722744                <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>
    723745            <span class="n">polaVal</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">OnPolaVal</span><span class="p">)</span>
    724746            <span class="n">polaVal</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">OnPolaVal</span><span class="p">)</span>
    725             <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">polaVal</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>
     747            <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">polaVal</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    726748            <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>
    727749       
    728750        <span class="n">showLines</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;Show integration limits?&#39;</span><span class="p">)</span>
    729         <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">showLines</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>
     751        <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">showLines</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    730752        <span class="n">showLines</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">OnShowLines</span><span class="p">)</span>
    731753        <span class="n">showLines</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;showLines&#39;</span><span class="p">])</span>
    732754        <span class="n">fullIntegrate</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;Do full integration?&#39;</span><span class="p">)</span>
    733         <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">fullIntegrate</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>
     755        <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">fullIntegrate</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    734756        <span class="n">fullIntegrate</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">OnFullIntegrate</span><span class="p">)</span>
    735757        <span class="n">fullIntegrate</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;fullIntegrate&#39;</span><span class="p">])</span>
    736758        <span class="n">setDefault</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;Use as default for all images?&#39;</span><span class="p">)</span>
    737         <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">setDefault</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>
     759        <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">setDefault</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    738760        <span class="n">setDefault</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">OnSetDefault</span><span class="p">)</span>
    739761        <span class="n">setDefault</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;setDefault&#39;</span><span class="p">])</span>
    740762        <span class="n">centerAzm</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;Azimuth at bin center?&#39;</span><span class="p">)</span>
    741         <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">centerAzm</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>
     763        <span class="n">dataSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">centerAzm</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    742764        <span class="n">centerAzm</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">OnCenterAzm</span><span class="p">)</span>
    743765        <span class="n">centerAzm</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;centerAzm&#39;</span><span class="p">])</span>
     
    749771            <span class="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">backImage</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
    750772           
     773        <span class="k">def</span> <span class="nf">OnDarkImage</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     774            <span class="n">data</span><span class="p">[</span><span class="s">&#39;dark image&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">darkImage</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
     775
    751776        <span class="k">def</span> <span class="nf">OnBackMult</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
    752777            <span class="k">try</span><span class="p">:</span>
     
    757782            <span class="n">backMult</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]))</span>          <span class="c">#reset in case of error </span>
    758783       
     784        <span class="k">def</span> <span class="nf">OnDarkMult</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     785            <span class="k">try</span><span class="p">:</span>
     786                <span class="n">mult</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">darkMult</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
     787                <span class="n">data</span><span class="p">[</span><span class="s">&#39;dark image&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">mult</span>
     788            <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
     789                <span class="k">pass</span>
     790            <span class="n">darkMult</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;dark image&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]))</span>          <span class="c">#reset in case of error </span>
     791       
    759792        <span class="n">backSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    760         <span class="n">backSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39; Background image&#39;</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>
     793
     794        <span class="n">backSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39; Dark image&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     795        <span class="n">Choices</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;&#39;</span><span class="p">,]</span><span class="o">+</span><span class="n">G2gd</span><span class="o">.</span><span class="n">GetPatternTreeDataNames</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,[</span><span class="s">&#39;IMG &#39;</span><span class="p">,])</span>
     796        <span class="n">darkImage</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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="n">data</span><span class="p">[</span><span class="s">&#39;dark image&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">],</span><span class="n">choices</span><span class="o">=</span><span class="n">Choices</span><span class="p">,</span>
     797            <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_DROPDOWN</span><span class="p">)</span>
     798        <span class="n">darkImage</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_COMBOBOX</span><span class="p">,</span><span class="n">OnDarkImage</span><span class="p">)</span>
     799        <span class="n">backSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">darkImage</span><span class="p">)</span>
     800        <span class="n">backSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39; multiplier&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     801        <span class="n">darkMult</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="p">(</span><span class="s">&quot;</span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;dark image&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">])),</span>
     802            <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>
     803        <span class="n">darkMult</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">OnDarkMult</span><span class="p">)</span>
     804        <span class="n">darkMult</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">OnDarkMult</span><span class="p">)</span>
     805        <span class="n">backSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">darkMult</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     806
     807        <span class="n">backSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39; Background image&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    761808        <span class="n">Choices</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;&#39;</span><span class="p">,]</span><span class="o">+</span><span class="n">G2gd</span><span class="o">.</span><span class="n">GetPatternTreeDataNames</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,[</span><span class="s">&#39;IMG &#39;</span><span class="p">,])</span>
    762809        <span class="n">backImage</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">][</span><span class="mi">0</span><span class="p">],</span><span class="n">choices</span><span class="o">=</span><span class="n">Choices</span><span class="p">,</span>
     
    764811        <span class="n">backImage</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_COMBOBOX</span><span class="p">,</span><span class="n">OnBackImage</span><span class="p">)</span>
    765812        <span class="n">backSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">backImage</span><span class="p">)</span>
    766         <span class="n">backSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39; multiplier&#39;</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>
     813        <span class="n">backSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39; multiplier&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    767814        <span class="n">backMult</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="p">(</span><span class="s">&quot;</span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">])),</span>
    768815            <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>
    769816        <span class="n">backMult</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">OnBackMult</span><span class="p">)</span>
    770817        <span class="n">backMult</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">OnBackMult</span><span class="p">)</span>
    771         <span class="n">backSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">backMult</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>
     818        <span class="n">backSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">backMult</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    772819        <span class="k">return</span> <span class="n">backSizer</span>
    773820                       
     
    776823        <span class="k">def</span> <span class="nf">OnNewCalibrant</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
    777824            <span class="n">data</span><span class="p">[</span><span class="s">&#39;calibrant&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">calSel</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
    778             <span class="n">data</span><span class="p">[</span><span class="s">&#39;calibskip&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">calFile</span><span class="o">.</span><span class="n">Calibrants</span><span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;calibrant&#39;</span><span class="p">]][</span><span class="mi">2</span><span class="p">]</span>
    779             <span class="n">limits</span> <span class="o">=</span> <span class="n">calFile</span><span class="o">.</span><span class="n">Calibrants</span><span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;calibrant&#39;</span><span class="p">]][</span><span class="mi">3</span><span class="p">]</span>
     825            <span class="n">data</span><span class="p">[</span><span class="s">&#39;calibskip&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">calFile</span><span class="o">.</span><span class="n">Calibrants</span><span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;calibrant&#39;</span><span class="p">]][</span><span class="mi">3</span><span class="p">]</span>
     826            <span class="n">limits</span> <span class="o">=</span> <span class="n">calFile</span><span class="o">.</span><span class="n">Calibrants</span><span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;calibrant&#39;</span><span class="p">]][</span><span class="mi">4</span><span class="p">]</span>
    780827            <span class="n">data</span><span class="p">[</span><span class="s">&#39;calibdmin&#39;</span><span class="p">],</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;pixLimit&#39;</span><span class="p">],</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;cutoff&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">limits</span>
    781828            <span class="n">pixLimit</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">limits</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
     
    819866        <span class="n">calibSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    820867        <span class="n">comboSizer</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>   
    821         <span class="n">comboSizer</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">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; Calibrant &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    822             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     868        <span class="n">comboSizer</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">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; Calibrant &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    823869        <span class="n">calSel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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="n">data</span><span class="p">[</span><span class="s">&#39;calibrant&#39;</span><span class="p">],</span><span class="n">choices</span><span class="o">=</span><span class="n">calList</span><span class="p">,</span>
    824870            <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_DROPDOWN</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_SORT</span><span class="p">)</span>
    825871        <span class="n">calSel</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_COMBOBOX</span><span class="p">,</span> <span class="n">OnNewCalibrant</span><span class="p">)</span>
    826         <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">calSel</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>
     872        <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">calSel</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    827873        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">comboSizer</span><span class="p">,</span><span class="mi">0</span><span class="p">)</span>
    828874       
    829875        <span class="n">comboSizer</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>   
    830         <span class="n">comboSizer</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">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; Calib lines to skip   &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    831             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     876        <span class="n">comboSizer</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">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; Calib lines to skip   &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    832877        <span class="n">calibSkip</span>  <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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="nb">str</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;calibskip&#39;</span><span class="p">]),</span><span class="n">choices</span><span class="o">=</span><span class="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">25</span><span class="p">)],</span>
    833878            <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_DROPDOWN</span><span class="p">)</span>
    834879        <span class="n">calibSkip</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_COMBOBOX</span><span class="p">,</span> <span class="n">OnCalibSkip</span><span class="p">)</span>
    835         <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">calibSkip</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>
     880        <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">calibSkip</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    836881        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">comboSizer</span><span class="p">,</span><span class="mi">0</span><span class="p">)</span>
    837882       
    838883        <span class="n">comboSizer</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>       
    839         <span class="n">comboSizer</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">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; Min calib d-spacing &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    840             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     884        <span class="n">comboSizer</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">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; Min calib d-spacing &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    841885        <span class="n">calibDmin</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="p">(</span><span class="s">&quot;</span><span class="si">%.2f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;calibdmin&#39;</span><span class="p">])),</span>
    842886            <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>
    843887        <span class="n">calibDmin</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">OnCalibDmin</span><span class="p">)</span>
    844888        <span class="n">calibDmin</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">OnCalibDmin</span><span class="p">)</span>
    845         <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">calibDmin</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>
     889        <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">calibDmin</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    846890        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">comboSizer</span><span class="p">,</span><span class="mi">0</span><span class="p">)</span>
    847891       
    848892        <span class="n">comboSizer</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>
    849         <span class="n">comboSizer</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">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; Min ring I/Ib &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    850             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     893        <span class="n">comboSizer</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">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; Min ring I/Ib &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    851894        <span class="n">cutOff</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="p">(</span><span class="s">&quot;</span><span class="si">%.1f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;cutoff&#39;</span><span class="p">])),</span>
    852895            <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>
    853896        <span class="n">cutOff</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">OnCutOff</span><span class="p">)</span>
    854897        <span class="n">cutOff</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">OnCutOff</span><span class="p">)</span>
    855         <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">cutOff</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>
     898        <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">cutOff</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    856899        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">comboSizer</span><span class="p">,</span><span class="mi">0</span><span class="p">)</span>
    857900       
    858901        <span class="n">comboSizer</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>
    859         <span class="n">comboSizer</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">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; Pixel search range &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    860             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     902        <span class="n">comboSizer</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">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; Pixel search range &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    861903        <span class="n">pixLimit</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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="nb">str</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;pixLimit&#39;</span><span class="p">]),</span><span class="n">choices</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;1&#39;</span><span class="p">,</span><span class="s">&#39;2&#39;</span><span class="p">,</span><span class="s">&#39;5&#39;</span><span class="p">,</span><span class="s">&#39;10&#39;</span><span class="p">,</span><span class="s">&#39;15&#39;</span><span class="p">,</span><span class="s">&#39;20&#39;</span><span class="p">],</span>
    862904            <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_DROPDOWN</span><span class="p">)</span>
    863905        <span class="n">pixLimit</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_COMBOBOX</span><span class="p">,</span> <span class="n">OnPixLimit</span><span class="p">)</span>
    864         <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">pixLimit</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>
     906        <span class="n">comboSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">pixLimit</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    865907        <span class="n">calibSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">comboSizer</span><span class="p">,</span><span class="mi">0</span><span class="p">)</span>
    866908       
     
    889931        <span class="n">gonioSizer</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>
    890932        <span class="n">names</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;Omega&#39;</span><span class="p">,</span><span class="s">&#39;Chi&#39;</span><span class="p">,</span><span class="s">&#39;Phi&#39;</span><span class="p">]</span>
    891         <span class="n">gonioSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39;Sample goniometer angles: &#39;</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>
     933        <span class="n">gonioSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&#39;Sample goniometer angles: &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    892934        <span class="k">for</span> <span class="n">i</span><span class="p">,</span><span class="n">name</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">names</span><span class="p">):</span>
    893             <span class="n">gonioSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">name</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>
     935            <span class="n">gonioSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">name</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    894936            <span class="n">angle</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">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">value</span><span class="o">=</span><span class="s">&#39;</span><span class="si">%8.2f</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;GonioAngles&#39;</span><span class="p">][</span><span class="n">i</span><span class="p">]),</span>
    895937                <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>
     
    897939            <span class="n">angle</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">OnGonioAngle</span><span class="p">)</span>
    898940            <span class="n">ValObj</span><span class="p">[</span><span class="n">angle</span><span class="o">.</span><span class="n">GetId</span><span class="p">()]</span> <span class="o">=</span> <span class="n">i</span>
    899             <span class="n">gonioSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">angle</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>
     941            <span class="n">gonioSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">angle</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    900942        <span class="k">return</span> <span class="n">gonioSizer</span>
    901943       
     
    906948        <span class="n">data</span><span class="p">[</span><span class="s">&#39;azmthOff&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0.0</span>
    907949    <span class="k">if</span> <span class="s">&#39;background image&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">data</span><span class="p">:</span>
    908         <span class="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;&#39;</span><span class="p">,</span><span class="mf">1.0</span><span class="p">]</span>
     950        <span class="n">data</span><span class="p">[</span><span class="s">&#39;background image&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;&#39;</span><span class="p">,</span><span class="o">-</span><span class="mf">1.0</span><span class="p">]</span>
     951    <span class="k">if</span> <span class="s">&#39;dark image&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">data</span><span class="p">:</span>
     952        <span class="n">data</span><span class="p">[</span><span class="s">&#39;dark image&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;&#39;</span><span class="p">,</span><span class="o">-</span><span class="mf">1.0</span><span class="p">]</span>
    909953    <span class="k">if</span> <span class="s">&#39;centerAzm&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">data</span><span class="p">:</span>
    910954        <span class="n">data</span><span class="p">[</span><span class="s">&#39;centerAzm&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">False</span>
     
    952996    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>           
    953997    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">BackSizer</span><span class="p">(),</span><span class="mi">0</span><span class="p">)</span>
    954     <span class="n">mainSizer</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">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; Calibration controls:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    955         <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     998    <span class="n">mainSizer</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">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; Calibration controls:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    956999    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    957     <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">CalibSizer</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>
     1000    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">CalibSizer</span><span class="p">(),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    9581001    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    959     <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">GonioSizer</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>   
     1002    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">GonioSizer</span><span class="p">(),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>   
    9601003       
    9611004    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>   
     
    11961239   
    11971240    <span class="n">littleSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    1198     <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">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; Lower/Upper limits &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1199         <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1241    <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">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; Lower/Upper limits &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12001242    <span class="n">Text</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">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="p">(</span><span class="s">&quot;</span><span class="si">%8d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">thresh</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="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_READONLY</span><span class="p">)</span>
    1201     <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">Text</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>
     1243    <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">Text</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12021244    <span class="n">Text</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    12031245    <span class="n">Text</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">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="p">(</span><span class="s">&quot;</span><span class="si">%8d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">thresh</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">1</span><span class="p">])),</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_READONLY</span><span class="p">)</span>
    1204     <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">Text</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>
     1246    <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">Text</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12051247    <span class="n">Text</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    1206     <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">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; Lower/Upper thresholds &#39;</span><span class="p">),</span>
    1207         <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>
     1248    <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">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; Lower/Upper thresholds &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12081249    <span class="n">lowerThreshold</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>
    12091250        <span class="n">value</span><span class="o">=</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%8d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">thresh</span><span class="p">[</span><span class="mi">1</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>
    12101251    <span class="n">lowerThreshold</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">OnThreshold</span><span class="p">)</span>
    12111252    <span class="n">lowerThreshold</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">OnThreshold</span><span class="p">)</span>
    1212     <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">lowerThreshold</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>
     1253    <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">lowerThreshold</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12131254    <span class="n">upperThreshold</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>
    12141255        <span class="n">value</span><span class="o">=</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%8d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">thresh</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="mi">1</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>
    12151256    <span class="n">upperThreshold</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">OnThreshold</span><span class="p">)</span>
    12161257    <span class="n">upperThreshold</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">OnThreshold</span><span class="p">)</span>
    1217     <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">upperThreshold</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>
     1258    <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">upperThreshold</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12181259    <span class="n">mainSizer</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>
    12191260    <span class="n">spotIds</span> <span class="o">=</span> <span class="p">[]</span>
     
    12211262    <span class="k">if</span> <span class="n">spots</span><span class="p">:</span>
    12221263        <span class="n">littleSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">spots</span><span class="p">)</span><span class="o">+</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    1223         <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">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; Spot masks:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1224             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1264        <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">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; Spot masks:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12251265        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    12261266        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    1227         <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">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; position, mm&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1228             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
    1229         <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">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; diameter, mm&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1230             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1267        <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">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; position, mm&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     1268        <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">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; diameter, mm&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12311269        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    12321270        <span class="k">for</span> <span class="n">spot</span> <span class="ow">in</span> <span class="n">spots</span><span class="p">:</span>
     
    12361274                    <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_READONLY</span><span class="p">)</span>
    12371275                <span class="n">spotText</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    1238                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">spotText</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>
     1276                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">spotText</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12391277                <span class="n">spotText</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_ENTER_WINDOW</span><span class="p">,</span><span class="n">OnTextMsg</span><span class="p">)</span>
    12401278                <span class="n">spotDiameter</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="p">(</span><span class="s">&quot;</span><span class="si">%.2f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">d</span><span class="p">)),</span>
    12411279                    <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>
    1242                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">spotDiameter</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>
     1280                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">spotDiameter</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12431281                <span class="n">spotDiameter</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">OnSpotDiameter</span><span class="p">)</span>
    12441282                <span class="n">spotDiameter</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">OnSpotDiameter</span><span class="p">)</span>
     
    12471285                <span class="n">spotDelete</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">OnDeleteSpot</span><span class="p">)</span>
    12481286                <span class="n">delSpotId</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">spotDelete</span><span class="p">)</span>
    1249                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">spotDelete</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>
     1287                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">spotDelete</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12501288        <span class="n">mainSizer</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>
    12511289    <span class="n">ringIds</span> <span class="o">=</span> <span class="p">[]</span>
     
    12531291    <span class="k">if</span> <span class="n">rings</span><span class="p">:</span>
    12541292        <span class="n">littleSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">rings</span><span class="p">)</span><span class="o">+</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    1255         <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">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; Ring masks:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1256             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1293        <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">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; Ring masks:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12571294        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    12581295        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    1259         <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">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; 2-theta,deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1260             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
    1261         <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">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; thickness, deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1262             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1296        <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">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; 2-theta,deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     1297        <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">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; thickness, deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12631298        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    12641299        <span class="k">for</span> <span class="n">ring</span> <span class="ow">in</span> <span class="n">rings</span><span class="p">:</span>
     
    12691304                <span class="n">ringText</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    12701305                <span class="n">ringText</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_ENTER_WINDOW</span><span class="p">,</span><span class="n">OnTextMsg</span><span class="p">)</span>
    1271                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ringText</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>
     1306                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ringText</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12721307                <span class="n">ringThick</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="p">(</span><span class="s">&quot;</span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">thick</span><span class="p">)),</span>
    12731308                    <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>
    1274                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ringThick</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>
     1309                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ringThick</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12751310                <span class="n">ringThick</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">OnRingThickness</span><span class="p">)</span>
    12761311                <span class="n">ringThick</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">OnRingThickness</span><span class="p">)</span>
     
    12791314                <span class="n">ringDelete</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">OnDeleteRing</span><span class="p">)</span>
    12801315                <span class="n">delRingId</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ringDelete</span><span class="p">)</span>
    1281                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ringDelete</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>
     1316                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ringDelete</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12821317        <span class="n">mainSizer</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>
    12831318    <span class="n">arcIds</span> <span class="o">=</span> <span class="p">[]</span>
     
    12851320    <span class="k">if</span> <span class="n">arcs</span><span class="p">:</span>
    12861321        <span class="n">littleSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">rings</span><span class="p">)</span><span class="o">+</span><span class="mi">2</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    1287         <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">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; Arc masks:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1288             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1322        <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">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; Arc masks:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12891323        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    12901324        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    12911325        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    1292         <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">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; 2-theta,deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1293             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
    1294         <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">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; azimuth, deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1295             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
    1296         <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">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; thickness, deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1297             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1326        <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">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; 2-theta,deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     1327        <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">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; azimuth, deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     1328        <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">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; thickness, deg&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    12981329        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    12991330        <span class="k">for</span> <span class="n">arc</span> <span class="ow">in</span> <span class="n">arcs</span><span class="p">:</span>
     
    13041335                <span class="n">arcText</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    13051336                <span class="n">arcText</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_ENTER_WINDOW</span><span class="p">,</span><span class="n">OnTextMsg</span><span class="p">)</span>
    1306                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">arcText</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>
     1337                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">arcText</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13071338                <span class="n">azmText</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="p">(</span><span class="s">&quot;</span><span class="si">%d</span><span class="s">,</span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">azimuth</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">azimuth</span><span class="p">[</span><span class="mi">1</span><span class="p">])),</span>
    13081339                    <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_READONLY</span><span class="p">)</span>
    13091340                <span class="n">azmText</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    13101341                <span class="n">azmText</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_ENTER_WINDOW</span><span class="p">,</span><span class="n">OnTextMsg</span><span class="p">)</span>
    1311                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">azmText</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>
     1342                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">azmText</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13121343                <span class="n">arcThick</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="p">(</span><span class="s">&quot;</span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">thick</span><span class="p">)),</span>
    13131344                    <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>
    1314                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">arcThick</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>
     1345                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">arcThick</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13151346                <span class="n">arcThick</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">OnArcThickness</span><span class="p">)</span>
    13161347                <span class="n">arcThick</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">OnArcThickness</span><span class="p">)</span>
     
    13191350                <span class="n">arcDelete</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">OnDeleteArc</span><span class="p">)</span>
    13201351                <span class="n">delArcId</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">arcDelete</span><span class="p">)</span>
    1321                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">arcDelete</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>
     1352                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">arcDelete</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13221353        <span class="n">mainSizer</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>
    13231354    <span class="n">polyIds</span> <span class="o">=</span> <span class="p">[]</span>
     
    13261357    <span class="k">if</span> <span class="n">polygons</span><span class="p">:</span>
    13271358        <span class="n">littleSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">polygons</span><span class="p">)</span><span class="o">+</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    1328         <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">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; Polygon masks:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1329             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1359        <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">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; Polygon masks:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13301360        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    13311361        <span class="k">for</span> <span class="n">polygon</span> <span class="ow">in</span> <span class="n">polygons</span><span class="p">:</span>
     
    13351365                    <span class="n">polyList</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%.2f</span><span class="s">, </span><span class="si">%.2f</span><span class="s">&quot;</span><span class="o">%</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="p">))</span>
    13361366                <span class="n">polyText</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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">value</span><span class="o">=</span><span class="n">polyList</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">choices</span><span class="o">=</span><span class="n">polyList</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">CB_READONLY</span><span class="p">)</span>
    1337                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">polyText</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>
     1367                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">polyText</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13381368                <span class="n">polyDelete</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;delete?&#39;</span><span class="p">)</span>
    13391369                <span class="n">polyDelete</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">OnDeletePoly</span><span class="p">)</span>
    13401370                <span class="n">delPolyId</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">polyDelete</span><span class="p">)</span>
    1341                 <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">polyDelete</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>
     1371                <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">polyDelete</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13421372        <span class="n">mainSizer</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>
    13431373    <span class="k">if</span> <span class="n">frame</span><span class="p">:</span>
    13441374        <span class="n">littleSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    13451375        <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">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; Frame mask:&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1346             <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1376            <span class="n">WACV</span><span class="p">)</span>
    13471377        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">0</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    13481378        <span class="n">frameList</span> <span class="o">=</span> <span class="p">[]</span>
     
    13501380            <span class="n">frameList</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%.2f</span><span class="s">, </span><span class="si">%.2f</span><span class="s">&quot;</span><span class="o">%</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="p">))</span>
    13511381        <span class="n">frameText</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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">value</span><span class="o">=</span><span class="n">frameList</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">choices</span><span class="o">=</span><span class="n">frameList</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">CB_READONLY</span><span class="p">)</span>
    1352         <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">frameText</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>
     1382        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">frameText</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13531383        <span class="n">frameDelete</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;delete?&#39;</span><span class="p">)</span>
    13541384        <span class="n">frameDelete</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">OnDeleteFrame</span><span class="p">)</span>
    13551385        <span class="n">delFrameId</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">frameDelete</span><span class="p">)</span>
    1356         <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">frameDelete</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>
     1386        <span class="n">littleSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">frameDelete</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13571387        <span class="n">mainSizer</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>
     1388    <span class="k">if</span> <span class="p">(</span><span class="n">frame</span> <span class="ow">or</span> <span class="n">polygons</span><span class="p">):</span>
     1389        <span class="n">mainSizer</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>
     1390            <span class="n">label</span><span class="o">=</span><span class="s">&#39; For frame and polygons: on plot RB vertex drag to move, LB vertex drag to insert&#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    13581391    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>   
    13591392    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">mainSizer</span><span class="p">)</span>
     
    13731406   
    13741407    <span class="k">def</span> <span class="nf">OnAppendDzero</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
    1375         <span class="n">data</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&#39;Dset&#39;</span><span class="p">:</span><span class="mf">1.0</span><span class="p">,</span><span class="s">&#39;Dcalc&#39;</span><span class="p">:</span><span class="mf">0.0</span><span class="p">,</span><span class="s">&#39;pixLimit&#39;</span><span class="p">:</span><span class="mi">10</span><span class="p">,</span><span class="s">&#39;cutoff&#39;</span><span class="p">:</span><span class="mf">10.0</span><span class="p">,</span><span class="s">&#39;ImxyObs&#39;</span><span class="p">:[[],[]],</span><span class="s">&#39;ImxyCalc&#39;</span><span class="p">:[[],[]]})</span>
     1408        <span class="n">data</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&#39;Dset&#39;</span><span class="p">:</span><span class="mf">1.0</span><span class="p">,</span><span class="s">&#39;Dcalc&#39;</span><span class="p">:</span><span class="mf">0.0</span><span class="p">,</span><span class="s">&#39;pixLimit&#39;</span><span class="p">:</span><span class="mi">10</span><span class="p">,</span><span class="s">&#39;cutoff&#39;</span><span class="p">:</span><span class="mf">1.0</span><span class="p">,</span>
     1409            <span class="s">&#39;ImxyObs&#39;</span><span class="p">:[[],[]],</span><span class="s">&#39;ImtaObs&#39;</span><span class="p">:[[],[]],</span><span class="s">&#39;ImtaCalc&#39;</span><span class="p">:[[],[]],</span><span class="s">&#39;Emat&#39;</span><span class="p">:[</span><span class="mf">1.0</span><span class="p">,</span><span class="mf">1.0</span><span class="p">,</span><span class="mf">1.0</span><span class="p">]})</span>
     1410        <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>
     1411       
     1412    <span class="k">def</span> <span class="nf">OnUpdateDzero</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     1413        <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">]:</span>
     1414            <span class="k">if</span> <span class="n">item</span><span class="p">[</span><span class="s">&#39;Dcalc&#39;</span><span class="p">]:</span>   <span class="c">#skip unrefined ones</span>
     1415                <span class="n">item</span><span class="p">[</span><span class="s">&#39;Dset&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">item</span><span class="p">[</span><span class="s">&#39;Dcalc&#39;</span><span class="p">]</span>
    13761416        <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>
    13771417           
     
    14051445                        <span class="n">ifcopy</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="nb">id</span> <span class="o">=</span> <span class="n">item</span>
    14061446                        <span class="k">if</span> <span class="n">ifcopy</span><span class="p">:</span>
    1407                             <span class="n">oldData</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span><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="nb">id</span><span class="p">,</span> <span class="s">&#39;Stress/Strain&#39;</span><span class="p">)))</span>
    14081447                            <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">SetItemPyData</span><span class="p">(</span><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="nb">id</span><span class="p">,</span> <span class="s">&#39;Stress/Strain&#39;</span><span class="p">),</span><span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">Data</span><span class="p">))</span>
    14091448            <span class="k">finally</span><span class="p">:</span>
     
    14221461                <span class="n">File</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span><span class="s">&#39;w&#39;</span><span class="p">)</span>
    14231462                <span class="n">save</span> <span class="o">=</span> <span class="p">{}</span>
    1424                 <span class="n">keys</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;Type&#39;</span><span class="p">,</span><span class="s">&#39;Sample phi&#39;</span><span class="p">,</span><span class="s">&#39;Sample z&#39;</span><span class="p">,</span><span class="s">&#39;strain&#39;</span><span class="p">]</span>
    1425                 <span class="n">keys2</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;Dset&#39;</span><span class="p">,</span><span class="s">&#39;Dcalc&#39;</span><span class="p">,</span><span class="s">&#39;pixLimit&#39;</span><span class="p">,</span><span class="s">&#39;cutoff&#39;</span><span class="p">]</span>
     1463                <span class="n">keys</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;Type&#39;</span><span class="p">,</span><span class="s">&#39;Sample phi&#39;</span><span class="p">,</span><span class="s">&#39;Sample z&#39;</span><span class="p">]</span>
     1464                <span class="n">keys2</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;Dset&#39;</span><span class="p">,</span><span class="s">&#39;Dcalc&#39;</span><span class="p">,</span><span class="s">&#39;pixLimit&#39;</span><span class="p">,</span><span class="s">&#39;cutoff&#39;</span><span class="p">,</span><span class="s">&#39;Emat&#39;</span><span class="p">]</span>
    14261465                <span class="n">File</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&#39;{</span><span class="se">\n\t</span><span class="s">&#39;</span><span class="p">)</span>
    14271466                <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keys</span><span class="p">:</span>
     
    14351474                    <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">keys2</span><span class="p">:</span>
    14361475                        <span class="n">File</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;&#39;&quot;</span><span class="o">+</span><span class="n">key</span><span class="o">+</span><span class="s">&quot;&#39;:&quot;</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">data2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span><span class="o">+</span><span class="s">&#39;,&#39;</span><span class="p">)</span>
    1437                     <span class="n">File</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;&#39;ImxyObs&#39;:[[],[]],&#39;Imxycalc&#39;:[[],[]]},</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
     1476                    <span class="n">File</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;&#39;ImxyObs&#39;:[[],[]],&#39;ImtaObs&#39;:[[],[]],&#39;Imtacalc&#39;:[[],[]]},</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
    14381477                <span class="n">File</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&#39;</span><span class="se">\t</span><span class="s">]</span><span class="se">\n</span><span class="s">}&#39;</span><span class="p">)</span>
    14391478                <span class="n">File</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
     
    14421481
    14431482    <span class="k">def</span> <span class="nf">OnFitStrSta</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
    1444         <span class="n">Masks</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span>
    1445             <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;Masks&#39;</span><span class="p">))</span>
    14461483        <span class="n">Controls</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span>
    14471484            <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>
    1448         <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>
     1485        <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>
     1486        <span class="k">print</span> <span class="s">&#39;Strain fitting finished&#39;</span>
    14491487        <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>
    14501488        <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>
     1489        <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">True</span><span class="p">)</span>
     1490       
     1491    <span class="k">def</span> <span class="nf">OnAllFitStrSta</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     1492        <span class="n">TextList</span> <span class="o">=</span> <span class="p">[[</span><span class="bp">False</span><span class="p">,</span><span class="s">&#39;All IMG&#39;</span><span class="p">,</span><span class="mi">0</span><span class="p">]]</span>
     1493        <span class="n">Names</span> <span class="o">=</span> <span class="p">[]</span>
     1494        <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">GetCount</span><span class="p">():</span>
     1495            <span class="nb">id</span><span class="p">,</span> <span class="n">cookie</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetFirstChild</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">root</span><span class="p">)</span>
     1496            <span class="k">while</span> <span class="nb">id</span><span class="p">:</span>
     1497                <span class="n">name</span> <span class="o">=</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="nb">id</span><span class="p">)</span>
     1498                <span class="n">Names</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>
     1499                <span class="k">if</span> <span class="s">&#39;IMG&#39;</span> <span class="ow">in</span> <span class="n">name</span><span class="p">:</span>
     1500                    <span class="n">TextList</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="bp">False</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="nb">id</span><span class="p">])</span>
     1501                <span class="nb">id</span><span class="p">,</span> <span class="n">cookie</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetNextChild</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">root</span><span class="p">,</span> <span class="n">cookie</span><span class="p">)</span>
     1502            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">TextList</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
     1503                <span class="n">G2frame</span><span class="o">.</span><span class="n">ErrorDialog</span><span class="p">(</span><span class="s">&#39;Nothing to fit&#39;</span><span class="p">,</span><span class="s">&#39;There must some &quot;IMG&quot; patterns&#39;</span><span class="p">)</span>
     1504                <span class="k">return</span>
     1505            <span class="n">dlg</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">CopyDialog</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="s">&#39;Stress/Strain fitting&#39;</span><span class="p">,</span><span class="s">&#39;Select images to fit:&#39;</span><span class="p">,</span><span class="n">TextList</span><span class="p">)</span>
     1506            <span class="k">try</span><span class="p">:</span>
     1507                <span class="k">if</span> <span class="n">dlg</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">:</span>
     1508                    <span class="n">result</span> <span class="o">=</span> <span class="n">dlg</span><span class="o">.</span><span class="n">GetData</span><span class="p">()</span>
     1509                    <span class="k">if</span> <span class="n">result</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="c">#the &#39;All IMG&#39; is True</span>
     1510                        <span class="n">result</span> <span class="o">=</span> <span class="n">TextList</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
     1511                        <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">result</span><span class="p">:</span> <span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="bp">True</span>
     1512                    <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">result</span><span class="p">:</span>
     1513                        <span class="n">ifFit</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="nb">id</span> <span class="o">=</span> <span class="n">item</span>
     1514                        <span class="k">if</span> <span class="n">ifFit</span><span class="p">:</span>
     1515                            <span class="n">Controls</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span><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="nb">id</span><span class="p">,</span> <span class="s">&#39;Image Controls&#39;</span><span class="p">))</span>
     1516                            <span class="n">StaCtrls</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span><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="nb">id</span><span class="p">,</span> <span class="s">&#39;Stress/Strain&#39;</span><span class="p">))</span>
     1517                            <span class="nb">id</span> <span class="o">=</span> <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">root</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
     1518                            <span class="n">Npix</span><span class="p">,</span><span class="n">imagefile</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span>
     1519                            <span class="n">image</span> <span class="o">=</span> <span class="n">G2IO</span><span class="o">.</span><span class="n">GetImageData</span><span class="p">(</span><span class="n">G2frame</span><span class="p">,</span><span class="n">imagefile</span><span class="p">,</span><span class="bp">True</span><span class="p">)</span>
     1520                            <span class="n">G2img</span><span class="o">.</span><span class="n">FitStrSta</span><span class="p">(</span><span class="n">image</span><span class="p">,</span><span class="n">StaCtrls</span><span class="p">,</span><span class="n">Controls</span><span class="p">)</span>
     1521                            <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">StaCtrls</span><span class="p">,</span><span class="n">newPlot</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
     1522            <span class="k">finally</span><span class="p">:</span>
     1523                <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
     1524            <span class="k">print</span> <span class="s">&#39;All images fitted&#39;</span>
    14521525       
    14531526    <span class="k">def</span> <span class="nf">SamSizer</span><span class="p">():</span>
     
    14731546               
    14741547        <span class="n">samSizer</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>
    1475         <span class="n">samSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="s">&#39; Strain type: &#39;</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>
     1548        <span class="n">samSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="s">&#39; Strain type: &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    14761549        <span class="n">strType</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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">value</span><span class="o">=</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;Type&#39;</span><span class="p">],</span><span class="n">choices</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;True&#39;</span><span class="p">,</span><span class="s">&#39;Conventional&#39;</span><span class="p">],</span>
    14771550            <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_DROPDOWN</span><span class="p">)</span>
    14781551        <span class="n">strType</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;Type&#39;</span><span class="p">])</span>
    14791552        <span class="n">strType</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_COMBOBOX</span><span class="p">,</span> <span class="n">OnStrainType</span><span class="p">)</span>
    1480         <span class="n">samSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">strType</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>
    1481        
    1482         <span class="n">samSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="s">&#39; Sample phi: &#39;</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>
     1553        <span class="n">samSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">strType</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     1554       
     1555        <span class="n">samSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="s">&#39; Sample phi: &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    14831556        <span class="n">samPhi</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">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">value</span><span class="o">=</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;Sample phi&#39;</span><span class="p">])),</span>
    14841557            <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>
    1485         <span class="n">samSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">samPhi</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>
     1558        <span class="n">samSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">samPhi</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    14861559        <span class="n">samPhi</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">OnSamPhi</span><span class="p">)</span>
    14871560        <span class="n">samPhi</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">OnSamPhi</span><span class="p">)</span>
    1488         <span class="n">samSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="s">&#39; Sample delta-z(mm): &#39;</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>
     1561        <span class="n">samSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="s">&#39; Sample delta-z(mm): &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    14891562        <span class="n">samZ</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">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">value</span><span class="o">=</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%.3f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="s">&#39;Sample z&#39;</span><span class="p">])),</span>
    14901563            <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>
    1491         <span class="n">samSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">samZ</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>
     1564        <span class="n">samSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">samZ</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    14921565        <span class="n">samZ</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">OnSamZ</span><span class="p">)</span>
    14931566        <span class="n">samZ</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">OnSamZ</span><span class="p">)</span>
     
    14991572            <span class="n">Obj</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
    15001573            <span class="k">try</span><span class="p">:</span>
    1501                 <span class="n">value</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="mf">10.0</span><span class="p">,</span><span class="nb">max</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())))</span>
     1574                <span class="n">value</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="mf">20.0</span><span class="p">,</span><span class="nb">max</span><span class="p">(</span><span class="mf">0.25</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())))</span>
    15021575            <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
    15031576                <span class="n">value</span> <span class="o">=</span> <span class="mf">1.0</span>
    15041577            <span class="n">Obj</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%.5f</span><span class="s">&quot;</span><span class="o">%</span><span class="p">(</span><span class="n">value</span><span class="p">))</span>
    15051578            <span class="n">data</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">][</span><span class="n">Indx</span><span class="p">[</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetId</span><span class="p">()]][</span><span class="s">&#39;Dset&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
     1579            <span class="n">data</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">G2mth</span><span class="o">.</span><span class="n">sortArray</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><span class="s">&#39;Dset&#39;</span><span class="p">,</span><span class="n">reverse</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
     1580            <span class="n">Ring</span><span class="p">,</span><span class="n">R</span> <span class="o">=</span> <span class="n">G2img</span><span class="o">.</span><span class="n">MakeStrStaRing</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><span class="n">Indx</span><span class="p">[</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetId</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">Controls</span><span class="p">)</span>
     1581            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">Ring</span><span class="p">):</span>
     1582                <span class="n">data</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">][</span><span class="n">Indx</span><span class="p">[</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetId</span><span class="p">()]]</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">R</span><span class="p">)</span>
     1583            <span class="k">else</span><span class="p">:</span>
     1584                <span class="n">G2frame</span><span class="o">.</span><span class="n">ErrorDialog</span><span class="p">(</span><span class="s">&#39;Strain peak selection&#39;</span><span class="p">,</span><span class="s">&#39;WARNING - No points found for this ring selection&#39;</span><span class="p">)</span>
     1585               
     1586            <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>
     1587            <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><span class="n">newPlot</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
     1588            <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">True</span><span class="p">)</span>
    15061589           
    15071590        <span class="k">def</span> <span class="nf">OnDeleteDzero</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     
    15091592            <span class="k">del</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><span class="n">delIndx</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">Obj</span><span class="p">)])</span>
    15101593            <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>
     1594            <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><span class="n">newPlot</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
     1595            <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">True</span><span class="p">)</span>
    15111596       
    15121597        <span class="k">def</span> <span class="nf">OnCutOff</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
     
    15151600                <span class="n">value</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="mf">10.0</span><span class="p">,</span><span class="nb">max</span><span class="p">(</span><span class="mf">0.5</span><span class="p">,</span><span class="nb">float</span><span class="p">(</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())))</span>
    15161601            <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
    1517                 <span class="n">value</span> <span class="o">=</span> <span class="mf">10.0</span>
     1602                <span class="n">value</span> <span class="o">=</span> <span class="mf">1.0</span>
    15181603            <span class="n">Obj</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%.1f</span><span class="s">&quot;</span><span class="o">%</span><span class="p">(</span><span class="n">value</span><span class="p">))</span>
    15191604            <span class="n">data</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">][</span><span class="n">Indx</span><span class="p">[</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetId</span><span class="p">()]][</span><span class="s">&#39;cutoff&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
     1605            <span class="n">Ring</span><span class="p">,</span><span class="n">R</span> <span class="o">=</span> <span class="n">G2img</span><span class="o">.</span><span class="n">MakeStrStaRing</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><span class="n">Indx</span><span class="p">[</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetId</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">Controls</span><span class="p">)</span>
     1606            <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>
     1607            <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">True</span><span class="p">)</span>
    15201608       
    15211609        <span class="k">def</span> <span class="nf">OnPixLimit</span><span class="p">(</span><span class="n">event</span><span class="p">):</span>
    15221610            <span class="n">Obj</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
    15231611            <span class="n">data</span><span class="p">[</span><span class="s">&#39;d-zero&#39;</span><span class="p">][</span><span class="n">Indx</span><span class="p">[</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetId</span><span class="p">()]][</span><span class="s">&#39;pixLimit&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
     1612            <span class="n">Ring</span><span class="p">,</span><span class="n">R</span> <span class="o">=</span> <span class="n">G2img</span><span class="o">.</span><span class="n">MakeStrStaRing</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><span class="n">Indx</span><span class="p">[</span><span class="n">Obj</span><span class="o">.</span><span class="n">GetId</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">Controls</span><span class="p">)</span>
     1613            <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>
     1614            <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">True</span><span class="p">)</span>
    15241615           
    15251616        <span class="n">Indx</span> <span class="o">=</span> <span class="p">{}</span>
     
    15271618        <span class="n">dzeroSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    15281619        <span class="k">for</span> <span class="nb">id</span><span class="p">,</span><span class="n">dzero</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>
    1529             <span class="n">dzeroSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="p">(</span><span class="s">&#39; d-zero #</span><span class="si">%d</span><span class="s">: &#39;</span><span class="o">%</span><span class="p">(</span><span class="nb">id</span><span class="p">))),</span>
    1530                 <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>
     1620            <span class="n">dzeroSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="p">(</span><span class="s">&#39; d-zero #</span><span class="si">%d</span><span class="s">: &#39;</span><span class="o">%</span><span class="p">(</span><span class="nb">id</span><span class="p">))),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    15311621            <span class="n">dZero</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">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">value</span><span class="o">=</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%.5f</span><span class="s">&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">dzero</span><span class="p">[</span><span class="s">&#39;Dset&#39;</span><span class="p">])),</span>
    15321622                <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>
    1533             <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">dZero</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>
     1623            <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">dZero</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    15341624            <span class="n">dZero</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">OnDzero</span><span class="p">)</span>
    15351625            <span class="n">dZero</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">OnDzero</span><span class="p">)</span>
    15361626            <span class="n">Indx</span><span class="p">[</span><span class="n">dZero</span><span class="o">.</span><span class="n">GetId</span><span class="p">()]</span> <span class="o">=</span> <span class="nb">id</span>
    1537             <span class="n">dzeroSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="p">(</span><span class="s">&#39; d-zero calc: </span><span class="si">%.5f</span><span class="s">&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">dzero</span><span class="p">[</span><span class="s">&#39;Dcalc&#39;</span><span class="p">]))),</span>
    1538                 <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>
     1627            <span class="n">dzeroSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="p">(</span><span class="s">&#39; d-zero ave: </span><span class="si">%.5f</span><span class="s">&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">dzero</span><span class="p">[</span><span class="s">&#39;Dcalc&#39;</span><span class="p">]))),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    15391628               
    1540             <span class="n">dzeroSizer</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; Min ring I/Ib &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1541                 <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1629            <span class="n">dzeroSizer</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; Min ring I/Ib &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    15421630            <span class="n">cutOff</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="p">(</span><span class="s">&quot;</span><span class="si">%.1f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">dzero</span><span class="p">[</span><span class="s">&#39;cutoff&#39;</span><span class="p">])),</span>
    15431631                <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>
     
    15451633            <span class="n">cutOff</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">OnCutOff</span><span class="p">)</span>
    15461634            <span class="n">Indx</span><span class="p">[</span><span class="n">cutOff</span><span class="o">.</span><span class="n">GetId</span><span class="p">()]</span> <span class="o">=</span> <span class="nb">id</span>
    1547             <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">cutOff</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>
    1548        
    1549             <span class="n">dzeroSizer</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; Pixel search range &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span>
    1550                 <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">)</span>
     1635            <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">cutOff</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     1636       
     1637            <span class="n">dzeroSizer</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; Pixel search range &#39;</span><span class="p">),</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
    15511638            <span class="n">pixLimit</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</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="nb">str</span><span class="p">(</span><span class="n">dzero</span><span class="p">[</span><span class="s">&#39;pixLimit&#39;</span><span class="p">]),</span><span class="n">choices</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;1&#39;</span><span class="p">,</span><span class="s">&#39;2&#39;</span><span class="p">,</span><span class="s">&#39;5&#39;</span><span class="p">,</span><span class="s">&#39;10&#39;</span><span class="p">,</span><span class="s">&#39;15&#39;</span><span class="p">,</span><span class="s">&#39;20&#39;</span><span class="p">],</span>
    15521639                <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_DROPDOWN</span><span class="p">)</span>
    15531640            <span class="n">pixLimit</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_COMBOBOX</span><span class="p">,</span> <span class="n">OnPixLimit</span><span class="p">)</span>
    15541641            <span class="n">Indx</span><span class="p">[</span><span class="n">pixLimit</span><span class="o">.</span><span class="n">GetId</span><span class="p">()]</span> <span class="o">=</span> <span class="nb">id</span>
    1555             <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">pixLimit</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>               
     1642            <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">pixLimit</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>               
    15561643               
    15571644            <span class="n">dzeroDelete</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;delete?&#39;</span><span class="p">)</span>
    15581645            <span class="n">dzeroDelete</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">OnDeleteDzero</span><span class="p">)</span>
    15591646            <span class="n">delIndx</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">dzeroDelete</span><span class="p">)</span>
    1560             <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">dzeroDelete</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>
     1647            <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">dzeroDelete</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     1648           
     1649            <span class="n">dzeroSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="p">(</span><span class="s">&#39; Strain tensor:&#39;</span><span class="p">)),</span><span class="n">WACV</span><span class="p">)</span>
     1650            <span class="n">names</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;e11&#39;</span><span class="p">,</span><span class="s">&#39;e12&#39;</span><span class="p">,</span><span class="s">&#39;e22&#39;</span><span class="p">]</span>
     1651            <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">3</span><span class="p">):</span>
     1652                <span class="n">dzeroSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="n">names</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="n">WACV</span><span class="p">)</span>
     1653                <span class="n">tensorElem</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">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">value</span><span class="o">=</span><span class="s">&#39;</span><span class="si">%.2f</span><span class="s">&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">dzero</span><span class="p">[</span><span class="s">&#39;Emat&#39;</span><span class="p">][</span><span class="n">i</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_READONLY</span><span class="p">)</span>
     1654                <span class="n">tensorElem</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
     1655                <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">tensorElem</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="n">WACV</span><span class="p">)</span>
     1656            <span class="n">dzeroSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>             
    15611657        <span class="k">return</span> <span class="n">dzeroSizer</span>
    15621658       
    1563     <span class="k">def</span> <span class="nf">StrainSizer</span><span class="p">():</span>
    1564        
    1565         <span class="n">strainSizer</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">VERTICAL</span><span class="p">)</span>
    1566         <span class="n">strainSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="p">(</span><span class="s">&#39; Strain tensor:&#39;</span><span class="p">)),</span>
    1567             <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>
    1568         <span class="n">tensorSizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">FlexGridSizer</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
    1569         <span class="n">names</span> <span class="o">=</span> <span class="p">[[</span><span class="s">&#39; e11&#39;</span><span class="p">,</span><span class="s">&#39;e12&#39;</span><span class="p">,</span><span class="s">&#39;e13&#39;</span><span class="p">],[</span><span class="s">&#39; e21&#39;</span><span class="p">,</span><span class="s">&#39;e22&#39;</span><span class="p">,</span><span class="s">&#39;e23&#39;</span><span class="p">],[</span><span class="s">&#39; e31&#39;</span><span class="p">,</span><span class="s">&#39;e32&#39;</span><span class="p">,</span><span class="s">&#39;e33&#39;</span><span class="p">]]</span>
    1570         <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">3</span><span class="p">):</span>
    1571             <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">):</span>
    1572                 <span class="n">tensorSizer</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="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">label</span><span class="o">=</span><span class="n">names</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</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>
    1573                 <span class="n">tensorElem</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">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">value</span><span class="o">=</span><span class="s">&#39;</span><span class="si">%.2f</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;strain&#39;</span><span class="p">][</span><span class="n">i</span><span class="p">][</span><span class="n">j</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_READONLY</span><span class="p">)</span>
    1574                 <span class="n">tensorElem</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">VERY_LIGHT_GREY</span><span class="p">)</span>
    1575                 <span class="n">tensorSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">tensorElem</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>
    1576         <span class="n">strainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">tensorSizer</span><span class="p">)</span>
    1577         <span class="k">return</span> <span class="n">strainSizer</span>
    1578 
    15791659    <span class="k">if</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="p">:</span>
    15801660        <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
     1661    <span class="n">Controls</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">PatternTree</span><span class="o">.</span><span class="n">GetItemPyData</span><span class="p">(</span>
     1662        <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>       
    15811663    <span class="n">G2gd</span><span class="o">.</span><span class="n">SetDataMenuBar</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">dataFrame</span><span class="o">.</span><span class="n">StrStaMenu</span><span class="p">)</span>
    15821664    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</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_MENU</span><span class="p">,</span> <span class="n">OnAppendDzero</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="n">G2gd</span><span class="o">.</span><span class="n">wxID_APPENDDZERO</span><span class="p">)</span>
     1665    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</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_MENU</span><span class="p">,</span> <span class="n">OnUpdateDzero</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="n">G2gd</span><span class="o">.</span><span class="n">wxID_UPDATEDZERO</span><span class="p">)</span>
    15831666    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</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_MENU</span><span class="p">,</span> <span class="n">OnFitStrSta</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="n">G2gd</span><span class="o">.</span><span class="n">wxID_STRSTAFIT</span><span class="p">)</span>
     1667    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</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_MENU</span><span class="p">,</span> <span class="n">OnAllFitStrSta</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="n">G2gd</span><span class="o">.</span><span class="n">wxID_STRSTAALLFIT</span><span class="p">)</span>
    15841668    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</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_MENU</span><span class="p">,</span> <span class="n">OnCopyStrSta</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="n">G2gd</span><span class="o">.</span><span class="n">wxID_STRSTACOPY</span><span class="p">)</span>
    15851669    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</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_MENU</span><span class="p">,</span> <span class="n">OnLoadStrSta</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="n">G2gd</span><span class="o">.</span><span class="n">wxID_STRSTALOAD</span><span class="p">)</span>
     
    15871671    <span class="k">if</span> <span class="ow">not</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="o">.</span><span class="n">GetStatusBar</span><span class="p">():</span>
    15881672        <span class="n">Status</span> <span class="o">=</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="o">.</span><span class="n">CreateStatusBar</span><span class="p">()</span>
    1589         <span class="n">Status</span><span class="o">.</span><span class="n">SetStatusText</span><span class="p">(</span><span class="s">&quot; test  &quot;</span><span class="p">)</span>
    1590     <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Panel</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="p">)</span>
     1673    <span class="k">if</span> <span class="n">G2frame</span><span class="o">.</span><span class="n">StrainKey</span> <span class="o">==</span> <span class="s">&#39;a&#39;</span><span class="p">:</span>    <span class="c">#probably doesn&#39;t happen</span>
     1674        <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="o">.</span><span class="n">GetStatusBar</span><span class="p">()</span><span class="o">.</span><span class="n">SetStatusText</span><span class="p">(</span><span class="s">&#39;Add strain ring active - LB pick d-zero value&#39;</span><span class="p">)</span>
     1675    <span class="k">else</span><span class="p">:</span>
     1676        <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="o">.</span><span class="n">GetStatusBar</span><span class="p">()</span><span class="o">.</span><span class="n">SetStatusText</span><span class="p">(</span><span class="s">&quot;To add strain data: On 2D Powder Image, key a:add ring&quot;</span><span class="p">)</span>
     1677       
     1678    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span> <span class="o">=</span> <span class="n">wxscroll</span><span class="o">.</span><span class="n">ScrolledPanel</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="p">)</span>
    15911679    <span class="n">mainSizer</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">VERTICAL</span><span class="p">)</span>
    15921680    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">10</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
     
    15941682    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">10</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    15951683    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">DzeroSizer</span><span class="p">())</span>
    1596     <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span><span class="mi">10</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span>
    1597     <span class="n">mainSizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">StrainSizer</span><span class="p">())</span>
    15981684   
    15991685    <span class="n">mainSizer</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>   
    16001686    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">mainSizer</span><span class="p">)</span>
    1601     <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="o">.</span><span class="n">SetSize</span><span class="p">(</span><span class="n">mainSizer</span><span class="o">.</span><span class="n">Fit</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="p">))</span>
    1602     <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="o">.</span><span class="n">setSizePosLeft</span><span class="p">(</span><span class="n">mainSizer</span><span class="o">.</span><span class="n">Fit</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="p">))</span>    </div>
     1687    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="o">.</span><span class="n">SetAutoLayout</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
     1688    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="o">.</span><span class="n">SetupScrolling</span><span class="p">()</span>
     1689    <span class="n">Size</span> <span class="o">=</span> <span class="n">mainSizer</span><span class="o">.</span><span class="n">Fit</span><span class="p">(</span><span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="p">)</span>
     1690    <span class="n">Size</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+=</span> <span class="mi">25</span>
     1691    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataDisplay</span><span class="o">.</span><span class="n">SetSize</span><span class="p">(</span><span class="n">Size</span><span class="p">)</span>
     1692    <span class="n">G2frame</span><span class="o">.</span><span class="n">dataFrame</span><span class="o">.</span><span class="n">setSizePosLeft</span><span class="p">(</span><span class="n">Size</span><span class="p">)</span>    </div>
    16031693</pre></div>
    16041694
Note: See TracChangeset for help on using the changeset viewer.