Changeset 2550
 Timestamp:
 Nov 28, 2016 2:59:55 PM (6 years ago)
 Location:
 trunk
 Files:

 5 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASII.py
r2547 r2550 326 326 'confirm we have the right file' 327 327 rdmsg = 'File '+ filename +' begins:\n\n' 328 for i in range(3): 329 rdmsg += fp.readline() 328 rdmsg += fp.read(80) 330 329 rdmsg += '\n\nDo you want to read this file?' 331 330 if not all([ord(c) < 128 and ord(c) != 0 for c in rdmsg]): # show only if ASCII 
trunk/GSASIIphsGUI.py
r2546 r2550 242 242 generalData['AtomMass'] = [] 243 243 generalData['Color'] = [] 244 if generalData['Type'] == 'magnetic' and not 'Lande g' in generalData:245 generalData['MagDmin'] = 1.0246 generalData['Lande g'] = []244 if generalData['Type'] == 'magnetic': 245 generalData['MagDmin'] = generalData.get('MagDmin',1.0) 246 landeg = generalData.get('Lande g',[]) 247 247 generalData['Mydir'] = G2frame.dirname 248 248 badList = {} … … 280 280 generalData['Color'].append(Info['Color']) 281 281 if generalData['Type'] == 'magnetic': 282 generalData['MagDmin'] = generalData.get('MagDmin',1.0) 283 if not atom[ct] in generalData['AtomTypes']: 284 generalData['Lande g'].append(2.0) 282 if len(landeg) < len(generalData['AtomTypes']): 283 landeg.append(2.0) 284 if generalData['Type'] == 'magnetic': 285 generalData['Lande g'] = landeg[:len(generalData['AtomTypes'])] 286 285 287 if badList: 286 288 msg = 'Warning: element symbol(s) not found:' … … 678 680 try: 679 681 val = float(Obj.GetValue()) 680 if val < 1. or val > 2.0:682 if val < 0.5 or val > 3.0: 681 683 raise ValueError 682 684 except ValueError: 
trunk/GSASIIstrMath.py
r2548 r2550 998 998 # GSASIIpath.IPyBreak() 999 999 Mag = np.tile(Mag[:,nxs],Nops).T #make Mag same length as Gdata 1000 dGdm = (1.Gdata**2) #1/Mag removed  canceled out in dqmx=sum(dqdm*dGdm)1000 dGdm = (1.Gdata**2)/Mag #1/Mag removed  canceled out in dqmx=sum(dqdm*dGdm) 1001 1001 dFdMx = np.zeros((nRef,mSize,3)) 1002 1002 Uij = np.array(G2lat.U6toUij(Uijdata)) … … 1050 1050 dqdm = np.array([np.outer(hm,hm)np.eye(3) for hm in HM.T]).T #Mxyz,Mxyz,Nref (3x3 matrix) 1051 1051 dqmx = dqdm[:,:,:,nxs,nxs]*dGdm[:,nxs,nxs,:,:] 1052 # dqmx = np.sum(dqmx*SGData['SpnFlp'][nxs,nxs,nxs,:,nxs],axis=1) #matrix * vector = vector1053 1052 dqmx = np.sum(dqmx,axis=1) #matrix * vector = vector 1054 dmx = Q*dGdM[:,nxs,:,:]+dqmx #*Mag canceled out of dqmx term1053 dmx = Q*dGdM[:,nxs,:,:]+dqmx*Mag[nxs,nxs,:,:] #*Mag canceled out of dqmx term 1055 1054 # GSASIIpath.IPyBreak() 1056 1055 # … … 1059 1058 fams = np.sum(np.sum(fam,axis=1),axis=1) #Mxyz,Nref 1060 1059 fbms = np.sum(np.sum(fbm,axis=1),axis=1) 1061 famx = Q*TMcorr[nxs,:,nxs,:]*Mag[nxs,nxs,:,:]*sinm[nxs,:,:,:] #Mxyz,Nref,Nops,Natom1060 famx = Q*TMcorr[nxs,:,nxs,:]*Mag[nxs,nxs,:,:]*sinm[nxs,:,:,:] #Mxyz,Nref,Nops,Natom 1062 1061 fbmx = Q*TMcorr[nxs,:,nxs,:]*Mag[nxs,nxs,:,:]*cosm[nxs,:,:,:] 1063 1062 #sums below are over Nops  real part 
trunk/imports/G2pwd_BrukerRAW.py
r2547 r2550 94 94 x = np.array([start2Th+i*step for i in range(nSteps)]) 95 95 y = np.array([max(1.,st.unpack('<f',File.read(4))[0]) for i in range(nSteps)]) 96 y = np.where(y<0.,y,1.) 96 97 w = 1./y 97 98 self.powderdata = [x,y,w,np.zeros(nSteps),np.zeros(nSteps),np.zeros(nSteps)] … … 134 135 if blockNum <= nBlock: 135 136 for iBlock in range(blockNum): 136 headLen = int(st.unpack('<i',File.read(4))[0]) 137 headLen = int(st.unpack('<i',File.read(4))[0])+40 137 138 nSteps = int(st.unpack('<i',File.read(4))[0]) 138 139 if iBlock+1 == blockNum: 
trunk/testDeriv.py
r2549 r2550 8 8 refinement against numerical values computed in this script. 9 9 10 To use set ``DEBUG=True`` in GSASIIstrMain.py (line 22, as of version11 1110); run the least squares  one cycleis sufficient. Do the "Save10 To use set ``DEBUG=True`` in GSASIIstrMain.py (line 40, as of version 11 2546); run the least squares  zero cycles is sufficient. Do the "Save 12 12 Results"; this will write the file testDeriv.dat in the local 13 13 directory. … … 17 17 derivatives generated over all observations (including penalty terms) 18 18 and the corresponding analytical ones produced in the least 19 squares. They should match. 19 squares. They should match. Profiling is also done for function 20 calculation & for the 1st selected derivative (rest should be the same). 20 21 ''' 21 22
Note: See TracChangeset
for help on using the changeset viewer.