Changeset 750 for trunk/GSASIImath.py


Ignore:
Timestamp:
Sep 5, 2012 10:43:15 AM (10 years ago)
Author:
vondreele
Message:

put inverse checker back in SearchMap?
add atom rename facility
update of Map peaks when map/peaks are shifted by U/D/L/R key commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r741 r750  
    934934        rho[rMM[0]:rMP[0],rMM[1]:rMP[1],rMM[2]:rMP[2]] = peakFunc(x1,rX,rY,rZ,rhoPeak,res,SGData['SGLaue'])
    935935        rho = np.roll(np.roll(np.roll(rho,-rMI[2],axis=2),-rMI[1],axis=1),-rMI[0],axis=0)
    936 #    if SGData['SGInv']:                 #check origin location & fix it if needed - centrosymmetric only
    937 #        Ocheck = np.zeros_like(rho)
    938 #        for ipeak in peaks:
    939 #            for opeak in peaks:           
    940 #                dx = ((opeak-ipeak)*incre)%incre
    941 #                if np.any(dx):      #avoid self vector
    942 #                    Ocheck[dx[0],dx[1],dx[2]] += 1
    943 #        dxMax = np.unravel_index(np.argmax(Ocheck),rho.shape)
    944 #        print 'Inversion at:',dxMax,' shift by ;',dxMax-mapHalf,' map size:',rho.shape
    945 #        rho = np.roll(np.roll(np.roll(rho,dxMax[2],axis=2),dxMax[1],axis=1),dxMax[0],axis=0)
    946 #        for peak in peaks:
    947 #            peak = (peak-(dxMax+mapHalf)/incre)%1.0
     936    if SGData['SGInv']:                 #check origin location & fix it if needed - centrosymmetric only
     937        Ocheck = np.zeros_like(rho)
     938        for ipeak in peaks:
     939            for opeak in peaks:           
     940                dx = ((opeak-ipeak)*incre)%incre
     941                if np.any(dx):      #avoid self vector
     942                    Ocheck[dx[0],dx[1],dx[2]] += 1
     943        dxMax = np.unravel_index(np.argmax(Ocheck),rho.shape)
     944        print ' Inversion at:',dxMax,' shift by ;',dxMax-mapHalf
     945        rho = np.roll(np.roll(np.roll(rho,dxMax[2],axis=2),dxMax[1],axis=1),dxMax[0],axis=0)
     946        for peak in peaks:
     947            peak = (peak-(dxMax+mapHalf)/incre)%1.0
    948948       
    949949    return np.array(peaks),np.array([mags,]).T,np.array([dzeros,]).T
Note: See TracChangeset for help on using the changeset viewer.