Changeset 4199 for trunk/GSASIIpwd.py


Ignore:
Timestamp:
Dec 10, 2019 9:45:16 AM (23 months ago)
Author:
vondreele
Message:

enhance MakeRMC6f for RMCProfile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r4196 r4199  
    21502150    newPhase['General']['Cell'][1:] = G2lat.TransformCell(Cell,Trans.T)
    21512151    newPhase,Atcodes = G2lat.TransformPhase(Phase,newPhase,Trans,np.zeros(3),np.zeros(3),ifMag=False)
     2152    Natm = np.core.defchararray.count(np.array(Atcodes),'+')    #no. atoms in original unit cell
     2153    Natm = np.count_nonzero(Natm-1)
    21522154    Atoms = newPhase['Atoms']
     2155    NAtype = np.zeros(len(Atseq))
     2156    for atom in Atoms:
     2157        NAtype[Atseq.index(atom[1])] += 1
     2158    NAstr = ['%d'%i for i in NAtype]
    21532159    Cell = newPhase['General']['Cell'][1:7]
    21542160    fname = Name+'.rmc6f'
     
    21572163    for item in Meta:
    21582164        fl.write('%-20s%s\n'%('Metadata '+item+':',Meta[item]))
     2165    fl.write('Atom types present:             %s\n'%'    '.join(Atseq))
     2166    fl.write('Number of each atom type:       %s\n'%'  '.join(NAstr))
     2167    fl.write('Number of atoms:                %d\n'%len(Atoms))
    21592168    fl.write('%-35s%3d%3d%3d\n'%('Supercell dimensions:',Supercell[0],Supercell[1],Supercell[2]))
    21602169    fl.write('Cell (Ang/deg): %12.6f%12.6f%12.6f%12.6f%12.6f%12.6f\n'%(
    21612170            Cell[0],Cell[1],Cell[2],Cell[3],Cell[4],Cell[5]))
    21622171    A,B = G2lat. cell2AB(Cell)
    2163     fl.write('Lattice vectors (Ang):\n')
     2172    fl.write('Lattice vectors (Ang):\n')   
    21642173    for i in [0,1,2]:
    21652174        fl.write('%12.6f%12.6f%12.6f\n'%(A[i,0],A[i,1],A[i,2]))
    21662175    fl.write('Atoms (fractional coordinates):\n')
    2167     Natm = np.core.defchararray.count(np.array(Atcodes),'+')
    2168     Natm = np.count_nonzero(Natm-1)
    21692176    nat = 0
    21702177    for atm in Atseq:
Note: See TracChangeset for help on using the changeset viewer.