Changeset 2064
- Timestamp:
- Nov 21, 2015 3:10:57 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r2062 r2064 929 929 def Modulation(waveTypes,H,HP,FSSdata,XSSdata,USSdata,Mast): 930 930 ''' 931 waveTypes: array nAtoms: 'Fourier','ZigZag' or 'Block' 931 932 H: array nRefBlk x ops X hklt 932 933 HP: array nRefBlk x ops X hklt proj to hkl … … 946 947 Bu = Mast*np.array(G2lat.U6toUij(USSdata[6:])).T #...cos Uij mods as betaij 947 948 949 GSASIIpath.IPyBreak() 950 XmodZ = np.zeros((Ax.shape[0],Ax.shape[1],3,32)) 948 951 if 'Fourier' in waveTypes: 949 952 nf = 0 950 953 nx = 0 951 XmodZ = np.zeros((Ax.shape[0],Ax.shape[1],3,32))952 954 FmodZ = np.zeros((Af.shape[0],Af.shape[1],32)) 953 if 'Crenel' in waveTypes: 955 if 'Crenel' in waveTypes: #do we need 'Crenel'?? 954 956 nC = np.where('Crenel' in waveTypes) 955 957 nf = 1 956 958 #FmodZ = 0 replace 957 else: 959 else: #1st wave is 'ZigZag' or 'Block'; rest can be 'Fourier' 958 960 nx = 1 959 if 'Sawtooth' in waveTypes: 960 nS = np.where('Sawtooth' in waveTypes) 961 #XmodZ = 0 replace 961 if 'ZigZag' in waveTypes: 962 DT = Tmm[1]-Tmm[0] 963 slopeUp = 2.*XYZmax/DT 964 slopeDn = 2.*XYZmax/(1.-DT) 965 XmodZ = 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 tau]) 966 elif 'Block' in waveTypes: 967 XmodZ = np.array([np.where(Tmm[0] < t%1. <= Tmm[1],-XYZmax,XYZmax) for t in tau]) 962 968 if Af.shape[1]: 963 969 tauF = np.arange(1.,Af.shape[1]+1-nf)[:,nxs]*glTau #Fwaves x 32 … … 985 991 cosHA = np.sum(Fmod*HbH*np.cos(HdotXD)*glWt,axis=-1) #real part; refBlk X ops x atoms; sum for G-L integration 986 992 sinHA = np.sum(Fmod*HbH*np.sin(HdotXD)*glWt,axis=-1) #imag part; ditto 987 # GSASIIpath.IPyBreak()988 993 return np.array([cosHA,sinHA]) # 2 x refBlk x SGops x atoms 989 994 … … 1093 1098 return np.sum(A,axis=0)+np.sum(B,axis=0) 1094 1099 1095 def posSawtooth(tau,Toff,slopes):1096 Tau = (tau-Toff)%1.1097 A = slopes[:,np.newaxis]*Tau1098 return A1099 1100 #def posSawtooth(tau,Toff,slopes): 1101 # Tau = (tau-Toff)%1. 1102 # A = slopes[:,np.newaxis]*Tau 1103 # return A 1104 # 1100 1105 def posZigZag(tau,Tmm,XYZmax): 1101 1106 DT = Tmm[1]-Tmm[0] -
trunk/GSASIIphsGUI.py
r2063 r2064 2387 2387 try: 2388 2388 val = float(Obj.GetValue()) 2389 if waveType in ['ZigZag','Block'] and Stype == 'Spos' and ival < 2 :2389 if waveType in ['ZigZag','Block'] and Stype == 'Spos' and ival < 2 and not iwave: 2390 2390 if ival == 1: #Tmax 2391 2391 val = min(1.0,max(0.0,val)) … … 2412 2412 waveHead.Add(wx.StaticText(waveData,label=typeName+' modulation parameters: '),0,WACV) 2413 2413 waveAdd = wx.CheckBox(waveData,label='Add wave?') 2414 waveAdd.Bind(wx.EVT_CHECKBOX, OnAddWave)2415 Indx[waveAdd.GetId()] = [iatm,Stype]2416 waveHead.Add(waveAdd,0,WACV)2417 2414 waveAdd.Bind(wx.EVT_CHECKBOX, OnAddWave) 2418 2415 Indx[waveAdd.GetId()] = [iatm,Stype] -
trunk/GSASIIstrIO.py
r2062 r2064 917 917 cx,ct,cs,cia = General['AtomPtrs'] 918 918 print >>pFile,'\n Modulation waves' 919 names = {'Sfrac':['Fsin','Fcos','Fzero','Fwid'],'Spos':['Xsin','Ysin','Zsin','Xcos','Ycos','Zcos','T zero','Xslope','Yslope','Zslope'],919 names = {'Sfrac':['Fsin','Fcos','Fzero','Fwid'],'Spos':['Xsin','Ysin','Zsin','Xcos','Ycos','Zcos','Tmin','Tmax','Xmax','Ymax','Zmax'], 920 920 'Sadp':['U11sin','U22sin','U33sin','U12sin','U13sin','U23sin','U11cos','U22cos', 921 921 'U33cos','U12cos','U13cos','U23cos'],'Smag':['MXsin','MYsin','MZsin','MXcos','MYcos','MZcos']} … … 928 928 print >>pFile,' atom: %s, site sym: %s, type: %s wave type: %s:' \ 929 929 %(at[ct-1],at[cs],Stype,AtomSS['waveType']) 930 for iw,wave in enumerate(Waves): 930 931 line = '' 931 for item in names[Stype]: 932 line += '%8s '%(item) 932 if AtomSS['waveType'] in ['Block','ZigZag'] and Stype == 'Spos' and not iw: 933 for item in names[Stype][6:]: 934 line += '%8s '%(item) 935 else: 936 if Stype == 'Spos': 937 for item in names[Stype][:6]: 938 line += '%8s '%(item) 939 else: 940 for item in names[Stype]: 941 line += '%8s '%(item) 933 942 print >>pFile,line 934 for wave in Waves:935 943 line = '' 936 944 for item in wave[0]:
Note: See TracChangeset
for help on using the changeset viewer.