-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake_it_a_gro.py
46 lines (34 loc) · 1.48 KB
/
make_it_a_gro.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python
#import pyiast
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import math
import fileinput
import os.path
import scipy
import csv
from scipy import signal
#from string import lower
""" The goal is to make sepatrate maps of the gme an kno pores of the INDEXC structures in order to be presented in a different color
We read Structre*dat files (which have been made by invoking the pandasfromXYZ.sh script) and set the center positions of gme and kno cavities"""
"""read the splitted isotherm files and collect them in a single file which contains a common set molar concentration steps and the uptakes in cc/g, on each ZIF for the given concentrations. We use an interpolator for the concentration range [01], Datas are not smooth"""
color_key = {'all':'b', 'kno':'r', 'gme':'g'}
def main():
file_to_read="cone_to_gro.dat"
structure=pd.read_csv(file_to_read, sep=' ')
structure.head()
print(structure)
data=structure.values
file_to_gromacs="my_cone.gro"
OUT=open(file_to_gromacs,'w')
OUT.write("Generated by Anastasios Gotzias all carbon structure\n "+str(len(data))+"\n")
for index, line in enumerate(data):
outline="%5i%-5s%5s%5i%8.3f%8.3f%8.3f" %(1,"CNT",line[0],index,float(line[1]/10.0),float(line[2]/10.0)\
,float(line[3]/10.0))
OUT.write(outline+"\n")
outline=" 10 10 10\n"
OUT.write(outline+"\n")
exit(0)
if __name__ == "__main__":
main()