Changeset 4542


Ignore:
Timestamp:
Aug 14, 2020 5:24:27 PM (14 months ago)
Author:
vondreele
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r4535 r4542  
    39273927    SGData = generalData['SGData']
    39283928    mapPeaks = data['Map Peaks']
    3929     XYZ = {ind:np.array(mapPeaks[ind][1:4]) for ind in Ind}
    3930     Indx = [True for ind in Ind]
    3931     Unique = []
    3932     # scan through peaks, finding all peaks equivalent to peak ind
     3929   
     3930   
     3931    Indx = {}
     3932    XYZ = {}
     3933    for ind in Ind:
     3934        XYZ[ind] = np.array(mapPeaks[ind][1:4])
     3935        Indx[ind] = True
    39333936    for ind in Ind:
    39343937        if Indx[ind]:
    39353938            xyz = XYZ[ind]
    3936             dups = []
    39373939            for jnd in Ind:
    3938                 # only consider peaks we have not looked at before
    3939                 # and were not already found to be equivalent
    3940                 if jnd > ind and Indx[jnd]:                       
     3940                if ind != jnd and Indx[jnd]:                       
    39413941                    Equiv = G2spc.GenAtom(XYZ[jnd],SGData,Move=True)
    39423942                    xyzs = np.array([equiv[0] for equiv in Equiv])
    3943                     if not noDuplicate(xyz,xyzs,Amat):
    3944                         Indx[jnd] = False
    3945                         dups.append(jnd)
    3946             # select the unique peak closest to cell center
    3947             cntr = mapPeaks[ind][-1]
    3948             icntr = ind
    3949             for jnd in dups:
    3950                 if mapPeaks[jnd][-1] < cntr:
    3951                     cntr = mapPeaks[jnd][-1]
    3952                     icntr = jnd
    3953             Unique.append(icntr)
    3954     return Unique
    3955 
     3943                    Indx[jnd] = noDuplicate(xyz,xyzs,Amat)
     3944    Ind = []
     3945    for ind in Indx:
     3946        if Indx[ind]:
     3947            Ind.append(ind)
     3948    return Ind
     3949   
     3950   
     3951   
     3952   
     3953   
     3954   
     3955    # XYZ = {ind:np.array(mapPeaks[ind][1:4]) for ind in Ind}
     3956    # Indx = [True for ind in Ind]
     3957    # Unique = []
     3958    # # scan through peaks, finding all peaks equivalent to peak ind
     3959    # for ind in Ind:
     3960    #     if Indx[ind]:
     3961    #         xyz = XYZ[ind]
     3962    #         dups = []
     3963    #         for jnd in Ind:
     3964    #             # only consider peaks we have not looked at before
     3965    #             # and were not already found to be equivalent
     3966    #             if jnd > ind and Indx[jnd]:                       
     3967    #                 Equiv = G2spc.GenAtom(XYZ[jnd],SGData,Move=True)
     3968    #                 xyzs = np.array([equiv[0] for equiv in Equiv])
     3969    #                 if not noDuplicate(xyz,xyzs,Amat):
     3970    #                     Indx[jnd] = False
     3971    #                     dups.append(jnd)
     3972    #                 Indx[jnd] = noDuplicate(xyz,xyzs,Amat)
     3973    # #        # select the unique peak closest to cell center
     3974    # #         cntr = mapPeaks[ind][-1]
     3975    # #         icntr = ind
     3976    # #         for jnd in dups:
     3977    # #             if mapPeaks[jnd][-1] < cntr:
     3978    # #                 cntr = mapPeaks[jnd][-1]
     3979    # #                 icntr = jnd
     3980    # #         Unique.append(icntr)
     3981    # # return Unique
     3982    # Ind = []
     3983    # for ind in Indx:
     3984    #     if Indx[ind]:
     3985    #         Ind.append(ind)
     3986    # return Ind
    39563987################################################################################
    39573988##### Dysnomia setup & return stuff
Note: See TracChangeset for help on using the changeset viewer.