Changeset 2491


Ignore:
Timestamp:
Oct 13, 2016 10:34:04 AM (7 years ago)
Author:
vondreele
Message:

fix bug for call to GetPhaseData? in export phase
put in stub for making magnetic phase - nuclear phase constraints
fix problem viewing reflection list with a missing phase - happens if a renamed phase is deleted
fix issues with mag structure factor calcs.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2486 r2491  
    30083008                                    if item in refList:
    30093009                                        del(refList[item])
    3010                             self.PatternTree.SetItemPyData(Id,refList)
     3010#                            self.PatternTree.SetItemPyData(Id,refList)
    30113011                        elif 'HKLF' in name:
    30123012                            data = self.PatternTree.GetItemPyData(item)
    30133013                            data[0] = {}
    3014                             self.PatternTree.SetItemPyData(item,data)
     3014#                            self.PatternTree.SetItemPyData(item,data)
    30153015                           
    30163016                        item, cookie = self.PatternTree.GetNextChild(self.root, cookie)
  • trunk/GSASIIIO.py

    r2486 r2491  
    19871987        self.parmDict.update(rbDict)
    19881988        rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]})
    1989         Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,maxSSwave =  G2stIO.GetPhaseData(
     1989        Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,MFtables,maxSSwave =  G2stIO.GetPhaseData(
    19901990            Phases,RestraintDict=None,rbIds=rbIds,Print=False)
    19911991        self.parmDict.update(phaseDict)
  • trunk/GSASIIconstrGUI.py

    r2489 r2491  
    11681168    elif warnmsg:
    11691169        print 'Unexpected contraint warning:\n',warnmsg
     1170
     1171################################################################################
     1172#### Make nuclear-magnetic phase constraints - called by OnTransform in G2phsGUI
     1173################################################################################       
     1174       
     1175def MagConstraints(G2frame,oldPhase,newPhase,Trans,Vec):
     1176    print 'make nuclear-magnetic phase constraints here'
    11701177       
    11711178################################################################################
  • trunk/GSASIIgrid.py

    r2486 r2491  
    531531        self.Common = 'abc'
    532532        self.ifMag = False
     533        self.ifConstr = True
    533534        self.Draw()
    534535
     
    623624        def OnMag(event):
    624625            self.ifMag = mag.GetValue()
     626           
     627        def OnConstr(event):
     628            self.ifConstr = constr.GetValue()
    625629
    626630        self.panel.Destroy()
     
    686690            mainSizer.Add(wx.StaticText(self.panel, \
    687691                label=' NB: Nonmagnetic atoms will be deleted from new phase'),0,WACV)
     692            constr = wx.CheckBox(self.panel,label=' Make constraints between phases?')
     693            constr.SetValue(self.ifConstr)
     694            constr.Bind(wx.EVT_CHECKBOX,OnConstr)
     695            mainSizer.Add(constr,0,WACV)
    688696
    689697        TestBtn = wx.Button(self.panel,-1,"Test")
     
    710718        self.Phase['General']['Name'] += ' %s'%(self.Common)
    711719        self.Phase['General']['Cell'][1:] = G2lat.TransformCell(self.oldCell[:6],self.Trans)           
    712         return self.Phase,self.Trans,self.Vec,self.ifMag
     720        return self.Phase,self.Trans,self.Vec,self.ifMag,self.ifConstr
    713721
    714722    def OnOk(self,event):
  • trunk/GSASIIphsGUI.py

    r2486 r2491  
    5050import GSASIIobj as G2obj
    5151import GSASIIctrls as G2G
     52import GSASIIconstrGUI as G2cnstG
    5253import atmdata
    5354import numpy as np
     
    13831384        try:
    13841385            if dlg.ShowModal() == wx.ID_OK:
    1385                 newPhase,Trans,Vec,ifMag = dlg.GetSelection()
     1386                newPhase,Trans,Vec,ifMag,ifConstr = dlg.GetSelection()
    13861387            else:
    13871388                return
     
    14051406            G2gd.GetPatternTreeItemId(G2frame,G2frame.root,'Phases'),text=phaseName)
    14061407        G2frame.PatternTree.SetItemPyData(sub,newPhase)
     1408        if ifMag and ifConstr:
     1409            G2cnstG.MagConstraints(G2frame,data,newPhase,Trans,Vec)     #data is old phase
    14071410        G2gd.MovePatternTreeToGrid(G2frame,sub) #bring up new phase General tab
    14081411        # if nuc - mag transformtion: make constraints here? Needed for Type 4 magnetics
  • trunk/GSASIIpwdGUI.py

    r2431 r2491  
    33963396            pId = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,'Phases')
    33973397            phaseId =  G2gd.GetPatternTreeItemId(G2frame,pId,phaseName)
     3398            if not phaseId:         #phase deleted
     3399                return None
    33983400            General = G2frame.PatternTree.GetItemPyData(phaseId)['General']
    33993401            Super = General.get('Super',0)
     
    34903492        if G2frame.refTable[phaseName].GetTable() is None:
    34913493            PeakTable = MakeReflectionTable(phaseName)
     3494            if PeakTable == None:
     3495                return
    34923496            G2frame.refTable[phaseName].SetTable(PeakTable, True)
    34933497            G2frame.refTable[phaseName].EnableEditing(False)
  • trunk/GSASIIstrMath.py

    r2486 r2491  
    694694        if SGData['SGInv']:
    695695            Gdata = np.hstack((Gdata,-Gdata))       #inversion if any
    696             Nops *= 2
    697696        Gdata = np.repeat(Gdata,Ncen,axis=1)        #dup over cell centering
    698697        Gdata = SGData['MagMom'][nxs,:,nxs]*Gdata   #flip vectors according to spin flip
     
    769768        if 'N' in calcControls[hfx+'histType'] and parmDict[pfx+'isMag']:
    770769            MF = refDict['FF']['MF'][iBeg:iFin].T[Tindx].T   #Nref,Natm
    771 #            TMcorr = 0.5*0.539*Tcorr[:,0,:]*MF*len(SGMT)/Mdata     #Nref,Natm
    772             TMcorr = 0.539*Tcorr[:,0,:]*MF/Nops     #Nref,Natm
     770            TMcorr = 0.5*0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Mdata*MF/(Nops*Ncen)     #Nref,Natm
    773771            if SGData['SGInv']:
    774772                mphase = np.hstack((phase,-phase))
     773                TMcorr = TMcorr/2.
    775774            else:
    776775                mphase = phase
Note: See TracChangeset for help on using the changeset viewer.