Changeset 1260


Ignore:
Timestamp:
Mar 21, 2014 10:34:51 AM (10 years ago)
Author:
vondreele
Message:

shade out fixed row of Limits table
allow user input of min/max particle diameters & change tutorial to reflect change in Model window
fix a bug in Size Dist calculation

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r1253 r1260  
    704704    G2frame.Bind(wx.EVT_MENU,OnAddExcl,id=G2gd.wxID_ADDEXCLREGION)   
    705705    G2frame.dataDisplay = G2gd.GSGrid(parent=G2frame.dataFrame)
    706     G2frame.dataDisplay.SetTable(G2frame.LimitsTable, True)
     706    G2frame.dataDisplay.SetTable(G2frame.LimitsTable, True)   
     707    G2frame.dataDisplay.SetCellStyle(0,0,VERY_LIGHT_GREY,True)
     708    G2frame.dataDisplay.SetCellStyle(0,1,VERY_LIGHT_GREY,True)
    707709    G2frame.dataDisplay.Bind(wg.EVT_GRID_CELL_CHANGE, RefreshLimitsGrid)               
    708710    G2frame.dataDisplay.Bind(wx.EVT_KEY_DOWN, KeyEditPeakGrid)
     
    710712    G2frame.dataDisplay.AutoSizeColumns(False)
    711713    G2frame.dataFrame.setSizePosLeft([230,260])
     714                               
    712715   
    713716################################################################################
     
    25262529        except ValueError:
    25272530            value = item[ind]
    2528             Obj.SetValue(str(value))
     2531        Obj.SetValue(str(value))
    25292532        item[ind] = value
    25302533
     
    25602563        minDias = ['10','25','50','100','150','200']
    25612564        mindiam = wx.ComboBox(G2frame.dataDisplay,value=str(data['Size']['MinDiam']),choices=minDias,
    2562             style=wx.CB_READONLY|wx.CB_DROPDOWN)
    2563         mindiam.Bind(wx.EVT_COMBOBOX,OnIntVal)       
     2565            style=wx.CB_DROPDOWN)
     2566        mindiam.Bind(wx.EVT_TEXT_ENTER,OnIntVal)       
     2567        mindiam.Bind(wx.EVT_KILL_FOCUS,OnIntVal)
    25642568        Indx[mindiam.GetId()] = [data['Size'],'MinDiam',0]
    25652569        binSizer.Add(mindiam,0,WACV)
     
    25682572        maxdiam = wx.ComboBox(G2frame.dataDisplay,value=str(data['Size']['MaxDiam']),choices=maxDias,
    25692573            style=wx.CB_DROPDOWN)
    2570         maxdiam.Bind(wx.EVT_COMBOBOX,OnIntVal)       
     2574        maxdiam.Bind(wx.EVT_TEXT_ENTER,OnIntVal)       
     2575        maxdiam.Bind(wx.EVT_KILL_FOCUS,OnIntVal)
    25712576        Indx[maxdiam.GetId()] = [data['Size'],'MaxDiam',0]
    25722577        binSizer.Add(maxdiam,0,WACV)
  • trunk/GSASIIsasd.py

    r1253 r1260  
    760760    BinsBack = np.ones_like(Bins)*Sky*Scale/Contrast
    761761    Back = data['Back']
    762     Q,Io,wt,Ic,Ib = Profile
     762    Q,Io,wt,Ic,Ib = Profile[:5]
    763763    Qmin = Limits[1][0]
    764764    Qmax = Limits[1][1]
  • trunk/help/Small Angle Size Distribution.htm

    r1258 r1260  
    2525  <o:Author>Von Dreele</o:Author>
    2626  <o:LastAuthor>Von Dreele</o:LastAuthor>
    27   <o:Revision>7</o:Revision>
    28   <o:TotalTime>1865</o:TotalTime>
     27  <o:Revision>8</o:Revision>
     28  <o:TotalTime>1868</o:TotalTime>
    2929  <o:Created>2014-03-20T16:54:00Z</o:Created>
    30   <o:LastSaved>2014-03-20T21:31:00Z</o:LastSaved>
     30  <o:LastSaved>2014-03-21T15:25:00Z</o:LastSaved>
    3131  <o:Pages>6</o:Pages>
    32   <o:Words>1267</o:Words>
    33   <o:Characters>7225</o:Characters>
     32  <o:Words>1265</o:Words>
     33  <o:Characters>7212</o:Characters>
    3434  <o:Company>Argonne National Laboratory</o:Company>
    3535  <o:Lines>60</o:Lines>
    3636  <o:Paragraphs>16</o:Paragraphs>
    37   <o:CharactersWithSpaces>8476</o:CharactersWithSpaces>
     37  <o:CharactersWithSpaces>8461</o:CharactersWithSpaces>
    3838  <o:Version>14.00</o:Version>
    3939 </o:DocumentProperties>
     
    779779 /* List Definitions */
    780780 @list l0
    781         {mso-list-id:72943423;
     781        {mso-list-id:608973138;
    782782        mso-list-type:hybrid;
    783         mso-list-template-ids:596828552 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
     783        mso-list-template-ids:-1449999034 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
    784784@list l0:level1
    785785        {mso-level-tab-stop:none;
     
    824824        mso-level-number-position:right;
    825825        text-indent:-9.0pt;}
    826 @list l1
    827         {mso-list-id:224948912;
    828         mso-list-type:hybrid;
    829         mso-list-template-ids:1354009666 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
    830 @list l1:level1
    831         {mso-level-tab-stop:none;
    832         mso-level-number-position:left;
    833         text-indent:-.25in;}
    834 @list l1:level2
    835         {mso-level-number-format:alpha-lower;
    836         mso-level-tab-stop:none;
    837         mso-level-number-position:left;
    838         text-indent:-.25in;}
    839 @list l1:level3
    840         {mso-level-number-format:roman-lower;
    841         mso-level-tab-stop:none;
    842         mso-level-number-position:right;
    843         text-indent:-9.0pt;}
    844 @list l1:level4
    845         {mso-level-tab-stop:none;
    846         mso-level-number-position:left;
    847         text-indent:-.25in;}
    848 @list l1:level5
    849         {mso-level-number-format:alpha-lower;
    850         mso-level-tab-stop:none;
    851         mso-level-number-position:left;
    852         text-indent:-.25in;}
    853 @list l1:level6
    854         {mso-level-number-format:roman-lower;
    855         mso-level-tab-stop:none;
    856         mso-level-number-position:right;
    857         text-indent:-9.0pt;}
    858 @list l1:level7
    859         {mso-level-tab-stop:none;
    860         mso-level-number-position:left;
    861         text-indent:-.25in;}
    862 @list l1:level8
    863         {mso-level-number-format:alpha-lower;
    864         mso-level-tab-stop:none;
    865         mso-level-number-position:left;
    866         text-indent:-.25in;}
    867 @list l1:level9
    868         {mso-level-number-format:roman-lower;
    869         mso-level-tab-stop:none;
    870         mso-level-number-position:right;
    871         text-indent:-9.0pt;}
    872 @list l2
    873         {mso-list-id:608973138;
    874         mso-list-type:hybrid;
    875         mso-list-template-ids:-1449999034 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
    876 @list l2:level1
    877         {mso-level-tab-stop:none;
    878         mso-level-number-position:left;
    879         text-indent:-.25in;}
    880 @list l2:level2
    881         {mso-level-number-format:alpha-lower;
    882         mso-level-tab-stop:none;
    883         mso-level-number-position:left;
    884         text-indent:-.25in;}
    885 @list l2:level3
    886         {mso-level-number-format:roman-lower;
    887         mso-level-tab-stop:none;
    888         mso-level-number-position:right;
    889         text-indent:-9.0pt;}
    890 @list l2:level4
    891         {mso-level-tab-stop:none;
    892         mso-level-number-position:left;
    893         text-indent:-.25in;}
    894 @list l2:level5
    895         {mso-level-number-format:alpha-lower;
    896         mso-level-tab-stop:none;
    897         mso-level-number-position:left;
    898         text-indent:-.25in;}
    899 @list l2:level6
    900         {mso-level-number-format:roman-lower;
    901         mso-level-tab-stop:none;
    902         mso-level-number-position:right;
    903         text-indent:-9.0pt;}
    904 @list l2:level7
    905         {mso-level-tab-stop:none;
    906         mso-level-number-position:left;
    907         text-indent:-.25in;}
    908 @list l2:level8
    909         {mso-level-number-format:alpha-lower;
    910         mso-level-tab-stop:none;
    911         mso-level-number-position:left;
    912         text-indent:-.25in;}
    913 @list l2:level9
    914         {mso-level-number-format:roman-lower;
    915         mso-level-tab-stop:none;
    916         mso-level-number-position:right;
    917         text-indent:-9.0pt;}
    918826ol
    919827        {margin-bottom:0in;}
     
    975883<div class=WordSection1>
    976884
    977 <h1><strong><span style='mso-bidi-font-weight:normal'>Small Angle X-Ray Data – Size
    978 Distribution in Alumina Powder</span><o:p></o:p></strong></h1>
     885<h1><strong><span style='mso-bidi-font-weight:normal'>Small Angle X-Ray Data –
     886Size Distribution in Alumina Powder</span><o:p></o:p></strong></h1>
    979887
    980888<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'>In
    981889this tutorial you will determine the size distribution of particles in an
    982 alumina polishing powder using data from a constant wavelength synchrotron
    983 X-ray USAXS instrument. You will use both Maximum Entropy (<span class=SpellE>MaxEnt</span>)
     890alumina polishing powder using data from a constant wavelength synchrotron X-ray
     891USAXS instrument. You will use both Maximum Entropy (<span class=SpellE>MaxEnt</span>)
    984892and Total Non-Negative Least Squares (TNNLS) methods assuming spherical
    985893particles. The data were collected from <span style='mso-fareast-font-family:
     
    997905<h2>Step 1: read in the data file</h2>
    998906
    999 <p class=MsoListParagraphCxSpFirst style='text-indent:-.25in;mso-list:l2 level1 lfo2'><![if !supportLists]><span
     907<p class=MsoListParagraphCxSpFirst style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span
    1000908style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>1.<span
    1001909style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]>Use
     
    1004912Calibri;mso-bidi-theme-font:minor-latin'>Import/Small Angle Data/from a q step
    1005913QIE data file</span></b> menu item to read the data file into GSAS-II. This
    1006 read option is set to read three column small angle scattering data (SASD) as Q,
    1007 intensity and estimated standard deviation in intensity; <span class=GramE>There</span>
     914read option is set to read three column small angle scattering data (SASD) as
     915Q, intensity and estimated standard deviation in intensity; <span class=GramE>There</span>
    1008916may be a header with metadata information in the front of this file.<span
    1009917style='mso-spacerun:yes'>  </span>Change the file directory to <b
     
    1015923minor-latin'> to find the file.</span></p>
    1016924
    1017 <p class=MsoListParagraphCxSpLast style='text-indent:-.25in;mso-list:l2 level1 lfo2'><![if !supportLists]><span
     925<p class=MsoListParagraphCxSpLast style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span
    1018926style='mso-fareast-font-family:"Times New Roman"'><span style='mso-list:Ignore'>2.<span
    1019927style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]>Select
     
    1076984
    1077985<p class=MsoNormal>For this step we will reposition the limits to enclose only
    1078 that part of the SASD pattern suitable for size distribution analysis. Typically
    1079 this covers 10<sup>-3</sup> &lt; Q &lt; 10<sup>-1</sup>; below this range scattering
    1080 is from very large objects not readily described by the size distribution
    1081 analysis and above the scattering is mostly background. Select <b
     986that part of the SASD pattern suitable for size distribution analysis.
     987Typically this covers 10<sup>-3</sup> &lt; Q &lt; 10<sup>-1</sup>; below this
     988range scattering is from very large objects not readily described by the size
     989distribution analysis and above the scattering is mostly background. Select <b
    1082990style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif";
    1083991mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin'>Limits</span></b>
     
    11221030style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin;
    11231031mso-hansi-theme-font:minor-latin;mso-no-proof:yes'>UserSubstances.py</span></b><span
    1124 style='mso-no-proof:yes'>; this is read after Substances.py when you load substances
    1125 for your selection. </span>Select <b style='mso-bidi-font-weight:normal'><span
    1126 style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin;
    1127 mso-hansi-theme-font:minor-latin'>Substances</span></b> under <b
     1032style='mso-no-proof:yes'>; this is read after Substances.py when you load
     1033substances for your selection. </span>Select <b style='mso-bidi-font-weight:
     1034normal'><span style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:
     1035minor-latin;mso-hansi-theme-font:minor-latin'>Substances</span></b> under <b
    11281036style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif";
    11291037mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin'>SASD alumina
     
    11631071<p class=MsoNormal>If desired you can load/add as many substances as you desire
    11641072into this list; you can also delete any of them (except vacuum). The
    1165 composition, volume occupied by the atoms in the composition and the density are
    1166 given for each substance. These can each be edited; the other values will change
    1167 accordingly. If your substance isn’t in the list, you can <b style='mso-bidi-font-weight:
    1168 normal'><span style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:
    1169 minor-latin;mso-hansi-theme-font:minor-latin'>Edit/Add substance</span></b> to
    1170 create a new one (you will be asked for a name and the set of elements in two successive
    1171 popup windows). From this information the scattering density and that as
    1172 affected by resonant scattering for the listed wavelength is displayed (the
    1173 wavelength can be changed in the <b style='mso-bidi-font-weight:normal'><span
    1174 style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin;
    1175 mso-hansi-theme-font:minor-latin'>Instrument Parameters</span></b> GSAS-II tree
    1176 item if needed). The resonant scattering value is used for contrast
    1177 calculations.</p>
     1073composition, volume occupied by the atoms in the composition and the density
     1074are given for each substance. These can each be edited; the other values will
     1075change accordingly. If your substance isn’t in the list, you can <b
     1076style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif";
     1077mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin'>Edit/Add
     1078substance</span></b> to create a new one (you will be asked for a name and the
     1079set of elements in two successive popup windows). From this information the
     1080scattering density and that as affected by resonant scattering for the listed
     1081wavelength is displayed (the wavelength can be changed in the <b
     1082style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif";
     1083mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin'>Instrument
     1084Parameters</span></b> GSAS-II tree item if needed). The resonant scattering
     1085value is used for contrast calculations.</p>
    11781086
    11791087<h2>Step 4: Set Sample parameters </h2>
     
    12231131<h2>Step 5 Size distribution via Maximum Entropy</h2>
    12241132
    1225 <p class=MsoNormal>You are now ready to attempt a size distribution analysis using
    1226 the maximum entropy method. Select <b style='mso-bidi-font-weight:normal'><span
     1133<p class=MsoNormal>You are now ready to attempt a size distribution analysis
     1134using the maximum entropy method. Select <b style='mso-bidi-font-weight:normal'><span
    12271135style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin;
    12281136mso-hansi-theme-font:minor-latin'>Models</span></b> under <b style='mso-bidi-font-weight:
     
    12321140
    12331141<p class=MsoNormal><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape
    1234  id="Picture_x0020_26" o:spid="_x0000_i1033" type="#_x0000_t75" style='width:355.5pt;
     1142 id="Picture_x0020_15" o:spid="_x0000_i1033" type="#_x0000_t75" style='width:355.5pt;
    12351143 height:191.25pt;visibility:visible;mso-wrap-style:square'>
    12361144 <v:imagedata src="Small%20Angle%20Size%20Distribution_files/image006.png"
    12371145  o:title=""/>
    12381146</v:shape><![endif]--><![if !vml]><img border=0 width=474 height=255
    1239 src="Small%20Angle%20Size%20Distribution_files/image006.png" v:shapes="Picture_x0020_26"><![endif]></span></p>
     1147src="Small%20Angle%20Size%20Distribution_files/image006.png" v:shapes="Picture_x0020_15"><![endif]></span></p>
    12401148
    12411149<p class=MsoNormal><o:p>&nbsp;</o:p></p>
     
    13371245make this determination.</p>
    13381246
    1339 <h2>Step 6 Size Distribution <i style='mso-bidi-font-style:normal'>via</i> Total
    1340 Non-Negative Least Squares (TNNLS)</h2>
     1247<h2>Step 6 Size Distribution <i style='mso-bidi-font-style:normal'>via</i>
     1248Total Non-Negative Least Squares (TNNLS)</h2>
    13411249
    13421250<p class=MsoNormal>An alternative method for determining size distributions is
     
    13471255minor-latin;mso-hansi-theme-font:minor-latin'>IPG</span></b> from the <b
    13481256style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif";
    1349 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin'>Fitting method</span></b>
    1350 pull down. The data window will change to give</p>
     1257mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin'>Fitting
     1258method</span></b> pull down. The data window will change to give</p>
    13511259
    13521260<p class=MsoNormal><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape
    1353  id="Picture_x0020_288" o:spid="_x0000_i1028" type="#_x0000_t75" style='width:375.75pt;
     1261 id="Picture_x0020_16" o:spid="_x0000_i1028" type="#_x0000_t75" style='width:375.75pt;
    13541262 height:191.25pt;visibility:visible;mso-wrap-style:square'>
    13551263 <v:imagedata src="Small%20Angle%20Size%20Distribution_files/image011.png"
    13561264  o:title=""/>
    13571265</v:shape><![endif]--><![if !vml]><img border=0 width=501 height=255
    1358 src="Small%20Angle%20Size%20Distribution_files/image011.png" v:shapes="Picture_x0020_288"><![endif]></span></p>
     1266src="Small%20Angle%20Size%20Distribution_files/image011.png" v:shapes="Picture_x0020_16"><![endif]></span></p>
    13591267
    13601268<p class=MsoNormal><o:p>&nbsp;</o:p></p>
    13611269
    13621270<p class=MsoNormal>Reset the Error multiplier back to 1.0 and then do
    1363 Models/Fit to run the IPG fitting. The IPG algorithm did not converge in 100
    1364 cycles and resulting size distribution is a little choppy but has roughly the
    1365 same bimodal distribution found by <span class=SpellE>MaxEnt</span>.</p>
     1271Models/Fit to run the IPG fitting. The IPG algorithm did not converge in 100 cycles
     1272and resulting size distribution is a little choppy but has roughly the same
     1273bimodal distribution found by <span class=SpellE>MaxEnt</span>.</p>
    13661274
    13671275<p class=MsoNormal><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape
     
    13771285<p class=MsoNormal>This can be considerably improved by setting the <b
    13781286style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif";
    1379 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin'>Error
    1380 multiplier</span></b> to 2.0; the IPG fit con<span style='mso-no-proof:yes'>verges
    1381 in &lt;20 cycles and gives a smoother size distribution.<o:p></o:p></span></p>
     1287mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin'>Error multiplier</span></b>
     1288to 2.0; the IPG fit con<span style='mso-no-proof:yes'>verges in &lt;20 cycles
     1289and gives a smoother size distribution.<o:p></o:p></span></p>
    13821290
    13831291<p class=MsoNormal><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape
     
    14251333mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin'>2.0</span></b>.</p>
    14261334
    1427 <p class=MsoNormal>You should save this GSAS-II project as it will be used in (future)
    1428 tutorials for Particle fit and Unified fit <span class=SpellE>modelling</span>;
     1335<p class=MsoNormal>You should save this GSAS-II project as it will be used in
     1336(future) tutorials for Particle fit and Unified fit <span class=SpellE>modelling</span>;
    14291337I used <span class=SpellE><b style='mso-bidi-font-weight:normal'><span
    14301338style='font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin;
Note: See TracChangeset for help on using the changeset viewer.