Changeset 1978


Ignore:
Timestamp:
Sep 24, 2015 4:34:39 PM (8 years ago)
Author:
vondreele
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

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r1977 r1978  
    3535import scipy.optimize as so
    3636import pypowder as pwd
     37if GSASIIpath.GetConfigValue('debug'):
     38    import pylab as pl
    3739
    3840sind = lambda x: np.sin(x*np.pi/180.)
     
    939941            nf = 0
    940942            nx = 0
    941             XmodZ = 0
    942             FmodZ = 0
     943            XmodZ = np.zeros((Ax.shape[0],Ax.shape[1],3,32))
     944            FmodZ = np.zeros((Af.shape[0],Af.shape[1],32))
    943945            if 'Crenel' in waveTypes:
     946                nC = np.where('Crenel' in waveTypes)
    944947                nf = 1
    945                 FmodC = 0   #replace
     948                #FmodZ = 0   replace
    946949        else:
    947950            nx = 1
    948951            if 'Sawtooth' in waveTypes:
    949                 XmodZ = 0   #replace
    950             else:
    951                 XmodZ = 0   #replace (use?)
     952                nS = np.where('Sawtooth' in waveTypes)
     953                #XmodZ = 0   replace
    952954        if Af.shape[1]:
    953955            tauF = np.arange(1.,Af.shape[1]+1-nf)[:,nxs]*glTau  #Fwaves x 32
    954             FmodA = Af[:,nf:,nxs]*np.sin(twopi*tauF[nxs,:,:])
     956            FmodA = Af[:,nf:,nxs]*np.sin(twopi*tauF[nxs,:,:])   #atoms X Fwaves X 32
    955957            FmodB = Bf[:,nf:,nxs]*np.cos(twopi*tauF[nxs,:,:])
    956             Fmod = np.sum(FmodA+FmodB+FmodC,axis=1)
     958            Fmod = np.sum(FmodA+FmodB+FmodC,axis=1)             #atoms X 32; sum waves
    957959        else:
    958960            Fmod = 1.0           
  • trunk/GSASIIphsGUI.py

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

    r1976 r1978  
    320320    '''
    321321    from matplotlib.patches import Circle,CirclePolygon
    322     global HKL,HKLF
     322    HKLref = hklRef
     323    global HKL,HKLF,HKLref
    323324   
    324325    def OnSCKeyPress(event):
     
    353354            Data['Type'] = pwdrChoice[event.key]           
    354355            newPlot = True       
    355         PlotSngl(G2frame,newPlot,Data,hklRef,Title)
     356        PlotSngl(G2frame,newPlot,Data,HKLref,Title)
    356357
    357358    def OnSCMotion(event):
     
    441442    HKLF = []
    442443    time0 = time.time()
    443     for refl in hklRef:
     444    for refl in HKLref:
    444445        H = refl[:3]
    445446        if 'HKLF' in Name:
  • trunk/GSASIIstrIO.py

    r1956 r1978  
    11681168                            stiw = str(i)+':'+str(iw)
    11691169                            if Stype == 'Spos':
    1170                                 if waveType in ['ZigZag','Sawtooth'] and not iw:
     1170                                if waveType in ['Sawtooth',] and not iw:
    11711171                                    names = [pfx+'Tzero:'+stiw,pfx+'Xslope:'+stiw,pfx+'Yslope:'+stiw,pfx+'Zslope:'+stiw]
    11721172                                    equivs = [[], [],[],[]]
     
    15861586                            nt = 6
    15871587                            ot = 0
    1588                             if waveType in ['Sawtooth','ZigZag'] and not iw:
     1588                            if waveType in ['Sawtooth',] and not iw:
    15891589                                nt = 4
    15901590                                ot = 6
     
    19051905                            stiw = str(i)+':'+str(iw)
    19061906                            if Stype == 'Spos':
    1907                                 if waveType in ['ZigZag','Sawtooth'] and not iw:
     1907                                if waveType in ['Sawtooth',] and not iw:
    19081908                                    names = ['Tzero:'+stiw,'Xslope:'+stiw,'Yslope:'+stiw,'Zslope:'+stiw]
    19091909                                else:
  • trunk/GSASIIstrMath.py

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