Ignore:
Timestamp:
Apr 26, 2016 12:35:00 PM (5 years ago)
Author:
vondreele
Message:

fixes to Transform of unit cell contents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIlattice.py

    r2219 r2228  
    243243    invTrans = nl.inv(Trans)
    244244    newAtoms = FillUnitCell(oldPhase)
     245    Unit = [int(max(unit))-1 for unit in Trans]
     246    for i,unit in enumerate(Unit):
     247        if unit > 0:
     248            for j in range(unit):
     249                moreAtoms = copy.deepcopy(newAtoms)
     250                for atom in moreAtoms:
     251                    atom[cx+i] += 1.
     252                newAtoms += moreAtoms
    245253    for atom in newAtoms:
    246254        atom[cx:cx+3] = TransformXYZ(atom[cx:cx+3],invTrans.T,Vec)
     
    259267    SGData = Phase['General']['SGData']
    260268    cx,ct,cs,cia = Phase['General']['AtomPtrs']
     269    unit = np.zeros(3)
    261270    for atom in Atoms:
    262271        XYZ = np.array(atom[cx:cx+3])
     
    268277            for item in result:
    269278                if item[0][2] >= .95: item[0][2] -= 1.
    270                 atom[cx:cx+3] = item[0]+unit
     279                atom[cx:cx+3] = item[0]
    271280                atom[cia+2:cia+8] = item[1]
    272281                atomData.append(atom[:cia+9])  #not SS stuff
    273282        else:
    274             result = G2spc.GenAtom(XYZ,SGData,False,Move=True)
     283            result = G2spc.GenAtom(xyz,SGData,False,Move=True)
    275284            for item in result:
    276285                if item[0][2] >= .95: item[0][2] -= 1.
    277                 atom[cx:cx+3] = item[0]+unit
     286                atom[cx:cx+3] = item[0]
    278287                atomData.append(atom[:cia+9])  #not SS stuff
    279288    return atomData
     
    296305    XYZ = {}
    297306    for ind in range(Ind):
    298         XYZ[ind] = np.array(Atoms[ind][cx:cx+3])
     307        XYZ[ind] = np.array(Atoms[ind][cx:cx+3])%1.
    299308        Indx[ind] = True
    300309    for ind in range(Ind):
Note: See TracChangeset for help on using the changeset viewer.