Changeset 2050
- Timestamp:
- Nov 13, 2015 3:46:35 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r2048 r2050 1129 1129 Iparm1 = G2IO.makeInstDict(names,data,codes) 1130 1130 Iparm1['Source'] = [Irads[irad],Irads[irad]] 1131 Iparm1['Bank'] = [Bank,Bank,0] 1131 1132 return [Iparm1,{}] 1132 1133 elif 'T' in DataType: … … 1176 1177 data.extend([0.0,0.0,G2IO.sfloat(s[0]),G2IO.sfloat(s[1]),0.0,0.0,0.0,azm]) #beta-q, sig-0, sig-1, sig-2, sig-q, X, Y 1177 1178 Inst1 = G2IO.makeInstDict(names,data,codes) 1179 Iparm1['Bank'] = [Bank,Bank,0] 1178 1180 Inst2 = {} 1179 1181 if pfType < 0: -
trunk/GSASIIindex.py
r2038 r2050 158 158 c = ac[1] 159 159 alp = gam = 90 160 bet = ranaxis(90.,1 30.)160 bet = ranaxis(90.,140.) 161 161 else: #triclinic - a<b<c convention 162 162 abc = [ranaxis(dmin,dmax),ranaxis(dmin,dmax),ranaxis(dmin,dmax)] … … 268 268 if r: 269 269 if values.size > 1: 270 Vec.append(max( 0.0,min(2.0,values[i])))270 Vec.append(max(-1.,min(1.0,values[i]))) 271 271 else: 272 272 Vec.append(max(0.0,min(2.0,values))) -
trunk/GSASIImath.py
r2046 r2050 786 786 for i,elem in enumerate(generalData['AtomTypes']): 787 787 mass += generalData['NoAtoms'][elem]*generalData['AtomMass'][i] 788 return ma ss788 return max(mass,1.0) 789 789 790 790 def getDensity(generalData): … … 2352 2352 cell = generalData['Cell'][1:8] 2353 2353 A = G2lat.cell2A(cell[:6]) 2354 maxM = generalData['SuperVec'][2]2354 maxM = 4 2355 2355 Hmax = G2lat.getHKLmax(dmin,SGData,A)+[maxM,] 2356 2356 adjHKLmax(SGData,Hmax) … … 2691 2691 A = G2lat.cell2A(cell[:6]) 2692 2692 Vol = cell[6] 2693 maxM = generalData['SuperVec'][2]2693 maxM = 4 2694 2694 Hmax = np.asarray(G2lat.getHKLmax(dmin,SGData,A)+[maxM,],dtype='i')+1 2695 2695 adjHKLmax(SGData,Hmax) -
trunk/GSASIIphsGUI.py
r2040 r2050 745 745 val = Obj.GetValue() 746 746 try: 747 val = min(2.0,max( 0.0,float(val)))747 val = min(2.0,max(-1.0,float(val))) 748 748 except ValueError: 749 749 val = generalData['SuperVec'][0][ind] … … 1177 1177 ################################################################################ 1178 1178 1179 SSdefault = {'SS1':{'waveType':'Fourier','Sfrac':[],'Spos':[],'Sadp':[],'Smag':[]}}1180 1179 def FillAtomsGrid(Atoms): 1181 1180 '''Display the contents of the Atoms tab … … 1615 1614 atomData.append([Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.01,0,0,0,0,0,0,atId]) 1616 1615 elif generalData['Type'] in ['modulated','magnetic']: 1617 atomData.append([Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.01,0,0,0,0,0,0,atId,[],[],SSdefault]) 1616 atomData.append([Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.01,0,0,0,0,0,0,atId,[],[], 1617 {'SS1':{'waveType':'Fourier','Sfrac':[],'Spos':[],'Sadp':[],'Smag':[]}}]) 1618 1618 SetupGeneral() 1619 1619 if 'Atoms' in data['Drawing']: … … 1832 1832 atomData.insert(indx,[Name,El,'',x,y,z,1,Sytsym,Mult,'I',0.01,0,0,0,0,0,0,atId]) 1833 1833 elif generalData['Type'] in ['modulated','magnetic']: 1834 atomData.insert(indx,[Name,El,'',x,y,z,1,Sytsym,Mult,0,'I',0.01,0,0,0,0,0,0,atId,[],[],SSdefault]) 1834 atomData.insert(indx,[Name,El,'',x,y,z,1,Sytsym,Mult,0,'I',0.01,0,0,0,0,0,0,atId,[],[], 1835 {'SS1':{'waveType':'Fourier','Sfrac':[],'Spos':[],'Sadp':[],'Smag':[]}}]) 1835 1836 SetupGeneral() 1836 1837 … … 2491 2492 mainSizer.Add(wx.StaticText(waveData,label=' Incommensurate propagation wave data:'),0,WACV) 2492 2493 if generalData['Type'] in ['modulated','magnetic']: 2493 for iatm,at om in enumerate(atomData):2494 xyz = at om[cx:cx+3]2495 uij = at om[cia+2:cia+8]2494 for iatm,atm in enumerate(atomData): 2495 xyz = atm[cx:cx+3] 2496 uij = atm[cia+2:cia+8] 2496 2497 for SS in ['SS1',]: #future SS2 & SS3 - I doubt it! 2497 2498 G2G.HorizontalLine(mainSizer,waveData) 2498 mainSizer.Add(AtomSizer(SS,at om))2499 mainSizer.Add(AtomSizer(SS,atm)) 2499 2500 for Stype in ['Sfrac','Spos','Sadp','Smag']: 2500 if at om[cia] != 'A' and Stype == 'Sadp': #Uiso can't have modulations!2501 if atm[cia] != 'A' and Stype == 'Sadp': #Uiso can't have modulations! 2501 2502 continue 2502 2503 if generalData['Type'] != 'magnetic' and Stype == 'Smag': 2503 2504 break 2504 mainSizer.Add(WaveSizer(at om[-1][SS]['waveType'],atom[-1][SS][Stype],Stype,typeNames[Stype],Labels[Stype]))2505 mainSizer.Add(WaveSizer(atm[-1][SS]['waveType'],atm[-1][SS][Stype],Stype,typeNames[Stype],Labels[Stype])) 2505 2506 SetPhaseWindow(G2frame.dataFrame,waveData,mainSizer) 2506 2507 -
trunk/GSASIIplot.py
r2043 r2050 3046 3046 G2frame.G2plotNB.status.SetStatusText('t =%9.3f %s =%9.3f %s=%9.3f'%(xpos,GkDelta+Ax,ypos,Gkrho,Slab[iy,ix]/8.),1) 3047 3047 # GSASIIpath.IPyBreak() 3048 except TypeError:3048 except (TypeError,IndexError): 3049 3049 G2frame.G2plotNB.status.SetStatusText('Select '+Title+' pattern first',1) 3050 3050 -
trunk/GSASIIpwdGUI.py
r2049 r2050 1182 1182 data tree item. 1183 1183 ''' 1184 #patch 1185 if 'Bank' not in data: 1186 data['Bank'] = [1,1,0] 1187 #end patch 1184 1188 def keycheck(keys): 1185 1189 good = [] 1186 1190 for key in keys: 1187 if key in ['Type',' U','V','W','X','Y','SH/L','I(L2)/I(L1)','alpha',1191 if key in ['Type','Bank','U','V','W','X','Y','SH/L','I(L2)/I(L1)','alpha', 1188 1192 'beta-0','beta-1','beta-q','sig-0','sig-1','sig-2','sig-q','Polariz.', 1189 1193 'Lam','Azimuth','2-theta','fltPath','difC','difA','difB','Zero','Lam1','Lam2']: … … 1273 1277 File.close() 1274 1278 Inst,Inst2 = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId,'Instrument Parameters')) 1279 if 'Bank' not in Inst: #patch for old .instprm files - may cause faults for TOF data 1280 Inst['Bank'] = [1,1,0] 1275 1281 data = G2IO.makeInstDict(newItems,newVals,len(newVals)*[False,]) 1276 1282 G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId,'Instrument Parameters'),[data,Inst2]) … … 1426 1432 instSizer = wx.FlexGridSizer(0,6,5,5) 1427 1433 subSizer = wx.BoxSizer(wx.HORIZONTAL) 1428 subSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,' Histogram Type: '+insVal['Type']),0,WACV) 1434 text = ' Histogram Type: %s Bank: %d'%(insVal['Type'],insVal['Bank']) 1435 subSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,text),0,WACV) 1429 1436 mainSizer.Add(subSizer) 1430 1437 labelLst[:],elemKeysLst[:],dspLst[:],refFlgElem[:] = [],[],[],[] … … 2455 2462 Id = Indx[ObjId] 2456 2463 try: 2457 value = min(1.0,max( 0.,float(Obj.GetValue())))2464 value = min(1.0,max(-1.0,float(Obj.GetValue()))) 2458 2465 except ValueError: 2459 2466 value = ssopt['ModVec'][Id] … … 2466 2473 ObjId = Obj.GetId() 2467 2474 Id,valObj = Indx[ObjId] 2468 move = Obj.GetValue()*0.00 052475 move = Obj.GetValue()*0.001 2469 2476 Obj.SetValue(0) 2470 value = min(1.0,max( .0,float(valObj.GetValue())+move))2477 value = min(1.0,max(-1.0,float(valObj.GetValue())+move)) 2471 2478 valObj.SetValue('%.4f'%(value)) 2472 2479 ssopt['ModVec'][Id] = value … … 2885 2892 littleSizer.Add(wx.StaticText(parent=G2frame.dataDisplay,label=' Max Nc/Nobs '),0,WACV) 2886 2893 NcNo = wx.SpinCtrl(G2frame.dataDisplay) 2887 NcNo.SetRange(2, 6)2894 NcNo.SetRange(2,8) 2888 2895 NcNo.SetValue(controls[2]) 2889 2896 NcNo.Bind(wx.EVT_SPINCTRL,OnNcNo) -
trunk/imports/G2phase.py
r2040 r2050 394 394 cell = None 395 395 nqi = 0 396 version = '2000' 396 397 while S: 397 398 self.errors = 'Error reading at line '+str(line) 398 399 if 'title' in S and S != 'title\n': 399 400 Title = S.split()[1] 401 elif 'Jana2006' in S: 402 self.warnings += '\nJana2006 file detected' 403 version = '2006' 400 404 elif 'cell' in S[:4]: 401 405 cell = S[5:].split() … … 475 479 if S1[11:15].strip() == '1': 476 480 S2 = file2.readline() 477 Uiso = R2pisq*float(S2[:9])/4. #Biso -> Uiso 481 Uiso = S2[:9] 482 if version == '2000': 483 Uiso = R2pisq*float(Uiso)/4. #Biso -> Uiso 478 484 Uij = [0,0,0,0,0,0] 479 485 IA = 'I' … … 483 489 Uiso = 0. 484 490 Uij = [float(S2[:9]),float(S2[9:18]),float(S2[18:27]), 485 float(S2[27:36]),float(S2[36:45]),float(S2[45:54])] #these things are betaij! need to convert to Uij 486 Uij = R2pisq*G2lat.UijtoU6(G2lat.U6toUij(Uij)/Mast) 491 float(S2[27:36]),float(S2[36:45]),float(S2[45:54])] #Uij in Jana2006! 492 if version == '2000': 493 Uij = R2pisq*G2lat.UijtoU6(G2lat.U6toUij(Uij)/Mast) #these things are betaij in Jana2000! need to convert to Uij 487 494 for i in range(S1N[0]): 488 495 if not i: … … 520 527 Spos[i] = [vals,False] 521 528 for i,it in enumerate(Sadp): 522 #these are betaij modulations! need to convert to Uij modulations523 529 vals = [float(it[:9]),float(it[9:18]),float(it[18:27]),float(it[27:36]),float(it[36:45]),float(it[45:54]), 524 float(it[54:63]),float(it[63:72]),float(it[72:81]),float(it[81:90]),float(it[90:99]),float(it[99:108])] 525 vals[:6] = R2pisq*G2lat.UijtoU6(G2lat.U6toUij(vals[:6])/Mast) #convert sin bij to Uij 526 vals[6:] = R2pisq*G2lat.UijtoU6(G2lat.U6toUij(vals[6:])/Mast) #convert cos bij to Uij 530 float(it[54:63]),float(it[63:72]),float(it[72:81]),float(it[81:90]),float(it[90:99]),float(it[99:108])] 531 #these are betaij modulations in Jana2000! need to convert to Uij modulations 532 if version == '2000': 533 vals[:6] = R2pisq*G2lat.UijtoU6(G2lat.U6toUij(vals[:6])/Mast) #convert sin bij to Uij 534 vals[6:] = R2pisq*G2lat.UijtoU6(G2lat.U6toUij(vals[6:])/Mast) #convert cos bij to Uij 527 535 Sadp[i] = [vals,False] 528 536 Atom = [Name,aType,'',XYZ[0],XYZ[1],XYZ[2],1.0,SytSym,Mult,IA,Uiso]
Note: See TracChangeset
for help on using the changeset viewer.