Changeset 774
- Timestamp:
- Oct 3, 2012 10:36:22 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIgrid.py
r765 r774 41 41 [ wxID_FOURCALC, wxID_FOURSEARCH, wxID_FOURCLEAR, wxID_PEAKSMOVE, wxID_PEAKSCLEAR, 42 42 wxID_CHARGEFLIP, wxID_PEAKSUNIQUE, wxID_PEAKSDELETE, wxID_PEAKSDA, 43 wxID_PEAKSDISTVP, wxID_PEAKSVIEWPT, 44 ] = [wx.NewId() for item in range(1 1)]43 wxID_PEAKSDISTVP, wxID_PEAKSVIEWPT, wxID_FINDEQVPEAKS, 44 ] = [wx.NewId() for item in range(12)] 45 45 46 46 [ wxID_PWDRADD, wxID_HKLFADD, wxID_DATADELETE, … … 760 760 self.MapPeaksEdit.Append(id=wxID_PEAKSDA, kind=wx.ITEM_NORMAL,text='Calc dist/ang', 761 761 help='Calculate distance or angle for selection') 762 self.MapPeaksEdit.Append(id=wxID_FINDEQVPEAKS, kind=wx.ITEM_NORMAL,text='Equivalent peaks', 763 help='Find equivalent peaks') 762 764 self.MapPeaksEdit.Append(id=wxID_PEAKSUNIQUE, kind=wx.ITEM_NORMAL,text='Unique peaks', 763 765 help='Select unique set') -
trunk/GSASIImath.py
r764 r774 918 918 X.append(D[key]) 919 919 return X 920 921 def PeaksEquiv(data,Ind): 922 923 def Duplicate(xyz,peaks,Amat): 924 if True in [np.allclose(np.inner(Amat,xyz),np.inner(Amat,peak),atol=0.5) for peak in peaks]: 925 return True 926 return False 927 928 generalData = data['General'] 929 cell = generalData['Cell'][1:7] 930 Amat,Bmat = G2lat.cell2AB(generalData['Cell'][1:7]) 931 A = G2lat.cell2A(cell) 932 SGData = generalData['SGData'] 933 mapPeaks = data['Map Peaks'] 934 XYZ = np.array([xyz[1:4] for xyz in mapPeaks]) 935 Indx = {} 936 for ind in Ind: 937 xyz = np.array(mapPeaks[ind][1:4]) 938 xyzs = np.array([equiv[0] for equiv in G2spc.GenAtom(xyz,SGData,Move=True)]) 939 for jnd,xyz in enumerate(XYZ): 940 Indx[jnd] = Duplicate(xyz,xyzs,Amat) 941 Ind = [] 942 for ind in Indx: 943 if Indx[ind]: 944 Ind.append(ind) 945 return Ind 920 946 921 947 def PeaksUnique(data,Ind): 948 # XYZE = np.array([[equiv[0] for equiv in G2spc.GenAtom(xyz[1:4],SGData,Move=True)] for xyz in mapPeaks]) #keep this!! 922 949 923 950 def noDuplicate(xyz,peaks,Amat): -
trunk/GSASIIphsGUI.py
r773 r774 4155 4155 FillMapPeaksGrid() 4156 4156 G2plt.PlotStructure(G2frame,data) 4157 4158 def OnPeaksEquiv(event): 4159 if 'Map Peaks' in data: 4160 mapPeaks = data['Map Peaks'] 4161 Ind = MapPeaks.GetSelectedRows() 4162 if Ind: 4163 wx.BeginBusyCursor() 4164 try: 4165 Ind = G2mth.PeaksEquiv(data,Ind) 4166 for r in range(MapPeaks.GetNumberRows()): 4167 if r in Ind: 4168 MapPeaks.SelectRow(r,addToSelected=True) 4169 else: 4170 MapPeaks.DeselectRow(r) 4171 finally: 4172 wx.EndBusyCursor() 4173 G2plt.PlotStructure(G2frame,data) 4157 4174 4158 4175 def OnPeaksUnique(event): … … 4457 4474 G2frame.dataFrame.Bind(wx.EVT_MENU, OnPeaksDistVP, id=G2gd.wxID_PEAKSDISTVP) 4458 4475 G2frame.dataFrame.Bind(wx.EVT_MENU, OnPeaksDA, id=G2gd.wxID_PEAKSDA) 4476 G2frame.dataFrame.Bind(wx.EVT_MENU, OnPeaksEquiv, id=G2gd.wxID_FINDEQVPEAKS) 4459 4477 G2frame.dataFrame.Bind(wx.EVT_MENU, OnPeaksUnique, id=G2gd.wxID_PEAKSUNIQUE) 4460 4478 G2frame.dataFrame.Bind(wx.EVT_MENU, OnPeaksDelete, id=G2gd.wxID_PEAKSDELETE)
Note: See TracChangeset
for help on using the changeset viewer.