Changeset 3095


Ignore:
Timestamp:
Sep 21, 2017 2:42:50 PM (4 years ago)
Author:
vondreele
Message:

add new confit parm: Show_timing
enable editing of the Use column in seq results table; doesn't seem to affect plot tho.
always print Found SVD zeros in seq refinement as well
add local directory to path for finding fit equation functions
add a pretranslate vector to atom transformations - still needs work tho.
couple of TODOs in G2strMain for fix parameters in seq refinements
change 'debug' to 'Show_timing' in G2strMath

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3092 r3095  
    67436743        else:
    67446744            dlg.Destroy()
    6745    
    6746     #def GridRowLblToolTip(row): return 'Row ='+str(row)
     6745           
     6746    def OnCellChange(event):
     6747        r = event.GetRow()
     6748        val = G2frame.SeqTable.GetValue(r,0)
     6749        print r,val
     6750        G2frame.SeqTable.SetValue(r,0, val)
    67476751   
    67486752    # lookup table for unique cell parameters by symmetry
     
    71877191        colLabels=displayLabels,rowLabels=histNames,types=Types)
    71887192    G2frame.dataDisplay.SetTable(G2frame.SeqTable, True)
    7189     G2frame.dataDisplay.EnableEditing(False)
    7190     # make all read-only
    7191 #    for c in range(len(colLabels)):
    7192 #        for r in range(nRows):
    7193 #            G2frame.dataDisplay.SetCellReadOnly(r,c)
     7193    # make all Use editable all others ReadOnly
     7194    for c in range(len(colLabels)):
     7195        for r in range(nRows):
     7196            if c:
     7197                G2frame.dataDisplay.SetReadOnly(r,c,isReadOnly=True)
     7198            else:
     7199                G2frame.dataDisplay.SetReadOnly(r,c,isReadOnly=False)
     7200    G2frame.dataDisplay.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    71947201    G2frame.dataDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK, PlotSSelect)
    71957202    G2frame.dataDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_DCLICK, PlotSelect)
  • trunk/GSASIImath.py

    r3079 r3095  
    218218    try:
    219219        Bmat,Nzero = pinv(Amatlam,xtol)    #Moore-Penrose inversion (via SVD) & count of zeros
    220         if Print:
    221             print 'Found %d SVD zeros'%(Nzero)
     220#        if Print:
     221        print 'Found %d SVD zeros'%(Nzero)
    222222#        Bmat = nl.inv(Amatlam); Nzeros = 0
    223223        Bmat = Bmat/Anorm
  • trunk/GSASIIobj.py

    r3062 r3095  
    24172417            # includes a package, lets try to load the packages
    24182418            pkgname = ''
    2419             path = sys.path
     2419            path = sys.path+['./',]
    24202420            for pkg in f.split('.')[:-1]: # if needed, descend down the tree
    24212421                if pkgname:
  • trunk/GSASIIphsGUI.py

    r3092 r3095  
    331331################################################################################
    332332class TransformDialog(wx.Dialog):
    333     ''' Phase transformation
     333    ''' Phase transformation X' = M*(X-U)+V
    334334   
    335335    :param wx.Frame parent: reference to parent frame (or None)
     
    349349#        else:
    350350        self.Trans = np.eye(3)
    351         self.Vec = np.zeros(3)
     351        self.Uvec = np.zeros(3)
     352        self.Vvec = np.zeros(3)
    352353        self.oldSpGrp = phase['General']['SGData']['SpGrp']
    353354        self.oldSGdata = phase['General']['SGData']
     
    440441        MatSizer = wx.BoxSizer(wx.HORIZONTAL)
    441442        transSizer = wx.BoxSizer(wx.VERTICAL)
    442         transSizer.Add(wx.StaticText(self.panel,label=" XYZ Transformation matrix & vector: M*X+V = X'"))
     443        transSizer.Add(wx.StaticText(self.panel,label=" XYZ Transformation matrix & vectors: M*(X-U)+V = X'"))
    443444#        if self.Super:
    444445#            Trmat = wx.FlexGridSizer(4,4,0,0)
     
    455456        commonSizer.Add(common,0,WACV)
    456457        transSizer.Add(commonSizer)
    457         Trmat = wx.FlexGridSizer(3,5,0,0)
     458        Trmat = wx.FlexGridSizer(3,6,0,0)
    458459        for iy,line in enumerate(self.Trans):
    459460            for ix,val in enumerate(line):
     
    461462                Trmat.Add(item)
    462463            Trmat.Add((25,0),0)
    463             vec = G2G.ValidatedTxtCtrl(self.panel,self.Vec,iy,nDig=(10,3),size=(65,25))
     464            vec = G2G.ValidatedTxtCtrl(self.panel,self.Uvec,iy,nDig=(10,3),size=(65,25))
     465            Trmat.Add(vec)
     466            vec = G2G.ValidatedTxtCtrl(self.panel,self.Vvec,iy,nDig=(10,3),size=(65,25))
    464467            Trmat.Add(vec)
    465468        transSizer.Add(Trmat)
     
    525528            self.Phase['General']['Name'] += ' %s'%(self.Common)
    526529        self.Phase['General']['Cell'][1:] = G2lat.TransformCell(self.oldCell[:6],self.Trans)           
    527         return self.Phase,self.Trans,self.Vec,self.ifMag,self.ifConstr,self.Common
     530        return self.Phase,self.Trans,self.Uvec,self.Vvec,self.ifMag,self.ifConstr,self.Common
    528531
    529532    def OnOk(self,event):
     
    21762179        try:
    21772180            if dlg.ShowModal() == wx.ID_OK:
    2178                 newPhase,Trans,Vec,ifMag,ifConstr,Common = dlg.GetSelection()
     2181                newPhase,Trans,Uvec,Vvec,ifMag,ifConstr,Common = dlg.GetSelection()
    21792182            else:
    21802183                return
     
    21892192            for atom in Atoms:
    21902193                for i in range(3):
    2191                     atom[cx+i] += Vec[i]
     2194                    atom[cx+i] -= Uvec[i]
    21922195                atom[cs:cs+2] = G2spc.SytSym(atom[cx:cx+3],SGData)[:2]
    21932196            data['Drawing'] = []
    21942197        else:
    21952198            phaseName = newPhase['General']['Name']
    2196             newPhase,atCodes = G2lat.TransformPhase(data,newPhase,Trans,Vec,ifMag)
     2199            newPhase,atCodes = G2lat.TransformPhase(data,newPhase,Trans,Vvec,ifMag)
    21972200            detTrans = np.abs(nl.det(Trans))
    21982201   
  • trunk/GSASIIstrMain.py

    r3068 r3095  
    261261    '''
    262262    Removes unused parameters from phase varylist if phase not in histogram
     263    #TODO - implement "Fix F,X,U" for seq refinement here
    263264    '''
    264265    pIds = []
     
    333334            print("Error: not found!")
    334335            continue
     336    #TODO - implement "Fix F,X,U" for seq refinement here
     337        Histo = {histogram:Histograms[histogram],}
    335338        redphaseVary = phaseCheck(phaseVary,Phases,histogram)
    336         Histo = {histogram:Histograms[histogram],}
    337339        hapVary,hapDict,controlDict = G2stIO.GetHistogramPhaseData(Phases,Histo,Print=False)
    338340        calcControls.update(controlDict)
  • trunk/GSASIIstrMath.py

    r3093 r3095  
    29292929    Multiprocessing support added
    29302930    '''
    2931     if GSASIIpath.GetConfigValue('debug'):
     2931    if GSASIIpath.GetConfigValue('Show_timing',False):
    29322932        starttime = time.time() #; print 'start GetFobsSq'
    29332933    histoList = Histograms.keys()
     
    30603060            Histogram = Histograms[histogram]
    30613061            Histogram['Residuals']['hId'] = Histograms[histogram]['hId']
    3062     if GSASIIpath.GetConfigValue('debug'):
     3062    if GSASIIpath.GetConfigValue('Show_timing',False):
    30633063        print 'GetFobsSq t=',time.time()-starttime
    30643064               
    30653065def getPowderProfile(parmDict,x,varylist,Histogram,Phases,calcControls,pawleyLookup):
    30663066    'Computes the powder pattern for a histogram based on contributions from all used phases'
    3067     if GSASIIpath.GetConfigValue('debug'): starttime = time.time()
     3067    if GSASIIpath.GetConfigValue('Show_timing',False): starttime = time.time()
    30683068   
    30693069    def GetReflSigGamCW(refl,im,wave,G,GB,phfx,calcControls,parmDict):
     
    32483248    if badPeak:
    32493249        print 'ouch #4 bad profile coefficients yield negative peak width; some reflections skipped'
    3250     if GSASIIpath.GetConfigValue('debug'):
     3250    if GSASIIpath.GetConfigValue('Show_timing',False):
    32513251        print 'getPowderProfile t=',time.time()-starttime
    32523252    return yc,yb
     
    41324132            xF = np.searchsorted(x,Limits[1])+1
    41334133            useMP,ncores = G2mp.InitMP()
    4134             if GSASIIpath.GetConfigValue('debug'): starttime = time.time()
     4134            if GSASIIpath.GetConfigValue('Show_timing',False): starttime = time.time()
    41354135            if useMP:
    41364136                MPpool = mp.Pool(ncores)
     
    41534153                #    varylist,Histogram,Phases,rigidbodyDict,calcControls,pawleyLookup,dependentVars)
    41544154            G2mv.Dict2Deriv(varylist,depDerivDict,dMdvh)
    4155             if GSASIIpath.GetConfigValue('debug'): print 'getPowderProfileDerv t=',time.time()-starttime
     4155            if GSASIIpath.GetConfigValue('Show_timing',False): print 'getPowderProfileDerv t=',time.time()-starttime
    41564156            Wt = ma.sqrt(W[xB:xF])[nxs,:]
    41574157            Dy = dy[xB:xF][nxs,:]
  • trunk/config_example.py

    r3051 r3095  
    160160computations are performed in-line.
    161161'''
     162
     163Show_timing = False
     164'''If True, shows various timing results.'''
Note: See TracChangeset for help on using the changeset viewer.