Changeset 3433


Ignore:
Timestamp:
Jun 13, 2018 12:58:28 PM (5 years ago)
Author:
vondreele
Message:

objectScanIgnore additions
put in phase fro mag reflections
better checkMagextc

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r3430 r3433  
    3131import math
    3232import numpy as np
     33import numpy.ma as ma
     34
    3335import copy
    3436import platform
     
    564566    return
    565567
    566 objectScanIgnore = [int,bool,float,str,np.float64,np.int64,np.ndarray,G2obj.G2VarObj]
     568objectScanIgnore = [int,bool,float,str,np.float64,np.int32,np.int64,np.ndarray,G2obj.G2VarObj,ma.MaskedArray]
    567569if '2' in platform.python_version_tuple()[0]:
    568570    objectScanIgnore += [unicode,long,]
  • trunk/GSASIIspc.py

    r3425 r3433  
    2929npcosd = lambda x: np.cos(x*np.pi/180.)
    3030nxs = np.newaxis
     31twopi = 2.0*np.pi
    3132DEBUG = False
    3233   
     
    19791980def checkMagextc(HKL,SGData):
    19801981    Ops = SGData['SGOps']
    1981     Spn = SGData['SpnFlp'][:len(Ops)]
    19821982    OpM = np.array([op[0] for op in Ops])
    19831983    OpT = np.array([op[1] for op in Ops])
     1984    if SGData['SGInv']:
     1985        OpM = np.vstack((OpM,-OpM))
     1986        OpT = np.vstack((OpT,-OpT))%1.
     1987    Spn = SGData['SpnFlp'][:len(OpM)]
    19841988    Mag = np.array([nl.det(opm) for opm in OpM])*Spn
    1985     HKLS = np.array([HKL,-HKL])     #Freidel's Law
    1986     DHKL = np.reshape(np.inner(HKLS,OpM)*Mag[nxs,:,nxs],(-1,3))
    1987     PHKL = np.reshape(np.inner(HKLS,OpT),(-1,))
    1988     for dhkl,phkl in zip(DHKL,PHKL)[1:]:    #skip identity
     1989    DHKL = np.reshape(np.inner(HKL,OpM),(-1,3))
     1990    PHKL = np.reshape(np.cos(twopi*np.inner(HKL,OpT))*Mag,(-1,))[:,nxs,nxs]*OpM
     1991    Ftest = np.random.rand(3)
     1992    Psum = np.zeros(3)
     1993    for dhkl,phkl in zip(DHKL,PHKL):
    19891994        if not np.allclose(dhkl,HKL):
    19901995            continue
    19911996        else:
    1992             print(dhkl,HKL,phkl)
    1993             if phkl%1.:
    1994                 return False
    1995     return True
     1997            Psum += np.inner(Ftest,phkl)
     1998    if np.allclose(Psum,np.zeros(3)):
     1999        return False
     2000    else:
     2001        if np.inner(HKL,Psum):
     2002            return False
     2003        return True
    19962004   
    19972005def checkSSextc(HKL,SSGData):
  • trunk/GSASIIstrMath.py

    r3423 r3433  
    10401040        refl.T[9] = np.sum(fams**2,axis=0)+np.sum(fbms**2,axis=0)
    10411041        refl.T[7] = np.copy(refl.T[9])               
    1042         refl.T[10] = 0.0    #atan2d(fbs[0],fas[0]) - what is phase for mag refl?
     1042        refl.T[10] = atan2d(fbms[0],fams[0]) #- what is phase for mag refl?
    10431043#        if 'P' in calcControls[hfx+'histType']:     #PXC, PNC & PNT: F^2 = A[0]^2 + A[1]^2 + B[0]^2 + B[1]^2
    10441044#            refl.T[9] = np.sum(fas**2,axis=0)+np.sum(fbs**2,axis=0) #add fam**2 & fbm**2 here   
Note: See TracChangeset for help on using the changeset viewer.