# Changeset 4542

Ignore:
Timestamp:
Aug 14, 2020 5:24:27 PM (2 years ago)
Message:

revert PeaksUniqure? back to version <#4473 so it properly does sorted map peaks

File:
1 edited

Unmodified
Added
Removed
• ## trunk/GSASIImath.py

 r4535 SGData = generalData['SGData'] mapPeaks = data['Map Peaks'] XYZ = {ind:np.array(mapPeaks[ind][1:4]) for ind in Ind} Indx = [True for ind in Ind] Unique = [] # scan through peaks, finding all peaks equivalent to peak ind Indx = {} XYZ = {} for ind in Ind: XYZ[ind] = np.array(mapPeaks[ind][1:4]) Indx[ind] = True for ind in Ind: if Indx[ind]: xyz = XYZ[ind] dups = [] for jnd in Ind: # only consider peaks we have not looked at before # and were not already found to be equivalent if jnd > ind and Indx[jnd]: if ind != jnd and Indx[jnd]: Equiv = G2spc.GenAtom(XYZ[jnd],SGData,Move=True) xyzs = np.array([equiv[0] for equiv in Equiv]) if not noDuplicate(xyz,xyzs,Amat): Indx[jnd] = False dups.append(jnd) # select the unique peak closest to cell center cntr = mapPeaks[ind][-1] icntr = ind for jnd in dups: if mapPeaks[jnd][-1] < cntr: cntr = mapPeaks[jnd][-1] icntr = jnd Unique.append(icntr) return Unique Indx[jnd] = noDuplicate(xyz,xyzs,Amat) Ind = [] for ind in Indx: if Indx[ind]: Ind.append(ind) return Ind # XYZ = {ind:np.array(mapPeaks[ind][1:4]) for ind in Ind} # Indx = [True for ind in Ind] # Unique = [] # # scan through peaks, finding all peaks equivalent to peak ind # for ind in Ind: #     if Indx[ind]: #         xyz = XYZ[ind] #         dups = [] #         for jnd in Ind: #             # only consider peaks we have not looked at before #             # and were not already found to be equivalent #             if jnd > ind and Indx[jnd]: #                 Equiv = G2spc.GenAtom(XYZ[jnd],SGData,Move=True) #                 xyzs = np.array([equiv[0] for equiv in Equiv]) #                 if not noDuplicate(xyz,xyzs,Amat): #                     Indx[jnd] = False #                     dups.append(jnd) #                 Indx[jnd] = noDuplicate(xyz,xyzs,Amat) # #        # select the unique peak closest to cell center # #         cntr = mapPeaks[ind][-1] # #         icntr = ind # #         for jnd in dups: # #             if mapPeaks[jnd][-1] < cntr: # #                 cntr = mapPeaks[jnd][-1] # #                 icntr = jnd # #         Unique.append(icntr) # # return Unique # Ind = [] # for ind in Indx: #     if Indx[ind]: #         Ind.append(ind) # return Ind ################################################################################ ##### Dysnomia setup & return stuff
Note: See TracChangeset for help on using the changeset viewer.