Changeset 2492
- Timestamp:
- Oct 15, 2016 11:20:33 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIElem.py
r2486 r2492 213 213 else: 214 214 AtomInfo['Isotopes'][isotope.split('_')[1]] = data 215 AtomInfo['Lande g'] = 2.0 215 216 return AtomInfo 216 217 -
trunk/GSASIIphsGUI.py
r2491 r2492 249 249 if generalData['Type'] == 'magnetic' and not 'Lande g' in generalData: 250 250 generalData['MagDmin'] = 1.0 251 generalData['Lande g'] = len(atomData)*[None,]251 generalData['Lande g'] = [] 252 252 generalData['Mydir'] = G2frame.dirname 253 253 badList = {} … … 286 286 if generalData['Type'] == 'magnetic': 287 287 generalData['MagDmin'] = generalData.get('MagDmin',1.0) 288 try: 289 if atom[ct] in atmdata.MagFF and not generalData['Lande g'][iat]: 290 generalData['Lande g'][iat] = 2.0 291 except IndexError: 292 generalData['Lande g'].append(2.0) 288 if not atom[ct] in generalData['AtomTypes']: 289 generalData['Lande g'].append(2.0) 293 290 if badList: 294 291 msg = 'Warning: element symbol(s) not found:' … … 740 737 if generalData['Type'] == 'magnetic': 741 738 elemSizer.Add(wx.StaticText(General,label=' Lande g factor: '),0,WACV) 742 for ig,gfac in enumerate(generalData['Lande g']): 739 for ig,elem in enumerate(generalData['AtomTypes']): 740 gfac = generalData['Lande g'][ig] 743 741 if gfac == None: 744 742 elemSizer.Add((5,0),) -
trunk/GSASIIpwdGUI.py
r2491 r2492 3476 3476 3477 3477 3478 if not len(data[phaseName]): 3479 return #deleted phase? 3478 3480 G2frame.RefList = phaseName 3479 3481 G2frame.dataFrame.SetLabel('Reflection List for '+phaseName) … … 3492 3494 if G2frame.refTable[phaseName].GetTable() is None: 3493 3495 PeakTable = MakeReflectionTable(phaseName) 3494 if PeakTable == None:3495 return3496 3496 G2frame.refTable[phaseName].SetTable(PeakTable, True) 3497 3497 G2frame.refTable[phaseName].EnableEditing(False) … … 3564 3564 G2frame.refTable = {} 3565 3565 for tabnum,phase in enumerate(phases): 3566 G2frame.refTable[phase] = G2G.GSGrid(parent=G2frame.dataDisplay) 3567 G2frame.dataDisplay.AddPage(G2frame.refTable[phase],phase) 3566 if len(data[phase]): 3567 G2frame.refTable[phase] = G2G.GSGrid(parent=G2frame.dataDisplay) 3568 G2frame.dataDisplay.AddPage(G2frame.refTable[phase],phase) 3569 else: #cleanup deleted phase reflection lists 3570 del data[phase] 3571 if len(data): 3572 G2frame.RefList = data.keys()[0] 3573 phaseName = G2frame.RefList 3574 else: 3575 G2frame.RefList = '' 3576 phaseName = '' 3568 3577 # if phaseName not in G2frame.refTable: 3569 3578 # print phaseName 3570 3579 # print phases 3571 3580 # raise Exception("how did we get a invalid phase name?") 3572 ShowReflTable(phaseName) 3581 if phaseName: 3582 ShowReflTable(phaseName) 3573 3583 # G2frame.refTable[phaseName].Fit() #slow!! 3574 3584 # size = G2frame.refTable[phaseName].GetSize() -
trunk/GSASIIspc.py
r2486 r2492 722 722 return SGData['SpGrp'] 723 723 magSym = SGData['SpGrp'].split() 724 if len(SpnFlp) == 1: #ok724 if SGLaue in ['-1',]: 725 725 SGData['MagPtGp'] = SGLaue 726 if SpnFlp[ -1] == -1:726 if SpnFlp[0] == -1: 727 727 magSym[1] += "'" 728 728 SGData['MagPtGp'] += "'" 729 return ' '.join(magSym) 730 if SGLaue in ['mmm',]: 729 if magSym[0] in ['A','B','C','I'] and SGData['SpGrp'] != 'I 41/a': 730 if SpnFlp[1] < 0: 731 magSym[0] += '(P)' 732 elif SGLaue in ['mmm',]: 731 733 SGData['MagPtGp'] = '' 732 734 for i in [0,1,2]: … … 830 832 Ptsym[i] += "'" 831 833 else: 832 for i in [0,1]:834 for i in range(len(GenSym)): 833 835 if SpnFlp[i] < 0: 834 836 if i and magSym[0] in ['A','B','C','I'] and SGData['SpGrp'] != 'I 41/a': … … 975 977 if incv: 976 978 SpnFlp = np.concatenate((SpnFlp,SpnFlp[:Nsym]*FlpSpn[Nfl+incv-1])) 979 if ' 1bar ' in SGData['GenSym'][0] and FlpSpn[0] < 0: 980 detM[1] = 1. 977 981 MagMom = SpnFlp*np.array(Ncv*detM) 978 982 SGData['MagMom'] = MagMom -
trunk/GSASIIstrMath.py
r2491 r2492 694 694 if SGData['SGInv']: 695 695 Gdata = np.hstack((Gdata,-Gdata)) #inversion if any 696 Gdata = np.repeat(Gdata,Ncen,axis=1) #dup over cell centering 697 Gdata = SGData['MagMom'][nxs,:,nxs]*Gdata #flip vectors according to spin flip 696 Gdata = np.hstack([Gdata for icen in range(Ncen)]) #dup over cell centering 697 # GSASIIpath.IPyBreak() 698 Gdata = SGData['MagMom'][nxs,:,nxs]*Gdata #flip vectors according to spin flip * det(opM) 698 699 Gdata = np.inner(Amat,Gdata.T) #convert back to cart. space MXYZ, Natoms, NOps*Inv*Ncen 699 700 Gdata = np.swapaxes(Gdata,1,2) # put Natoms last 700 # GSASIIpath.IPyBreak()701 701 Mag = np.tile(Mag[:,nxs],len(SGMT)*Ncen).T 702 702 if SGData['SGInv']: 703 Mag = np.repeat(Mag,2,axis=0) #Mag same lengthas Gdata703 Mag = np.repeat(Mag,2,axis=0) #Mag same shape as Gdata 704 704 if 'NC' in calcControls[hfx+'histType']: 705 705 FP,FPP = G2el.BlenResCW(Tdata,BLtables,parmDict[hfx+'Lam']) … … 768 768 if 'N' in calcControls[hfx+'histType'] and parmDict[pfx+'isMag']: 769 769 MF = refDict['FF']['MF'][iBeg:iFin].T[Tindx].T #Nref,Natm 770 TMcorr = 0.5 *0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Mdata*MF/(Nops*Ncen) #Nref,Natm770 TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Mdata*MF/(2*Nops*Ncen) #Nref,Natm 771 771 if SGData['SGInv']: 772 772 mphase = np.hstack((phase,-phase)) … … 774 774 else: 775 775 mphase = phase 776 mphase = np.array([mphase+twopi*np.inner(cen,H)[:,nxs,nxs] for cen in SGData['SGCen']]) 776 # mphase = np.array([mphase+twopi*np.inner(cen,H)[:,nxs,nxs] for cen in SGData['SGCen']]) 777 mphase = np.array([mphase for cen in SGData['SGCen']]) 777 778 mphase = np.concatenate(mphase,axis=1) #Nref,full Nop,Natm 778 779 sinm = np.sin(mphase) #ditto - match magstrfc.for … … 781 782 HM = HM/np.sqrt(np.sum(HM**2,axis=0)) #Gdata = MAGS & HM = UVEC in magstrfc.for both OK 782 783 eDotK = np.sum(HM[:,:,nxs,nxs]*Gdata[:,nxs,:,:],axis=0) 783 Q = -HM[:,:,nxs,nxs]*eDotK[nxs,:,:,:]+Gdata[:,nxs,:,:] #xyz,Nref,Nop,Natm = BPM in magstrfc.for OK784 Q = HM[:,:,nxs,nxs]*eDotK[nxs,:,:,:]-Gdata[:,nxs,:,:] #xyz,Nref,Nop,Natm = BPM in magstrfc.for OK 784 785 fam = Q*TMcorr[nxs,:,nxs,:]*cosm[nxs,:,:,:]*Mag[nxs,nxs,:,:] #ditto 785 786 fbm = Q*TMcorr[nxs,:,nxs,:]*sinm[nxs,:,:,:]*Mag[nxs,nxs,:,:] #ditto … … 1064 1065 if SGData['SGInv']: 1065 1066 Gdata = np.hstack((Gdata,-Gdata)) #inversion if any 1066 Gdata = np.repeat(Gdata,Ncen,axis=1) #dup over cell centering1067 Gdata = np.repeat(Gdata,Ncen,axis=1) #dup over cell centering 1067 1068 Gdata = SGData['MagMom'][nxs,:,nxs]*Gdata #flip vectors according to spin flip 1068 1069 Gdata = np.inner(Amat,Gdata.T) #convert back to cart. space MXYZ, Natoms, NOps*Inv*Ncen 1069 1070 Gdata = np.swapaxes(Gdata,1,2) # put Natoms last 1070 1071 # GSASIIpath.IPyBreak() 1071 Mag = np.tile(Mag[:,nxs],len(SGMT)*Ncen).T 1072 Mag = np.tile(Mag[:,nxs],len(SGMT)*Ncen).T #Mag same length as Gdata 1072 1073 if SGData['SGInv']: 1073 Mag = np.repeat(Mag,2,axis=0) #Mag same length as Gdata1074 Mag = np.repeat(Mag,2,axis=0) 1074 1075 dFdMx = np.zeros((nRef,mSize,3)) 1075 1076 FF = np.zeros(len(Tdata)) … … 1140 1141 mphase = phase 1141 1142 mphase = np.array([mphase+twopi*np.inner(cen,H)[:,nxs,nxs] for cen in SGData['SGCen']]) 1143 # GSASIIpath.IPyBreak() 1142 1144 mphase = np.concatenate(mphase,axis=1) #Nref,Nop,Natm 1143 1145 sinm = np.sin(mphase) #ditto - match magstrfc.for … … 1152 1154 fbms = np.sum(np.sum(fbm,axis=-1),axis=-1) #ditto 1153 1155 Hij = np.hstack((Hij,Hij)) 1154 # GSASIIpath.IPyBreak()1155 1156 if 'T' in calcControls[hfx+'histType']: 1156 1157 fa = np.array([fot*cosp,-np.reshape(Flack*FPP,sinp.shape)*sinp*Tcorr])
Note: See TracChangeset
for help on using the changeset viewer.