Changeset 367


Ignore:
Timestamp:
Sep 8, 2011 3:27:13 PM (12 years ago)
Author:
vondreele
Message:

make Factor lower limit 0.00001

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r365 r367  
    540540    def OnFactor(event):
    541541        try:
    542             value = min(max(float(Factr.GetValue()),0.001),100.)
     542            value = min(max(float(Factr.GetValue()),0.00001),100.)
    543543        except ValueError:
    544544            value = 1.0
    545545        data['shift factor'] = value
    546         Factr.SetValue('%.3f'%(value))
     546        Factr.SetValue('%.5f'%(value))
    547547       
    548548    if self.dataDisplay:
     
    571571    LSSizer.Add(Cnvrg,0,wx.ALIGN_CENTER_VERTICAL)
    572572    LSSizer.Add(wx.StaticText(self.dataDisplay,label=' Initial shift factor: '),0,wx.ALIGN_CENTER_VERTICAL)
    573     Factr = wx.TextCtrl(self.dataDisplay,-1,value='%.3f'%(data['shift factor']),style=wx.TE_PROCESS_ENTER)
     573    Factr = wx.TextCtrl(self.dataDisplay,-1,value='%.5f'%(data['shift factor']),style=wx.TE_PROCESS_ENTER)
    574574    Factr.Bind(wx.EVT_TEXT_ENTER,OnFactor)
    575575    Factr.Bind(wx.EVT_KILL_FOCUS,OnFactor)
  • trunk/GSASIIphsGUI.py

    r365 r367  
    26472647            PawleyPeaks = data['Pawley ref']                       
    26482648            rowLabels = []
    2649             for i in range(len(PawleyPeaks)): rowLabels.append(str(i+1))
     2649            for i in range(len(PawleyPeaks)): rowLabels.append(str(i))
    26502650            colLabels = ['h','k','l','mul','d','refine','Fsq(hkl)','sig(Fsq)']
    26512651            Types = 4*[wg.GRID_VALUE_LONG,]+[wg.GRID_VALUE_FLOAT+':10,4',wg.GRID_VALUE_BOOL,]+ \
     
    26712671                ext,mul = G2spc.GenHKLf([h,k,l],SGData)[:2]
    26722672                if not ext:
    2673                     PawleyPeaks.append([h,k,l,mul,d,False,1000.0,1.0])
     2673                    PawleyPeaks.append([h,k,l,mul,d,False,100.0,1.0])
    26742674        finally:
    26752675            wx.EndBusyCursor()
  • trunk/GSASIIpwdGUI.py

    r353 r367  
    12711271    for h,k,l,m,d,pos,sig,gam,fo,fc,x in data[self.RefList]:
    12721272        refList.append([h,k,l,m,d,pos,sig,gam,fo,fc])
    1273     for i in range(len(refList)): rowLabels.append(str(i+1))
     1273    for i in range(len(refList)): rowLabels.append(str(i))
    12741274    colLabels = ['H','K','L','mul','d','pos','sig','gam','Fosq','Fcsq',]
    12751275    Types = 4*[wg.GRID_VALUE_LONG,]+4*[wg.GRID_VALUE_FLOAT+':10,4',]+2*[wg.GRID_VALUE_FLOAT+':10,2',]
     
    12781278    self.dataDisplay = G2gd.GSGrid(parent=self.dataFrame)
    12791279    self.dataDisplay.SetTable(self.PeakTable, True)
     1280    self.dataDisplay.EnableEditing(False)
    12801281    self.dataDisplay.SetMargins(0,0)
    12811282    self.dataDisplay.AutoSizeColumns(False)
  • trunk/GSASIIstruct.py

    r366 r367  
    727727                'Size':[[0,0],[0 for i in range(len(hapData['Size'][4]))]]}                 
    728728            for item in ['Mustrain','Size']:
    729                 if hapData[item][0] in ['isotropic','uniaxial']:
     729                if hapData[item][0] in ['isotropic','uniaxial']:                   
    730730                    hapData[item][1][0] = parmDict[pfx+item+':0']
     731                    if item == 'Size':
     732                        hapData[item][1][0] = min(10.,max(0.01,hapData[item][1][0]))
    731733                    if hapData[item][2][0]:
    732734                        SizeMuStrSig[item][0][0] = sigDict[pfx+item+':0']
    733735                    if hapData[item][0] == 'uniaxial':
    734736                        hapData[item][1][1] = parmDict[pfx+item+':1']
     737                        if item == 'Size':
     738                            hapData[item][1][1] = min(10.,max(0.01,hapData[item][1][1]))                       
    735739                        if hapData[item][2][1]:
    736740                            SizeMuStrSig[item][0][1] = sigDict[pfx+item+':1']
     
    10741078    def GetSampleGam(refl,wave,G,phfx,calcControls,parmDict,sizeEllipse):
    10751079        costh = cosd(refl[5]/2.)
     1080        #crystallite size
    10761081        if calcControls[phfx+'SizeType'] == 'isotropic':
    10771082            gam = 1.8*wave/(np.pi*parmDict[phfx+'Size:0']*costh)
     
    10801085            P = np.array(calcControls[phfx+'SizeAxis'])
    10811086            cosP,sinP = G2lat.CosSinAngle(H,P,G)
    1082             gam = (1.8*wave/np.pi)/parmDict[phfx+'Size:0']*parmDict[phfx+'Size:1']
    1083             gam *= np.sqrt((cosP*parmDict[phfx+'Size:1'])**2+(sinP*parmDict[phfx+'Size:0'])**2)/costh
     1087            gam = (1.8*wave/np.pi)/(parmDict[phfx+'Size:0']*parmDict[phfx+'Size:1']*costh)
     1088            gam *= np.sqrt((cosP*parmDict[phfx+'Size:1'])**2+(sinP*parmDict[phfx+'Size:0'])**2)
    10841089        else:           #ellipsoidal crystallites - wrong not make sense
    10851090            H = np.array(refl[:3])
    1086             gam += 1.8*wave/(np.pi*costh*np.inner(H,np.inner(sizeEllipse,H)))           
     1091            gam += 1.8*wave/(np.pi*costh*np.inner(H,np.inner(sizeEllipse,H)))
     1092        #microstrain               
    10871093        if calcControls[phfx+'MustrainType'] == 'isotropic':
    10881094            gam += 0.018*parmDict[phfx+'Mustrain:0']*tand(refl[5]/2.)/np.pi
     
    11911197                    iBeg = np.searchsorted(x,pos2-fmin)
    11921198                    iFin = np.searchsorted(x,pos2+fmax)
     1199                    if not iBeg+iFin:       #peak below low limit - skip peak
     1200                        continue
     1201                    elif not iBeg-iFin:     #peak above high limit - done
     1202                        return yc,yb
    11931203                    yc[iBeg:iFin] += Icorr*refl[8]*kRatio*G2pwd.getFCJVoigt3(pos2,refl[6],refl[7],shl,x[iBeg:iFin])        #and here
    11941204            else:
     
    12021212        costh = cosd(refl[5]/2.)
    12031213        tanth = tand(refl[5]/2.)
     1214        #crystallite size derivatives
    12041215        if calcControls[phfx+'SizeType'] == 'isotropic':
    1205             gam = 180.*wave/(np.pi*parmDict[phfx+'Size:0']*costh)
    1206             gamDict[phfx+'Size:0'] = gam/parmDict[phfx+'Size:0']
     1216            gamDict[phfx+'Size:0'] = 1.80*wave/(np.pi*costh)
    12071217        elif calcControls[phfx+'SizeType'] == 'uniaxial':
    12081218            H = np.array(refl[:3])
     
    12151225            gam = gami*sqtrm/costh           
    12161226            gamDict[phfx+'Size:0'] = gami*Si*sinP**2/(sqtrm*costh)-gam/Si
    1217             gamDict[phfx+'Size:1'] = gam/Sa-gami*Sa*cosP**2/(sqtrm*costh)         
     1227            gamDict[phfx+'Size:1'] = gami*Sa*cosP**2/(sqtrm*costh)-gam/Sa         
    12181228        else:           #ellipsoidal crystallites - do numerically? - not right not make sense
    12191229            H = np.array(refl[:3])
    12201230            gam = 1.8*wave/(np.pi*costh*np.inner(H,np.inner(sizeEllipse,H)))
    1221                        
     1231        #microstrain derivatives               
    12221232        if calcControls[phfx+'MustrainType'] == 'isotropic':
    12231233            gamDict[phfx+'Mustrain:0'] =  0.018*tanth/np.pi           
Note: See TracChangeset for help on using the changeset viewer.