Changeset 1598
- Timestamp:
- Dec 8, 2014 12:36:58 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIlattice.py
r1597 r1598 870 870 SSdH = dict(zip(range(-maxH,maxH+1),SSdH)) 871 871 for h,k,l,d in HKL: 872 ext = G2spc.GenHKLf([h,k,l],SGData)[0] 872 ext = G2spc.GenHKLf([h,k,l],SGData)[0] #h,k,l must be integral values here 873 873 if not ext and d >= dmin: 874 874 HKLs.append([h,k,l,0,d]) … … 880 880 if d >= dmin: 881 881 HKLM = np.array([h,k,l,dH]) 882 if G2spc.checkSS extc(HKLM,SSGData):882 if G2spc.checkSSLaue([h,k,l,dH],SGData,SSGData) and G2spc.checkSSextc(HKLM,SSGData): 883 883 HKLs.append([h,k,l,dH,d]) 884 884 return HKLs -
trunk/GSASIImath.py
r1595 r1598 1720 1720 A = G2lat.cell2A(cell[:6]) 1721 1721 Vol = cell[6] 1722 im = 0 1723 if generalData['Type'] in ['modulated','magnetic',]: 1724 im = 1 1722 1725 Hmax = np.asarray(G2lat.getHKLmax(dmin,SGData,A),dtype='i')+1 1723 1726 adjHKLmax(SGData,Hmax) … … 1725 1728 time0 = time.time() 1726 1729 for iref,ref in enumerate(reflDict['RefList']): 1727 dsp = ref[4] 1730 dsp = ref[4+im] 1731 if im and ref[3]: #skip super lattice reflections 1732 continue 1728 1733 if dsp >= dmin: 1729 1734 ff = 0.1*Vol #est. no. atoms for ~10A**3/atom … … 1731 1736 SQ = 0.25/dsp**2 1732 1737 ff *= G2el.ScatFac(FFtable,SQ)[0] 1733 if ref[8 ] > 0.: #use only +ve Fobs**21734 E = np.sqrt(ref[8 ])/ff1738 if ref[8+im] > 0.: #use only +ve Fobs**2 1739 E = np.sqrt(ref[8+im])/ff 1735 1740 else: 1736 1741 E = 0. -
trunk/GSASIIphsGUI.py
r1596 r1598 5144 5144 refData = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame, \ 5145 5145 PatternId,'Reflection Lists'))[PhaseName]['RefList'] 5146 im = 0 5147 if data['General']['Type'] in ['modulated','magnetic',]: 5148 im = 1 5146 5149 Inv = data['General']['SGData']['SGInv'] 5147 5150 mult = 0.5 … … 5152 5155 for iref,ref in enumerate(Refs): 5153 5156 try: 5154 if ref[6 ] < 0.:5155 ref[6 ] *= -mult5156 refData[iref][8 ] *= -mult5157 refData[iref][9 ] *= -mult5158 ref[5 ] = False5159 ref[7 ] = 1.05157 if ref[6+im] < 0.: 5158 ref[6+im] *= -mult 5159 refData[iref][8+im] *= -mult 5160 refData[iref][9+im] *= -mult 5161 ref[5+im] = False 5162 ref[7+im] = 1.0 5160 5163 except IndexError: 5161 5164 print 'skipped',ref -
trunk/GSASIIplot.py
r1596 r1598 526 526 ''' 527 527 528 global ifBox 529 ifBox = False 528 530 def OnKeyBox(event): 529 531 mode = cb.GetValue() … … 557 559 558 560 def OnKey(event): #on key UP!! 561 global ifBox 559 562 Choice = {'F':'Fo','S':'Fosq','U':'Unit','D':'dFsq','W':'dFsq/sig'} 560 563 try: … … 576 579 drawingData['Quaternion'] = Q 577 580 Q = drawingData['Quaternion'] 581 elif key in 'B': 582 ifBox = not ifBox 578 583 elif key == '+': 579 584 Data['Scale'] *= 1.25 … … 597 602 Super = Data['Super'] 598 603 SuperVec = [] 599 for i in range(Super): 600 SuperVec.append(Data['SuperVec'][i][0]) 601 SuperVec = np.array(SuperVec) 604 if Super: 605 SuperVec = np.array(Data['SuperVec'][0]) 602 606 defaultViewPt = copy.copy(drawingData['viewPoint']) 603 607 Amat,Bmat = G2lat.cell2AB(cell) #Amat - crystal to cartesian, Bmat - inverse … … 616 620 uBox = np.array([[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]]) 617 621 uEdges = np.array([ 618 [uBox[0],uBox[1]],[uBox[0],uBox[3]],[uBox[0],uBox[4]],[uBox[1],uBox[2]]]) 619 uColors = [Rd,Gr,Bl] 620 622 [uBox[0],uBox[1]],[uBox[0],uBox[3]],[uBox[0],uBox[4]],[uBox[1],uBox[2]], 623 [uBox[2],uBox[3]],[uBox[1],uBox[5]],[uBox[2],uBox[6]],[uBox[3],uBox[7]], 624 [uBox[4],uBox[5]],[uBox[5],uBox[6]],[uBox[6],uBox[7]],[uBox[7],uBox[4]]]) 625 uColors = [Rd,Gr,Bl, Wt,Wt,Wt, Wt,Wt,Wt, Wt,Wt,Wt] 621 626 def FillHKLRC(): 622 627 R = np.zeros(len(hklRef)) … … 630 635 else: 631 636 Fosq,sig,Fcsq = refl[8+Super],1.0,refl[9+Super] 632 HKL.append(H+np.sum(SuperVec*refl[3:3+Super],axis=0)) 637 if Super: 638 HKL.append(H+SuperVec*refl[3]) 639 else: 640 HKL.append(H) 633 641 if Data['Type'] == 'Unit': 634 642 R[i] = 0.1 … … 779 787 glLightfv(GL_LIGHT0,GL_DIFFUSE,[1,1,1,1]) 780 788 789 def RenderBox(x,y,z): 790 xyz = np.array([x,y,z]) 791 glEnable(GL_COLOR_MATERIAL) 792 glLineWidth(1) 793 glPushMatrix() 794 glTranslate(x,y,z) 795 glColor4ubv([0,0,0,0]) 796 glBegin(GL_LINES) 797 for line,color in zip(uEdges,uColors): 798 glColor3ubv(color) 799 glVertex3fv(line[0]) 800 glVertex3fv(line[1]) 801 glEnd() 802 glPopMatrix() 803 glColor4ubv([0,0,0,0]) 804 glDisable(GL_COLOR_MATERIAL) 805 781 806 def RenderUnitVectors(x,y,z): 782 807 xyz = np.array([x,y,z]) … … 786 811 glTranslate(x,y,z) 787 812 glBegin(GL_LINES) 788 for line,color in zip(uEdges,uColors) :813 for line,color in zip(uEdges,uColors)[:3]: 789 814 glColor3ubv(color) 790 815 glVertex3fv(-line[1]) … … 850 875 glTranslate(-Tx,-Ty,-Tz) 851 876 x,y,z = drawingData['viewPoint'][0] 852 RenderUnitVectors(x,y,z) 877 if ifBox: 878 RenderBox(x,y,z) 879 else: 880 RenderUnitVectors(x,y,z) 853 881 RenderUnitVectors(0,0,0) 854 882 RenderDots(HKL,RC) … … 871 899 Page.SetFocus() 872 900 Page.Choice = None 873 choice = [' save as/key:','jpeg','tiff','bmp','c: recenter to default',' +: increase scale',901 choice = [' save as/key:','jpeg','tiff','bmp','c: recenter to default','b: toggle box ','+: increase scale', 874 902 '-: decrease scale','f: Fobs','s: Fobs**2','u: unit','d: Fo-Fc','w: DF/sig','i: toggle intensity scaling'] 875 903 cb = wx.ComboBox(G2frame.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY,choices=choice) -
trunk/GSASIIspc.py
r1587 r1598 1123 1123 Uses old GSAS Fortran routine genhkl.for 1124 1124 1125 :param HKL: [h,k,l] 1125 :param HKL: [h,k,l] must be integral values for genhkl.for to work 1126 1126 :param SGData: space group data obtained from SpcGroup 1127 1127 :returns: iabsnt,mulp,Uniq,phi … … 1130 1130 * mulp = reflection multiplicity including Friedel pairs 1131 1131 * Uniq = numpy array of equivalent hkl in descending order of h,k,l 1132 * phi = phase offset for each equivalent h,k,l 1132 1133 1133 1134 ''' … … 1145 1146 1146 1147 return iabsnt,mulp,Uniq,phi 1148 1149 def checkSSLaue(HKL,SGData,SSGData): 1150 #Laue check here - Toss HKL if outside unique Laue part 1151 h,k,l,m = HKL 1152 if SGData['SGLaue'] == '2/m': 1153 if SGData['SGUniq'] == 'a': 1154 if 'a' in SSGData['modSymb'] and h == 0 and m < 0: 1155 return False 1156 elif 'b' in SSGData['modSymb'] and k == 0 and l ==0 and m < 0: 1157 return False 1158 else: 1159 return True 1160 elif SGData['SGUniq'] == 'b': 1161 if 'b' in SSGData['modSymb'] and k == 0 and m < 0: 1162 return False 1163 elif 'a' in SSGData['modSymb'] and h == 0 and l ==0 and m < 0: 1164 return False 1165 else: 1166 return True 1167 elif SGData['SGUniq'] == 'c': 1168 if 'g' in SSGData['modSymb'] and l == 0 and m < 0: 1169 return False 1170 elif 'a' in SSGData['modSymb'] and h == 0 and k ==0 and m < 0: 1171 return False 1172 else: 1173 return True 1174 elif SGData['SGLaue'] == 'mmm': 1175 if 'a' in SSGData['modSymb']: 1176 if h == 0 and m < 0: 1177 return False 1178 else: 1179 return True 1180 elif 'b' in SSGData['modSymb']: 1181 if k == 0 and m < 0: 1182 return False 1183 else: 1184 return True 1185 elif 'g' in SSGData['modSymb']: 1186 if l == 0 and m < 0: 1187 return False 1188 else: 1189 return True 1190 else: #tetragonal, trigonal, hexagonal (& triclinic?) 1191 if l == 0 and m < 0: 1192 return False 1193 else: 1194 return True 1195 1147 1196 1148 1197 def checkSSextc(HKL,SSGData): -
trunk/imports/G2phase.py
r1513 r1598 433 433 Type = 'modulated' 434 434 vec = S.split()[1:] 435 SuperVec [nqi]= [[float(vec[i]) for i in range(3)],False,4]435 SuperVec = [[float(vec[i]) for i in range(3)],False,4] 436 436 nqi += 1 437 437 elif 'atom' in S[:4]:
Note: See TracChangeset
for help on using the changeset viewer.