# Changeset 1978

Ignore:
Timestamp:
Sep 24, 2015 4:34:39 PM (8 years ago)
Message:

fix to update reflections in HKLplot
remove ZigZag? from incommensurate list
add pylab to G2math if in debug mode
revisions to modulations anticipating Crenel & Sawtooth
fixes to SS structure factor calcs. Some success.

Location:
trunk
Files:
5 edited

Unmodified
Removed
• ## trunk/GSASIImath.py

 r1977 import scipy.optimize as so import pypowder as pwd if GSASIIpath.GetConfigValue('debug'): import pylab as pl sind = lambda x: np.sin(x*np.pi/180.) nf = 0 nx = 0 XmodZ = 0 FmodZ = 0 XmodZ = np.zeros((Ax.shape[0],Ax.shape[1],3,32)) FmodZ = np.zeros((Af.shape[0],Af.shape[1],32)) if 'Crenel' in waveTypes: nC = np.where('Crenel' in waveTypes) nf = 1 FmodC = 0   #replace #FmodZ = 0   replace else: nx = 1 if 'Sawtooth' in waveTypes: XmodZ = 0   #replace else: XmodZ = 0   #replace (use?) nS = np.where('Sawtooth' in waveTypes) #XmodZ = 0   replace if Af.shape[1]: tauF = np.arange(1.,Af.shape[1]+1-nf)[:,nxs]*glTau  #Fwaves x 32 FmodA = Af[:,nf:,nxs]*np.sin(twopi*tauF[nxs,:,:]) FmodA = Af[:,nf:,nxs]*np.sin(twopi*tauF[nxs,:,:])   #atoms X Fwaves X 32 FmodB = Bf[:,nf:,nxs]*np.cos(twopi*tauF[nxs,:,:]) Fmod = np.sum(FmodA+FmodB+FmodC,axis=1) Fmod = np.sum(FmodA+FmodB+FmodC,axis=1)             #atoms X 32; sum waves else: Fmod = 1.0
• ## trunk/GSASIIphsGUI.py

 r1964 iatm,item = Indx[Obj.GetId()] nt = numVals[Stype] if not len(atomData[iatm][-1][SS][item]) and waveType in ['ZigZag','Sawtooth'] and Stype == 'Spos': if not len(atomData[iatm][-1][SS][item]) and waveType in ['Sawtooth',] and Stype == 'Spos': nt = 4 atomData[iatm][-1][SS][item].append([[0.0 for i in range(nt)],False]) Waves = wx.FlexGridSizer(0,4,5,5) elif Stype == 'Spos': if waveType in ['ZigZag','Sawtooth'] and not iwave: if waveType in ['Sawtooth',] and not iwave: names = Names[6:] Waves = wx.FlexGridSizer(0,6,5,5) magNames = ['MXsin','MYsin','MZsin','MXcos','MYcos','MZcos'] fracNames = ['Fsin','Fcos','Fzero','Fwid'] waveTypes = ['Fourier','Sawtooth','ZigZag','Crenel/Fourier'] waveTypes = ['Fourier','Sawtooth','Crenel/Fourier'] Labels = {'Spos':posNames,'Sfrac':fracNames,'Sadp':adpNames,'Smag':magNames} mainSizer.Add(wx.StaticText(waveData,label=' Incommensurate propagation wave data:'),0,WACV)
• ## trunk/GSASIIplot.py

 r1976 ''' from matplotlib.patches import Circle,CirclePolygon global HKL,HKLF HKLref = hklRef global HKL,HKLF,HKLref def OnSCKeyPress(event): Data['Type'] = pwdrChoice[event.key] newPlot = True PlotSngl(G2frame,newPlot,Data,hklRef,Title) PlotSngl(G2frame,newPlot,Data,HKLref,Title) def OnSCMotion(event): HKLF = [] time0 = time.time() for refl in hklRef: for refl in HKLref: H = refl[:3] if 'HKLF' in Name:
• ## trunk/GSASIIstrIO.py

 r1956 stiw = str(i)+':'+str(iw) if Stype == 'Spos': if waveType in ['ZigZag','Sawtooth'] and not iw: if waveType in ['Sawtooth',] and not iw: names = [pfx+'Tzero:'+stiw,pfx+'Xslope:'+stiw,pfx+'Yslope:'+stiw,pfx+'Zslope:'+stiw] equivs = [[], [],[],[]] nt = 6 ot = 0 if waveType in ['Sawtooth','ZigZag'] and not iw: if waveType in ['Sawtooth',] and not iw: nt = 4 ot = 6 stiw = str(i)+':'+str(iw) if Stype == 'Spos': if waveType in ['ZigZag','Sawtooth'] and not iw: if waveType in ['Sawtooth',] and not iw: names = ['Tzero:'+stiw,'Xslope:'+stiw,'Yslope:'+stiw,'Zslope:'+stiw] else:
• ## trunk/GSASIIstrMath.py

 r1977 if parm in parmDict: keys[key][m][iatm] = parmDict[parm] return waveTypes,FSSdata,XSSdata,USSdata,MSSdata return np.array(waveTypes),FSSdata,XSSdata,USSdata,MSSdata def GetSSTauM(SGOps,SSOps,pfx,calcControls,XData): HM += H Uniq = np.inner(HM[:3],SGMT) SSUniq = np.inner(HM,SSGMT) SSUniq = np.inner(H,SSGMT) Phi = np.inner(HM[:3],SGT) SSPhi = np.inner(HM,SSGT) SSPhi = np.inner(H,SSGT) if SGInv:   #if centro - expand HKL sets Uniq = np.vstack((Uniq,-Uniq)) SSPhi = np.hstack((SSPhi,-SSPhi)) #        GSASIIpath.IPyBreak() GfpuA = G2mth.Modulation(waveTypes,SSUniq,FSSdata,XSSdata,USSdata,Mast) GfpuA = G2mth.Modulation(waveTypes,SSUniq,FSSdata,XSSdata,USSdata,Mast) #2 x sym X atoms phase = twopi*(np.inner(Uniq,(dXdata.T+Xdata.T))+SSPhi[:,np.newaxis]) sinp = np.sin(phase) Tcorr = Tiso*Tuij*Mdata*Fdata/len(Uniq) fa = np.array([(FF+FP-Bab)*cosp*Tcorr,-FPP*sinp*Tcorr])     #2 x sym x atoms fb = np.array([(FF+FP-Bab)*sinp*Tcorr,FPP*cosp*Tcorr]) fb = np.array([FPP*cosp*Tcorr,(FF+FP-Bab)*sinp*Tcorr])      #swapped around - better? fa *= GfpuA fb *= GfpuA fas = np.real(np.sum(np.sum(fa,axis=1),axis=1)) fbs = np.real(np.sum(np.sum(fb,axis=1),axis=1)) fas = np.sum(np.sum(fa,axis=1),axis=1) fbs = np.sum(np.sum(fb,axis=1),axis=1) fasq = fas**2 fbsq = fbs**2        #imaginary
Note: See TracChangeset for help on using the changeset viewer.