Changeset 2072 for trunk/GSASIImath.py


Ignore:
Timestamp:
Nov 26, 2015 10:22:36 AM (6 years ago)
Author:
vondreele
Message:

replace local codes with routines for ZgZag/Block? wave calcs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r2070 r2072  
    960960            Tmm = Ax[iatm][0][:2]                       
    961961            XYZmax = np.array([Ax[iatm][0][2],Bx[iatm][0][0],Bx[iatm][0][1]])
    962             DT = Tmm[1]-Tmm[0]
    963             slopeUp = 2.*XYZmax/DT
    964             slopeDn = 2.*XYZmax/(1.-DT)
    965             XmodZ[iatm][0] += np.array([np.where(Tmm[0] < t%1. <= Tmm[1],-XYZmax+slopeUp*((t-Tmm[0])%1.),XYZmax-slopeDn*((t-Tmm[1])%1.)) for t in glTau]).T
     962            XmodZ[iatm][0] += posZigZag(glTau,Tmm,XYZmax).T
    966963        elif 'Block' in waveTypes[iatm]:
     964
    967965            nx = 1
    968966            Tmm = Ax[iatm][0][:2]                       
    969967            XYZmax = np.array([Ax[iatm][0][2],Bx[iatm][0][0],Bx[iatm][0][1]])
    970             XmodZ[iatm][0] += np.array([np.where(Tmm[0] < t%1. <= Tmm[1],-XYZmax,XYZmax) for t in glTau]).T                   
     968            XmodZ[iatm][0] += posBlock(glTau,Tmm,XYZmax).T
    971969        tauX = np.arange(1.,nWaves[1]+1-nx)[:,nxs]*glTau  #Xwaves x 32
    972970        XmodA[iatm][nx:] = Ax[iatm,nx:,:,nxs]*np.sin(twopi*tauX[nxs,:,nxs,:]) #atoms X waves X 3 X 32
Note: See TracChangeset for help on using the changeset viewer.