Ignore:
Timestamp:
Nov 3, 2014 2:48:51 PM (8 years ago)
Author:
vondreele
Message:

use deepcopy for various copy operations in G2ddataGUI
use complementary colors to background for cell edges
trap superlattice in cubics
more fixes to cell indexing routines from possible use of superlattice
add HStrainVals to G2spc
use it (maybe) in G2strIO, Math
make arguments for GetReflPos? & GetReflPosDeriv? the same (use A not G)
add GetDij? to G2strMath
topas xye file comments start with "'" sometimes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r1498 r1559  
    13701370    return sigDict,gamDict
    13711371       
    1372 def GetReflPos(refl,wave,G,hfx,calcControls,parmDict):
     1372def GetReflPos(refl,wave,A,hfx,calcControls,parmDict):
    13731373    'Needs a doc string'
    13741374    h,k,l = refl[:3]
    1375     dsq = 1./G2lat.calc_rDsq2(np.array([h,k,l]),G)
    1376     d = np.sqrt(dsq)
     1375    d = 1./np.sqrt(G2lat.calc_rDsq(np.array([h,k,l]),A))
    13771376
    13781377    refl[4] = d
     
    14891488    return dDijDict
    14901489   
     1490def GetDij(phfx,SGData,parmDict):
     1491    HSvals = [parmDict[phfx+name] for name in G2spc.HStrainNames(SGData)]
     1492    return G2spc.HStrainVals(HSvals,SGData)
     1493               
    14911494def GetFobsSq(Histograms,Phases,parmDict,calcControls):
    14921495    'Needs a doc string'
     
    15961599        bet = parmDict[hfx+'beta-0']+parmDict[hfx+'beta-1']/refl[4]**4+parmDict[hfx+'beta-q']/refl[4]**2
    15971600        return alp,bet
    1598                
     1601       
    15991602    hId = Histogram['hId']
    16001603    hfx = ':%d:'%(hId)
     
    16241627        SGData = Phase['General']['SGData']
    16251628        SGMT = np.array([ops[0].T for ops in SGData['SGOps']])
    1626         A = [parmDict[pfx+'A%d'%(i)] for i in range(6)]     #Do I want to modify by Dij?
     1629        A = [parmDict[pfx+'A%d'%(i)] for i in range(6)] #+GetDij(phfx,SGData,parmDict)
    16271630        G,g = G2lat.A2Gmat(A)       #recip & real metric tensors
    16281631        GA,GB = G2lat.Gmat2AB(G)    #Orthogonalization matricies
     
    16381641                h,k,l = refl[:3]
    16391642                Uniq = np.inner(refl[:3],SGMT)
    1640                 refl[5] = GetReflPos(refl,wave,G,hfx,calcControls,parmDict)         #corrected reflection position
     1643                refl[5] = GetReflPos(refl,wave,A,hfx,calcControls,parmDict)         #corrected reflection position
    16411644                Lorenz = 1./(2.*sind(refl[5]/2.)**2*cosd(refl[5]/2.))           #Lorentz correction
    16421645                refl[5] += GetHStrainShift(refl,SGData,phfx,hfx,calcControls,parmDict)               #apply hydrostatic strain shift
     
    16781681                h,k,l = refl[:3]
    16791682                Uniq = np.inner(refl[:3],SGMT)
    1680                 refl[5] = GetReflPos(refl,0.0,G,hfx,calcControls,parmDict)         #corrected reflection position
     1683                refl[5] = GetReflPos(refl,0.0,A,hfx,calcControls,parmDict)         #corrected reflection position
    16811684                Lorenz = sind(parmDict[hfx+'2-theta']/2)*refl[4]**4                                                #TOF Lorentz correction
    16821685                refl[5] += GetHStrainShift(refl,SGData,phfx,hfx,calcControls,parmDict)               #apply hydrostatic strain shift
     
    17831786        pfx = '%d::'%(pId)
    17841787        phfx = '%d:%d:'%(pId,hId)
    1785         A = [parmDict[pfx+'A%d'%(i)] for i in range(6)]     #And modify here by Dij? - no
     1788        A = [parmDict[pfx+'A%d'%(i)] for i in range(6)] #+GetDij(phfx,SGData,parmDict)
    17861789        G,g = G2lat.A2Gmat(A)       #recip & real metric tensors
    17871790        GA,GB = G2lat.Gmat2AB(G)    #Orthogonalization matricies
Note: See TracChangeset for help on using the changeset viewer.