Changeset 5009


Ignore:
Timestamp:
Aug 5, 2021 8:52:37 AM (4 months ago)
Author:
vondreele
Message:

add 'det2thet' to image importers data dict.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r5002 r5009  
    17301730    Am = np.array(MSSdata[3:]).T[:,0,:]   #atoms x cos mag mods; only 1 wave used
    17311731    Bm = np.array(MSSdata[:3]).T[:,0,:]   #...sin mag mods
    1732     SGMT = np.array([ops[0] for ops in SGData['SGOps']])        #not .T!!
     1732    SGMT = np.array([ops[0].T for ops in SGData['SGOps']])        #not .T!!
    17331733    Sinv = np.array([nl.inv(ops[0]) for ops in SSGData['SSGOps']])
    17341734    SGT = np.array([ops[1] for ops in SSGData['SSGOps']])
     
    17441744        Sinv = np.vstack((Sinv,Sinv))
    17451745        SGT = np.vstack((SGT,SGT+np.array([0.,0.,0.,.5])))%1.
     1746    AMR = np.swapaxes(np.inner(Am,SGMT),0,1)        #Nops,Natm,Mxyz
     1747    BMR = np.swapaxes(np.inner(Bm,SGMT),0,1)
    17461748    epsinv = Sinv[:,3,3]
    17471749    mst = np.inner(Sinv[:,:3,:3],modQ)-epsinv[:,nxs]*modQ   #van Smaalen Eq. 3.3
    17481750    phi = np.inner((XYZ-SGT[:,:3][nxs,:,:]),modQ).T
    17491751    TA = np.sum(mst[nxs,:,:]*(XYZ-SGT[:,:3][nxs,:,:]),axis=-1).T
    1750     phase =  TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs])-SGT[:,3][nxs,:,nxs]+phi[nxs,:,:]   #+,+,+ best for DyMnGe
     1752    phase =  TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs]+phi[nxs,:,:])-SGT[:,3][nxs,:,nxs]
    17511753    psin = np.sin(twopi*phase)      #tau,ops,atms
    17521754    pcos = np.cos(twopi*phase)
    1753     MmodAR = Am[nxs,nxs,:,:]*pcos[:,:,:,nxs]    #Re cos term; tau,ops,atms, Mxyz
    1754     MmodBR = Bm[nxs,nxs,:,:]*psin[:,:,:,nxs]    #Re sin term
    1755     MmodAR = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAR[:,:,:,nxs,:],axis=-1)
    1756     MmodBR = np.sum(SGMT[nxs,:,nxs,:,:]*MmodBR[:,:,:,nxs,:],axis=-1)
    1757     MmodAI = Am[nxs,nxs,:,:]*psin[:,:,:,nxs]    #Im cos term
    1758     MmodBI = Bm[nxs,nxs,:,:]*pcos[:,:,:,nxs]    #Im sin term
    1759     MmodAI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAI[:,:,:,nxs,:],axis=-1)
    1760     MmodBI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodBI[:,:,:,nxs,:],axis=-1)
     1755    MmodAR = AMR[nxs,:,:,:]*pcos[:,:,:,nxs]         #Re cos term; tau,ops,atms, Mxyz
     1756    MmodBR = BMR[nxs,:,:,:]*psin[:,:,:,nxs]         #Re sin term
     1757    MmodAI = AMR[nxs,:,:,:]*psin[:,:,:,nxs]         #Im cos term
     1758    MmodBI = BMR[nxs,:,:,:]*pcos[:,:,:,nxs]         #Im sin term
    17611759    return MmodAR,MmodBR,MmodAI,MmodBI    #Ntau,Nops,Natm,Mxyz; Re, Im cos & sin parts
    17621760       
  • trunk/GSASIIstrMath.py

    r5001 r5009  
    16181618            MF = refDict['FF']['MF'][iBeg:iFin].T[Tindx].T   #Nref,Natm
    16191619            TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Mdata*Fdata*MF/(2*Nops)     #Nref,Natm
    1620             HM = np.inner(Bmat,HP.T)                #put into cartesian space X||H,Z||H*L;
     1620            HM = np.inner(Bmat.T,HP.T)                #put into cartesian space X||H,Z||H*L;
    16211621            eM = (HM*refl.T[5]).T                   # normalize HP by d*    Nref,hkl=Unit vectors || Q
    16221622
     
    16271627            fams = TMcorr[:,nxs,nxs,:,nxs]*SGData['MagMom'][nxs,nxs,:,nxs,nxs]*np.array([np.where(H[3,i]!=0,(
    16281628                (MmodAR+H[3,i]*MmodBR)*cosm[i,nxs,:,:,nxs]+   
    1629                 GamI[nxs,:,nxs,nxs]*(-MmodAI+H[3,i]*MmodBI)*sinm[i,nxs,:,:,nxs]),
     1629                GamI[nxs,:,nxs,nxs]*(MmodAI-H[3,i]*MmodBI)*sinm[i,nxs,:,:,nxs]),
    16301630                0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
    16311631                       
    16321632            fbms = TMcorr[:,nxs,nxs,:,nxs]*SGData['MagMom'][nxs,nxs,:,nxs,nxs]*np.array([np.where(H[3,i]!=0,(
    16331633                (MmodAR+H[3,i]*MmodBR)*sinm[i,nxs,:,:,nxs]+   
    1634                 GamI[nxs,:,nxs,nxs]*(MmodAI-H[3,i]*MmodBI)*cosm[i,nxs,:,:,nxs]),
     1634                GamI[nxs,:,nxs,nxs]*(-MmodAI+H[3,i]*MmodBI)*cosm[i,nxs,:,:,nxs]),
    16351635                0.) for i in range(mRef)])/2.          #Nref,Ntau,Nops,Natm,Mxyz
    16361636           
     
    16401640                               
    16411641#sum ops & atms                               
    1642             fasm = np.sum(np.sum(fams,axis=-2),axis=-2)    #Nref,Mxyz; sum ops & atoms
     1642            fasm = np.sum(np.sum(fams,axis=-2),axis=-2)    #Nref,Ntau,Mxyz; sum ops & atoms
    16431643            fbsm = np.sum(np.sum(fbms,axis=-2),axis=-2)
    16441644# #put into cartesian space
    1645             facm = np.inner(fasm,uBmat)       #uBmat best fit for DyMnGe
    1646             fbcm = np.inner(fbsm,uBmat)
     1645            facm = np.inner(fasm,uAmat)       #uBmat best fit for DyMnGe
     1646            fbcm = np.inner(fbsm,uAmat)
    16471647#form e.F dot product
    16481648            eDotFa = np.sum(eM[:,nxs,:]*facm,axis=-1)    #Nref,Ntau       
  • trunk/imports/G2img_1TIF.py

    r4920 r5009  
    360360    samplechangerpos = (not samplechangerpos) and 0.0 or samplechangerpos
    361361    data = {'pixelSize':pixy,'wavelength':wavelength,'distance':distance,'center':center,'size':sizexy,
    362             'setdist':distance,'PolaVal':[polarization,False],'samplechangerpos':samplechangerpos}
     362            'setdist':distance,'PolaVal':[polarization,False],'samplechangerpos':samplechangerpos,'det2theta':0.0}
    363363    File.close()   
    364364    return head,data,Npix,image
  • trunk/imports/G2img_ADSC.py

    r3136 r5009  
    7171                center[1] = float(line.split('=')[1])
    7272            head.append(line)
    73     data = {'pixelSize':pixel,'wavelength':wave,'distance':distance,'center':center,'size':[size,size]}
     73    data = {'pixelSize':pixel,'wavelength':wave,'distance':distance,'center':center,'size':[size,size],'det2theta':0.0}
    7474    image = []
    7575    pos = 512
  • trunk/imports/G2img_CheMin.py

    r3136 r5009  
    5151            pixy = list(self.Image.shape)
    5252            sizexy = [40.,40.]
    53             self.Data = {'wavelength': 1.78892, 'pixelSize': sizexy, 'distance': 18.0,'size':pixy}
     53            self.Data = {'wavelength': 1.78892, 'pixelSize': sizexy, 'distance': 18.0,'size':pixy,'det2theta':0.0}
    5454            self.Data['center'] = [pixy[0]*sizexy[0]/1000.,pixy[1]*sizexy[1]/2000.]
    5555        self.LoadImage(ParentFrame,filename)
  • trunk/imports/G2img_GE.py

    r4112 r5009  
    195195            sum = False
    196196    image = np.reshape(image,(sizexy[1],sizexy[0]))
    197     data = {'pixelSize':[200.,200.],'wavelength':0.15,'distance':250.0,'center':[204.8,204.8],'size':sizexy}
     197    data = {'pixelSize':[200.,200.],'wavelength':0.15,'distance':250.0,'center':[204.8,204.8],'size':sizexy,'det2theta':0.0}
    198198    File.close()
    199199    if GSASIIpath.GetConfigValue('debug'):
  • trunk/imports/G2img_HDF5.py

    r3361 r5009  
    133133        Npix = sizexy[0]*sizexy[1]
    134134        data = {'pixelSize':[74.8,74.8],'wavelength':0.15,'distance':1000.,
    135                 'center':[sizexy[0]*0.1,sizexy[1]*0.1],'size':sizexy}
     135                'center':[sizexy[0]*0.1,sizexy[1]*0.1],'size':sizexy,'det2theta':0.0}
    136136        for item in self.Comments:
    137137            name,val = item.split(':',1)
  • trunk/imports/G2img_MAR.py

    r4112 r5009  
    7272        if line:
    7373            head.append(line)
    74     data = {'pixelSize':pixel,'wavelength':wave,'distance':distance,'center':center}
     74    data = {'pixelSize':pixel,'wavelength':wave,'distance':distance,'center':center,'det2theta':0.0}
    7575    for line in head:
    7676        if 'FORMAT' in line[0:6]:
  • trunk/imports/G2img_Rigaku.py

    r3136 r5009  
    6969        pixSize = [50.,50.]
    7070    image = np.reshape(image,(sizexy[1],sizexy[0]))       
    71     data = {'pixelSize':pixSize,'wavelength':1.5428,'distance':250.0,'center':[150.,150.],'size':sizexy
     71    data = {'pixelSize':pixSize,'wavelength':1.5428,'distance':250.0,'center':[150.,150.],'size':sizexy,'det2theta':0.0
    7272    File.close()   
    7373    if imageOnly:
  • trunk/imports/G2img_SFRM.py

    r4339 r5009  
    116116    image = np.reshape(img,(sizexy[1],sizexy[0]))
    117117    print ('import time: %.3f'%(time.time()-time0))
    118     data = {'pixelSize':pixSize,'wavelength':wave,'distance':dist,'center':cent,
     118    data = {'pixelSize':pixSize,'wavelength':wave,'distance':dist,'center':cent,,'det2theta':0.0,
    119119            'size':sizexy,'target':target,'tilt':-twoth,'rotation':90.,'twoth':str(round(twoth,1))}
    120120    data['pixLimit'] = 5
Note: See TracChangeset for help on using the changeset viewer.