Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def aminer(fNameIn):
- f=open(fNameIn, 'r')
- c=f.readlines()
- atom=[]
- atomy={}
- print f.read()
- j=0
- k=0
- l=0
- for i in range(0,len(c)-1):
- if c[i][0:16]=='_atom_site_label':
- j=i
- atom.append(['_atom_site_label', 0,''])
- elif c[i][0:22]=='_atom_site_type_symbol':
- atom.append(['_atom_site_type_symbol', i-j, ''])
- elif c[i][0:18]=='_atom_site_fract_x':
- atom.append(['_atom_site_fract_x', i-j, ''])
- elif c[i][0:18]=='_atom_site_fract_y':
- atom.append(['_atom_site_fract_y', i-j, ''])
- elif c[i][0:18]=='_atom_site_fract_y':
- atom.append(['_atom_site_fract_y', i-j, ''])
- elif c[i][0:18]=='_atom_site_fract_z':
- atom.append(['_atom_site_fract_z', i-j, ''])
- print atom
- while c[j+k][0]!=' ':
- k+=1
- while c[j+k+l][0]==' ':
- for i in range(0,len(atom)):
- atom[i][2]=c[j+k+l].split()[atom[i][1]]
- print atom
- atomy['atom %s' %(l+1)]= atom
- l+=1
- print atomy
- aminer('test.cif')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement