本文整理汇总了Python中diffpy.Structure.Structure.placeInLattice方法的典型用法代码示例。如果您正苦于以下问题:Python Structure.placeInLattice方法的具体用法?Python Structure.placeInLattice怎么用?Python Structure.placeInLattice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类diffpy.Structure.Structure
的用法示例。
在下文中一共展示了Structure.placeInLattice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Atom
# 需要导入模块: from diffpy.Structure import Structure [as 别名]
# 或者: from diffpy.Structure.Structure import placeInLattice [as 别名]
Atom('C', [0, 0, 0]),
Atom('C', [1, 1, 1]),
Atom('C', [1, 2, 3]),
Atom('C', [3, 2, 1]),
])
print "stru1 uses the default coordinate system"
print "stru1.lattice.abcABG()=" + str(stru1.lattice.abcABG())
listCoordinates(stru1)
print
# The placeInLattice method sets a new coordinate system while preserving
# the same Cartesian positions of all atoms.
stru2 = Structure(stru1)
lattice2 = Lattice(5, 6, 7, 60, 70, 80)
stru2.placeInLattice(lattice2)
print "stru2 is a copy of stru1 placed in differenc lattice"
print "stru2.lattice.abcABG()=" + str(stru2.lattice.abcABG())
listCoordinates(stru2)
print
# Finally to place atom at a given Cartesian position, one can
# set its xyz_cartn attribute.
lattice3 = Lattice(6, 8, 9, 90, 90, 90)
stru3 = Structure(lattice=lattice3)
# add 4 carbon atoms
stru3.addNewAtom("C")
stru3.getLastAtom().xyz_cartn = (0, 0, 0)
stru3.addNewAtom("C")