Created
July 12, 2015 03:04
-
-
Save leelasd/dcaa4af3de566a38094a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
import pandas as pd | |
df=pd.read_csv('Best_LJS_Zn.csv') | |
df.SIG=df.SIG*0.1 | |
df.EPS=df.EPS*4.184 | |
with open("top.top", "r") as f: | |
lines = f.readlines() | |
for i in range(len(df.SIG)): | |
SIGMA='%.5e'%df.SIG[i] | |
EPSILON='%.5e'%df.EPS[i] | |
new_line=[] | |
for line in lines: | |
line=string.replace(line,'SIGMASIGMAL',SIGMA,2) | |
line=string.replace(line,'EPSILONEPSI',EPSILON,2) | |
new_line.append(line) | |
clean_lines = [l.strip() for l in new_line if l.strip()] | |
outfile='TOPS/topol.top_'+str(i) | |
with open(outfile, "w") as f: | |
f.writelines('\n'.join(clean_lines)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment