Changeset 4783 for trunk


Ignore:
Timestamp:
Jan 26, 2021 12:48:52 PM (9 months ago)
Author:
toby
Message:

wx4.1 updates; new CIF data item; scripting: peak fit details returned; improve multistring gui

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r4764 r4783  
    27522752    :param wx.Frame parent: name of parent frame
    27532753    :param str title: title string for dialog
    2754     :param str prompts: strings to tell use what they are inputting
    2755     :param str values: default input values, if any
     2754    :param list prompts: list of strings to tell user what they are inputting
     2755    :param list values: list of str default input values, if any
    27562756    :param int size: length of the input box in pixels
    27572757    :param bool addRows: if True, users can add rows to the table
     
    27592759    :param str hlp: if supplied, a help button is added to the dialog that
    27602760      can be used to display the supplied help text in this variable.
     2761    :param str lbl: label placed at top of dialog 
     2762    :returns: a wx.Dialog instance
    27612763    '''
    27622764    def __init__(self,parent,title,prompts,values=[],size=-1,
    2763                      addRows=False,hlp=None):
     2765                     addRows=False,hlp=None, lbl=None):
    27642766        wx.Dialog.__init__(self,parent,wx.ID_ANY,title,
    27652767                           pos=wx.DefaultPosition,
     
    27692771        self.addRows = addRows
    27702772        self.size = size
    2771         self.hlp = hlp
     2773        self.hlp = StripIndents(hlp,True)
     2774        self.lbl = lbl
    27722775        self.CenterOnParent()
    27732776        self.Paint()
     
    27792782        if self.hlp:
    27802783            btnsizer = wx.BoxSizer(wx.HORIZONTAL)
    2781             hlp = HelpButton(self,self.hlp)
     2784            hlp = HelpButton(self, self.hlp, wrap=450)
    27822785            btnsizer.Add((-1,-1),1, wx.EXPAND, 1)
    27832786            btnsizer.Add(hlp,0,wx.ALIGN_RIGHT|wx.ALL)
    27842787            mainSizer.Add(btnsizer,0,wx.EXPAND)
     2788        if self.lbl:
     2789            mainSizer.Add(wx.StaticText(self,wx.ID_ANY,self.lbl),0,WACV,0)
     2790            mainSizer.Add((-1,15))
    27852791        promptSizer = wx.FlexGridSizer(0,2,5,5)
    27862792        promptSizer.AddGrowableCol(1,1)
     
    28222828    def Show(self):
    28232829        '''Use this method after creating the dialog to post it
     2830       
    28242831        :returns: True if the user pressed OK; False if the User pressed Cancel
    28252832        '''
     
    28302837
    28312838    def GetValues(self):
    2832         '''Use this method to get the value entered by the user
    2833         :returns: string entered by user
     2839        '''Use this method to get the value(s) entered by the user
     2840       
     2841        :returns: a list of strings entered by user
    28342842        '''
    28352843        return self.values
  • trunk/GSASIIddataGUI.py

    r4764 r4783  
    979979                    textJ = G2lat.textureIndex(POData[5])
    980980                    poSizer.Add(wx.StaticText(DData,wx.ID_ANY,' Spherical harmonic coefficients: '+'Texture index: %.3f'%(textJ))
    981                         ,0,WACV|wx.TOP|wx.BOTTOM,5)
     981                        ,0,wx.TOP|wx.BOTTOM,5)
    982982                    poSizer.Add(SHDataSizer(POData),0,wx.TOP|wx.BOTTOM,5)
    983983                    poSizer.Add(SHPenalty(POData),0,wx.TOP|wx.BOTTOM,5)
  • trunk/GSASIIphsGUI.py

    r4763 r4783  
    93989398        mainSizer.Add((0,5),0)
    93999399        if textureData['SHShow']:
    9400             mainSizer.Add(wx.StaticText(Texture,-1,' Spherical harmonic coefficients: '),0,WACV)
     9400            mainSizer.Add(wx.StaticText(Texture,-1,' Spherical harmonic coefficients: '))
    94019401            mainSizer.Add((0,5),0)
    94029402            ODFSizer = wx.FlexGridSizer(0,8,2,2)
     
    94079407                ODFval = G2G.ValidatedTxtCtrl(Texture,textureData['SH Coeff'][1],item,nDig=(8,3),OnLeave=OnODFValue)
    94089408                ODFSizer.Add(ODFval,0,WACV)
    9409             mainSizer.Add(ODFSizer,0,WACV)
     9409            mainSizer.Add(ODFSizer,0)
    94109410            mainSizer.Add((0,5),0)
    94119411        mainSizer.Add((0,5),0)
  • trunk/GSASIIscriptable.py

    r4782 r4783  
    168168:meth:`G2PwdrData.add_peak`                           Adds a peak to the peak list. Also see :ref:`PeakRefine`.
    169169:meth:`G2PwdrData.set_peakFlags`                      Sets refinement flags for peaks
    170 :meth:`G2PwdrData.refine_peaks`                       Starts a peak/background fitting cycle
     170:meth:`G2PwdrData.refine_peaks`                       Starts a peak/background fitting cycle, returns refinement results
    171171:attr:`G2PwdrData.Peaks`                              Provides access to the peak list data structure
    172172:attr:`G2PwdrData.PeakList`                           Provides the peak list parameter values
     
    810810    hist.refine_peaks()
    811811    hist.set_peakFlags(area=True, pos=True, sig=True, gam=True)
    812     hist.refine_peaks()
     812    res = hist.refine_peaks()
    813813    print('peak positions: ',[i[0] for i in hist.PeakList])
    814814    for i in range(len(hist.Peaks['peaks'])):
     
    42444244    def refine_peaks(self):
    42454245        '''Causes a refinement of peak position, background and instrument parameters
     4246
     4247        :returns: a list of dicts with refinement results. Element 0 has uncertainties
     4248          on refined values (also placed in self.data['Peak List']['sigDict'])
     4249          element 1 has the peak fit result, element 2 has the peak fit uncertainties
     4250          and element 3 has r-factors from the fit.
     4251          (These are generated in :meth:`GSASIIpwd.DoPeakFit`).
    42464252        '''
    42474253        import GSASIIpwd as G2pwd
     
    42554261        limits = self.data['Limits'][1]
    42564262        bxye = np.zeros(len(self.data['data'][1][1]))
    4257         peaks['sigDict'] = G2pwd.DoPeakFit('LSQ',peaks['peaks'],background,limits,
     4263        result = G2pwd.DoPeakFit('LSQ',peaks['peaks'],background,limits,
    42584264                                           Parms,Parms2,self.data['data'][1],bxye,[],
    4259                                            oneCycle=False,controls=controls,dlg=None)[0]
    4260 
     4265                                           oneCycle=False,controls=controls,dlg=None)
     4266        peaks['sigDict'] = result[0]
     4267        return result
     4268       
    42614269    @property
    42624270    def Peaks(self):
  • trunk/GSASIIstrMain.py

    r4780 r4783  
    727727                rigidbodyDict,parmDict,varyList,calcControls,pawleyLookup,ifSeq,printFile,dlg,
    728728                refPlotUpdate=refPlotUpdate)
    729             G2fil.G2Print ('  wR = %7.2f%%, chi**2 = %12.6g, reduced chi**2 = %6.2f, last delta chi = %.4f, last shft/sig = %.4f'%(
    730                 Rvals['Rwp'],Rvals['chisq'],Rvals['GOF']**2,Rvals['DelChi2'],Rvals.get('Max shft/sig',np.nan)))
     729            try:
     730                shft = '%.4f'% Rvals['Max shft/sig']
     731            except:
     732                shft = '?'
     733            G2fil.G2Print ('  wR = %7.2f%%, chi**2 = %12.6g, reduced chi**2 = %6.2f, last delta chi = %.4f, last shft/sig = %s'%(
     734                Rvals['Rwp'],Rvals['chisq'],Rvals['GOF']**2,Rvals['DelChi2'],shft))
    731735            if Rvals.get('lamMax',0) >= 10.:
    732736                msgs['steepestNum'] += 1
  • trunk/exports/G2export_CIF.py

    r4759 r4783  
    120120                 '\n   _atom_site_adp_type'+
    121121                 '\n   _atom_site_U_iso_or_equiv'+
    122                  '\n   _atom_site_symmetry_multiplicity')
     122                 '\n   _atom_site_site_symmetry_multiplicity')
    123123
    124124    varnames = {cx:'Ax',cx+1:'Ay',cx+2:'Az',cx+3:'Afrac',
     
    298298                 '\n   _atom_site_adp_type'+
    299299                 '\n   _atom_site_U_iso_or_equiv'+
    300                  '\n   _atom_site_symmetry_multiplicity')
     300                 '\n   _atom_site_site_symmetry_multiplicity')
    301301
    302302    varnames = {cx:'Ax',cx+1:'Ay',cx+2:'Az',cx+3:'Afrac',
  • trunk/help/gsasII.html

    r4682 r4783  
    65226522  X-ray/CW-neutron refinement of PbSO4 tutorial</a>.
    65236523
    6524 <dt><B>Preferred orientation</B><dd> is treated in one of two
     6524<dt><a name="Preferred_orientation">
     6525  <B>Preferred orientation</B></a>
     6526<dd> is treated in one of two
    65256527  ways. Intensity corrections can be added to the model here or a full
    65266528  texture model is possible with the "texture" tab (which usually
     
    72497251
    72507252<h4 style='margin-left:0.25in'><a name="Texture">Texture </a></h4>
     7253<p class=MsoNormal style='margin-left:.5in'>
     7254This tab is used to control settings used for a texture (pole figure)
     7255study of a material. This type of characterization requires
     7256diffraction data recorded with multiple detector orientations (the
     7257number of orientations will depend on sample and material
     7258symmetry). Do not confuse this with applying a
     7259<a href="#Preferred_orientation">preferred orientation correction</a>
     7260(found in the <a href="#Data">"Data" tab</A>) in a structural study. The sample
     7261orientation relative to the detector axes is specified here and the
     7262detector orientation is specified for each histogram as goniometer
     7263omega, chi, phi and azimuth values. These values must be specified.
     7264</P>
     7265<p class=MsoNormal style='margin-left:.5in'>
     7266Texture is modeled for different types of sample treatment, where grain
     7267orientation can have symmetry: cylindrical, rolling, shear or none
     7268(ordered from highest to lowest).
     7269The number of spherical harmonics coefficients is determined by the
     7270harmonic order and the symmetry setting.
     7271</P>
    72517272
    72527273<h5 style='margin-left:.5in'><span><span
     
    72547275class=MsoHyperlink><span style='color:#4F4FFF;text-decoration:none;text-underline:
    72557276none'><o:p></o:p></span></span></span></span></h5>
     7277<p class=MsoNormal style='margin-left:0.75in'>
     7278The refined texture coefficients can be plotted in different ways:
     7279<UL style='margin-left:1.0in'>
     7280  <LI>
     7281as an "Axial pole
     7282distribution" which simulates the intensity of a reflection during a
     7283  phi scan.
     7284  <LI>as a "pole figure" or "inverse pole figure"
     7285  which shows the intensity of a reflection as
     7286  a function of sample orientation
     7287  <LI>as a "3D pole distribution" that shows the probability of
     7288  finding a crystallite with a given orientation.
     7289</UL>
     7290</P> 
     7291
     7292
    72567293
    72577294<h4 style='margin-left:0.25in'><a name="Map_peaks">Map peaks</a></h4>
     
    75037540<hr size=2 width="100%" align=center>
    75047541
    7505 <!-- hhmts start -->Last modified: Thu Dec 10 19:31:56 CST 2020 <!-- hhmts end -->
     7542<!-- hhmts start -->Last modified: Tue Jan 26 12:36:18 CST 2021 <!-- hhmts end -->
    75067543
    75077544</div>
Note: See TracChangeset for help on using the changeset viewer.