traj2xyz

#!/usr/bin/env python
import os
import tempfile
from optparse import OptionParser
 
from ase.io.trajectory import PickleTrajectory
from ase.io import write
 
cmd = OptionParser(usage = '%prog input_traj_file output_xyz_file')
 
(opt, argv) = cmd.parse_args()
 
if len(argv) != 2:
    cmd.print_help()
    raise SystemExit
 
trajfile = argv[0]
xyzfile = argv[1]
 
traj1 = PickleTrajectory(trajfile)
atoms1 = [] 
for it in traj1:
  atoms1.append(it)
 
write(xyzfile, images = atoms1, format = 'xyz', comment = trajfile)

Usage

$ traj2xyz
usage: input_traj_file output_xyz_file
$
script/traj2xyz.txt · 最終更新: 2014/06/17 16:50 by kimi
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0