Changeset 4521


Ignore:
Timestamp:
Jul 15, 2020 3:08:04 PM (15 months ago)
Author:
vondreele
Message:

complete pink Rietveld refinement
fix problem with weights
enhance testDeriv
put new pink parms in parm dictionary
fix problem with Instrument parm display after load

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImpsubs.py

    r4520 r4521  
    180180    yp = np.zeros(len(x)) # not masked
    181181    refl8im = 0
    182     Wd,fmin,fmax = G2pwd.getWidthsTOF(refl[5+im],refl[12+im],refl[13+im],refl[6+im]/100.,refl[7+im]/1.e4)
     182    Wd,fmin,fmax = G2pwd.getWidthsTOF(refl[5+im],refl[12+im],refl[13+im],refl[6+im]/1.e4,refl[7+im]/100.)
    183183    iBeg = max(xB,np.searchsorted(x,refl[5+im]-fmin))
    184184    iFin = max(xB,min(np.searchsorted(x,refl[5+im]+fmax),xF))
  • trunk/GSASIIobj.py

    r4413 r4521  
    18031803        'WgtFrac':'phase weight fraction',
    18041804        'alpha':'TOF profile term',
    1805         'beta-[01q]':'TOF profile term',
     1805        'alpha-[01]':'Pink profile term',
     1806        'beta-[01q]':'TOF/Pink profile term',
    18061807        'sig-[012q]':'TOF profile term',
    18071808        'dif[ABC]':'TOF to d-space calibration',
  • trunk/GSASIIpwdGUI.py

    r4520 r4521  
    19541954                    G2frame.GPXtree.SetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId,'Instrument Parameters'),[data,Inst2])
    19551955                    RefreshInstrumentGrid(event,doAnyway=True)          #to get peaks updated
     1956                    UpdateInstrumentGrid(G2frame,data)
    19561957                else:
    19571958                    G2frame.ErrorDialog('No match','Bank %d not in %s'%(bank,filename),G2frame)
  • trunk/GSASIIstrMath.py

    r4520 r4521  
    33393339#                        print ' ***Error %d,%d,%d missing from Pawley reflection list ***'%(h,k,l)
    33403340                        continue
    3341                 Wd,fmin,fmax = G2pwd.getWidthsTOF(refl[5+im],refl[12+im],refl[13+im],refl[6+im]/100.,refl[7+im]/1.e4)
     3341                Wd,fmin,fmax = G2pwd.getWidthsTOF(refl[5+im],refl[12+im],refl[13+im],refl[6+im]/1.e4,refl[7+im]/100.)
    33423342                iBeg = np.searchsorted(x,refl[5+im]-fmin)
    33433343                iFin = np.searchsorted(x,refl[5+im]+fmax)
     
    35573557                Wd,fmin,fmax = G2pwd.getWidthsTOF(refl[5+im],refl[12+im],refl[13+im],refl[6+im],refl[7+im])
    35583558            elif 'B' in calcControls[hfx+'histType']:
    3559                 Wd,fmin,fmax = G2pwd.getWidthsTOF(refl[5+im],refl[12+im]/100.,refl[13+im]/1.e4,refl[6+im],refl[7+im])
     3559                Wd,fmin,fmax = G2pwd.getWidthsTOF(refl[5+im],refl[12+im],refl[13+im],refl[6+im]/1.e4,refl[7+im]/100.)
    35603560            iBeg = np.searchsorted(x,refl[5+im]-fmin)
    35613561            iFin = np.searchsorted(x,refl[5+im]+fmax)
     
    35933593                dMdipk = G2pwd.getdEpsVoigt(refl[5+im],refl[12+im],refl[13+im],refl[6+im],refl[7+im],ma.getdata(x[iBeg:iFin]))
    35943594                for i in range(6):
    3595                     dMdpk[i] += refl[11+im]*refl[9+im]*dMdipk[i]      #cw[iBeg:iFin]*
     3595                    dMdpk[i] += refl[11+im]*refl[9+im]*dMdipk[i]
    35963596                dervDict = {'int':dMdpk[0],'pos':dMdpk[1],'alp':dMdpk[2],'bet':dMdpk[3],'sig':dMdpk[4],'gam':dMdpk[5]}           
    35973597            elif 'B' in calcControls[hfx+'histType']:
     
    36023602                    break
    36033603                dMdpk = np.zeros(shape=(6,lenBF))
    3604                 dMdipk = G2pwd.getdEpsVoigt(refl[5+im],refl[12+im],refl[13+im],refl[6+im]/100.,refl[7+im]/1.e4,ma.getdata(x[iBeg:iFin]))
     3604                dMdipk = G2pwd.getdEpsVoigt(refl[5+im],refl[12+im],refl[13+im],refl[6+im]/1.e4,refl[7+im]/100.,ma.getdata(x[iBeg:iFin]))
    36053605                for i in range(6):
    3606                     dMdpk[i] += refl[11+im]*refl[9+im]*dMdipk[i]
    3607                 dervDict = {'int':dMdpk[0],'pos':dMdpk[1],'alp':dMdpk[2],'bet':dMdpk[3],'sig':dMdpk[4],'gam':dMdpk[5]}           
     3606                    dMdpk[i] = cw[iBeg:iFin]*refl[11+im]*refl[9+im]*dMdipk[i]
     3607                dervDict = {'int':dMdpk[0],'pos':dMdpk[1],'alp':dMdpk[2],'bet':dMdpk[3],'sig':dMdpk[4]/1.e4,'gam':dMdpk[5]/100.}           
    36083608            if Phase['General'].get('doPawley'):
    36093609                dMdpw = np.zeros(len(x))
     
    41074107            wdy = -ma.sqrt(w[xB:xF])*(yd[xB:xF])
    41084108            Histogram['Residuals']['Durbin-Watson'] = ma.sum(ma.diff(wdy)**2)/ma.sum(wdy**2)
    4109             wdy *= wtFactor
     4109            wdy *= np.sqrt(wtFactor)
    41104110            Histogram['Residuals']['Nobs'] = ma.count(x[xB:xF])
    41114111            Nobs += Histogram['Residuals']['Nobs']
  • trunk/testDeriv.py

    r4213 r4521  
    5252    return testDeriv(parent)
    5353   
    54 [wxID_FILEEXIT, wxID_FILEOPEN, wxID_MAKEPLOTS, wxID_CLEARSEL,
    55 ] = [wx.NewId() for _init_coll_File_Items in range(4)]
     54[wxID_FILEEXIT, wxID_FILEOPEN, wxID_MAKEPLOTS, wxID_CLEARSEL,wxID_SELECTALL,
     55] = [wx.NewId() for _init_coll_File_Items in range(5)]
    5656
    5757def FileDlgFixExt(dlg,file):            #this is needed to fix a problem in linux wx.FileDialog
     
    7070        self.File.Append(wxID_FILEOPEN,'Open testDeriv file','Open testDeriv')
    7171        self.File.Append(wxID_MAKEPLOTS,'Make plots','Make derivative plots')
     72        self.File.Append(wxID_SELECTALL,'Select all')
    7273        self.File.Append(wxID_CLEARSEL,'Clear selections')
    7374        self.File.Append(wxID_FILEEXIT,'Exit','Exit from testDeriv')
     
    7576        self.Bind(wx.EVT_MENU,self.OnMakePlots,id=wxID_MAKEPLOTS)
    7677        self.Bind(wx.EVT_MENU,self.ClearSelect,id=wxID_CLEARSEL)
     78        self.Bind(wx.EVT_MENU,self.SelectAll,id=wxID_SELECTALL)
    7779        self.Bind(wx.EVT_MENU,self.OnFileExit, id=wxID_FILEEXIT)
    7880        self.testDerivMenu.Append(menu=self.File, title='File')
     
    106108        self.Close()
    107109       
     110    def SelectAll(self,event):
     111        self.use = [True for name in self.names]
     112        for i,name in enumerate(self.names):
     113            if 'Back' in name:
     114                self.use[i] = False
     115        self.UpdateControls(event)
     116       
    108117    def ClearSelect(self,event):
    109118        self.use = [False for i in range(len(self.names))]
     
    126135    def TestRead(self):
    127136        file = open(self.testFile,'rb')
    128         if '2' in platform.python_version_tuple()[0]:
    129             self.values = cPickle.load(file)
    130             self.HistoPhases = cPickle.load(file)
    131             (self.constrDict,self.fixedList,self.depVarList) = cPickle.load(file)
    132             self.parmDict = cPickle.load(file)
    133             self.varylist = cPickle.load(file)
    134             self.calcControls = cPickle.load(file)
    135             self.pawleyLookup = cPickle.load(file)
    136         else:
    137             self.values = cPickle.load(file,encoding='Latin-1')
    138             self.HistoPhases = cPickle.load(file,encoding='Latin-1')
    139             (self.constrDict,self.fixedList,self.depVarList) = cPickle.load(file,encoding='Latin-1')
    140             self.parmDict = cPickle.load(file,encoding='Latin-1')
    141             self.varylist = cPickle.load(file,encoding='Latin-1')
    142             self.calcControls = cPickle.load(file,encoding='Latin-1')
    143             self.pawleyLookup = cPickle.load(file,encoding='Latin-1')
     137        self.values = cPickle.load(file,encoding='Latin-1')
     138        self.HistoPhases = cPickle.load(file,encoding='Latin-1')
     139        (self.constrDict,self.fixedList,self.depVarList) = cPickle.load(file,encoding='Latin-1')
     140        self.parmDict = cPickle.load(file,encoding='Latin-1')
     141        self.varylist = cPickle.load(file,encoding='Latin-1')
     142        self.calcControls = cPickle.load(file,encoding='Latin-1')
     143        self.pawleyLookup = cPickle.load(file,encoding='Latin-1')
    144144        self.names = self.varylist+self.depVarList
    145145        self.use = [False for i in range(len(self.names))]
Note: See TracChangeset for help on using the changeset viewer.