git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1691 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2008-03-31 22:28:11 +00:00
parent 8f8456fd3a
commit 93ed818975
13 changed files with 2760 additions and 0 deletions

32
tools/python/log2txt.py Executable file
View File

@ -0,0 +1,32 @@
#!/usr/local/bin/python
# Script: log2txt.py
# Purpose: extract thermo info from LAMMPS log file
# create a text file of numbers in columns, suitable for plotting
# Syntax: log2txt.py log.lammps data.txt X Y ...
# log.lammps = LAMMPS log file
# data.txt = text file to create
# X Y ... = columns to include (optional), X,Y are thermo keywords
# if no columns listed, all columns are included
# Author: Steve Plimpton (Sandia), sjplimp at sandia.gov
import sys,os
path = os.environ["LAMMPS_PYTHON_TOOLS"]
sys.path.append(path)
from log import log
if len(sys.argv) < 3:
raise StandardError, "Syntax: log2txt.py log.lammps data.txt X Y ..."
logfile = sys.argv[1]
datafile = sys.argv[2]
columns = sys.argv[3:]
lg = log(logfile)
if columns == []:
lg.write(datafile)
else:
str = "lg.write(datafile,"
for word in columns: str += '"' + word + '",'
str = str[:-1] + ')'
eval(str)