Changeset 2651


Ignore:
Timestamp:
Jan 20, 2017 4:21:28 PM (5 years ago)
Author:
vondreele
Message:

in peakfit add binsperFWHM calc for dach peak fit with warnings if too small

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrls.py

    r2647 r2651  
    13811381        if toggle:
    13821382            tSizer = wx.FlexGridSizer(cols=2,hgap=5,vgap=5)
    1383             tSizer.Add(wx.StaticText(self,label=' Set Stride:'),0,WACV)
     1383            tSizer.Add(wx.StaticText(self,label=' Apply stride:'),0,WACV)
    13841384            numbs = [str(i+1) for i in range(9)]+[str(2*i+10) for i in range(6)]
    13851385            self.stride = wx.ComboBox(self,value='1',choices=numbs,style=wx.CB_READONLY|wx.CB_DROPDOWN)
  • trunk/GSASIIpwd.py

    r2630 r2651  
    16401640                        peak[2*j] = G2mth.getTOFgamma(parmDict,dsp)
    16411641                       
    1642     def PeaksPrint(dataType,parmDict,sigDict,varyList):
     1642    def PeaksPrint(dataType,parmDict,sigDict,varyList,ptsperFW):
    16431643        print 'Peak coefficients:'
    16441644        if 'C' in dataType:
     
    16521652            else:
    16531653                head += name.center(10)+'esd'.center(10)
     1654        head += 'bins'.center(8)
    16541655        print head
    16551656        if 'C' in dataType:
     
    16701671                    else:
    16711672                        ptstr += 10*' '
     1673            ptstr += '%9.2f'%(ptsperFW[i])
    16721674            print '%s'%(('Peak'+str(i+1)).center(8)),ptstr
    16731675               
     
    16961698    yb *= 0.
    16971699    yd *= 0.
     1700    cw = x[1:]-x[:-1]
    16981701    xBeg = np.searchsorted(x,Limits[0])
    16991702    xFin = np.searchsorted(x,Limits[1])
     
    17561759    GetInstParms(parmDict,Inst,varyList,Peaks)
    17571760    if insVary: InstPrint(Inst,sigDict)
    1758     GetPeaksParms(Inst,parmDict,Peaks,varyList)   
    1759     if peakVary: PeaksPrint(dataType,parmDict,sigDict,varyList)
     1761    GetPeaksParms(Inst,parmDict,Peaks,varyList)
     1762    binsperFWHM = []
     1763    for peak in Peaks:
     1764        FWHM = getFWHM(peak[0],Inst)
     1765        try:
     1766            binsperFWHM.append(FWHM/cw[x.searchsorted(peak[0])])
     1767        except IndexError:
     1768            binsperFWHM.append(0.)
     1769    if peakVary: PeaksPrint(dataType,parmDict,sigDict,varyList,binsperFWHM)
     1770    if min(binsperFWHM) < 3.:
     1771        print '*** Warning: calculated peak widths are too narrow to refine profile coefficients ***'
     1772        if 'T' in Inst['Type'][0]:
     1773            print ' Manually increase sig-0, 1, or 2 in Instrument Parameters'
     1774        else:
     1775            print ' Manually increase W in Instrument Parameters'
    17601776    return sigDict,result,sig,Rvals,varyList,parmDict,fullvaryList,badVary
    17611777
Note: See TracChangeset for help on using the changeset viewer.