Changeset 2041 for trunk/GSASIImath.py


Ignore:
Timestamp:
Nov 9, 2015 1:20:47 PM (7 years ago)
Author:
vondreele
Message:

enter space group (R -3 c) for Alumina image calibrant - gives better set of lines
some revision to SS derivatives
add ImageJ format (both big & little endian) to tiff importer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r2040 r2041  
    991991    '''
    992992    H: array ops X hklt proj to hkl
     993    HP: array nRefBlk x ops X hklt proj to hkl
    993994    FSSdata: array 2 x atoms x waves    (sin,cos terms)
     995    Hij: array 3x3
    994996    XSSdata: array 2x3 x atoms X waves (sin,cos terms)
    995997    USSdata: array 2x6 x atoms X waves (sin,cos terms)
     
    10381040    Xmod = np.sum(XmodA+XmodB+XmodZ,axis=1)                #atoms X pos X 32; sum waves
    10391041    Xmod = np.swapaxes(Xmod,1,2)
    1040     D = H[:,3][:,nxs]*glTau[nxs,:]              #m*e*tau; ops X 32
    1041     HdotX = np.inner(HP,Xmod)+D[:,nxs,:]     #refBlk X ops x atoms X 32
     1042    D = twopi*H[:,3][:,nxs]*glTau[nxs,:]              #m*e*tau; ops X 32
     1043    HdotX = twopi*np.inner(HP,Xmod)+D[:,nxs,:]        #ops x atoms X 32
     1044    HdotXD = HdotX+D[:,nxs,:]
     1045    HdotXA = HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodA,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs]  #ops x atoms x waves x 32 x xyz
     1046    HdotXB = HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodB,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs]
    10421047    if Af.shape[1]:
    10431048        tauF = np.arange(1.,Af.shape[1]+1-nf)[:,nxs]*glTau  #Fwaves x 32
     
    10551060        UmodA = Au[:,:,:,:,nxs]*StauU #atoms x waves x 3x3 x 32
    10561061        UmodB = Bu[:,:,:,:,nxs]*CtauU #ditto
    1057         Umod = np.swapaxes(np.sum(UmodA+UmodB,axis=1),1,3)      #atoms x 3x3 x 32; sum waves
    1058         HbH = np.exp(-np.sum(HP[:,nxs,nxs]*np.inner(HP[:],Umod),axis=-1)) # ops x atoms x 32 add Overhauser corr.?
    1059         #derivatives??
     1062        Umod = np.swapaxes((UmodA+UmodB),2,4)      #atoms x waves x 32 x 3x3 (symmetric so I can do this!)
     1063        HuH = np.sum(HP[:,nxs,nxs,nxs]*np.inner(HP[:],Umod),axis=-1)    #ops x atoms x waves x 32
     1064        HbH = np.exp(-np.sum(HuH,axis=-2)) # ops x atoms x 32; sum waves
     1065#derivs need to be ops x atoms x waves x 6uij; ops x atoms x waves x 32 x 6uij before sum
     1066        StauU = np.rollaxis(np.rollaxis(np.swapaxes(StauU,2,4),-1),-1)
     1067        CtauU = np.rollaxis(np.rollaxis(np.swapaxes(CtauU,2,4),-1),-1)
     1068        dUdAu = Hij[:,nxs,nxs,nxs,:]*np.rollaxis(G2lat.UijtoU6(StauU),0,4)[nxs,:,:,:,:]    #ops x atoms x waves x 32 x 6Uij
     1069        dUdBu = Hij[:,nxs,nxs,nxs,:]*np.rollaxis(G2lat.UijtoU6(CtauU),0,4)[nxs,:,:,:,:]    #ops x atoms x waves x 32 x 6Uij
     1070        part1 = -HuH*np.exp(-HuH)*Fmod[:,:,nxs,:]    #ops x atoms x waves x 32
     1071        dGdMuCa = np.sum(part1[:,:,:,:,nxs]*dUdAu*np.cos(HdotXD)[:,:,nxs,:,nxs]*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   #ops x atoms x waves x 6uij; G-L sum
     1072        dGdMuCb = np.sum(part1[:,:,:,:,nxs]*dUdBu*np.cos(HdotXD)[:,:,nxs,:,nxs]*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
     1073        dGdMuC = np.concatenate((dGdMuCa,dGdMuCb),axis=-1)   #ops x atoms x waves x 6uij; G-L sum
     1074        dGdMuSa = np.sum(part1[:,:,:,:,nxs]*dUdAu*np.sin(HdotXD)[:,:,nxs,:,nxs]*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   #ops x atoms x waves x 6uij; G-L sum
     1075        dGdMuSb = np.sum(part1[:,:,:,:,nxs]*dUdBu*np.sin(HdotXD)[:,:,nxs,:,nxs]*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
     1076        dGdMuS = np.concatenate((dGdMuSa,dGdMuSb),axis=-1)   #ops x atoms x waves x 6uij; G-L sum
    10601077    else:
    10611078        HbH = np.ones_like(HdotX)
    1062     HdotXA = HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodA,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs]  #ops x atoms x waves x 32 x xyz
    1063     HdotXB = HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodB,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs]
    10641079    dHdXA = HP[:,nxs,nxs,nxs,:]*np.swapaxes(StauX,-1,-2)[nxs,:,:,:,:]    #ops x atoms x waves x 32 x xyz
    10651080    dHdXB = HP[:,nxs,nxs,nxs,:]*np.swapaxes(CtauX,-1,-2)[nxs,:,:,:,:]              #ditto
Note: See TracChangeset for help on using the changeset viewer.