In [1]:
%matplotlib inline
import numpy as np
import exatomic
import bz2, os
if not hasattr(bz2, "open"):
bz2.open = bz2.BZ2File
In [3]:
xyz = exatomic.XYZ(exatomic.base.resource("H2O.traj.xyz"))
In [4]:
xyz.head()
In [5]:
xyz.tail()
In [6]:
len(xyz) // (192 + 2) # 192 atoms per frame plus 2 for the xyz file syntax
Out[6]:
In [7]:
xyz.atom.head()
Out[7]:
In [8]:
xyz.frame.head()
Out[8]:
In [9]:
xyz.frame.tail()
Out[9]:
In [10]:
for i, r in enumerate(("x", "y", "z")):
for j, q in enumerate(("i", "j", "k")):
if i == j:
xyz.frame[r+q] = 12.4/0.529
else:
xyz.frame[r+q] = 0.0
xyz.frame["o"+r] = 0.0
xyz.frame['periodic'] = True
In [11]:
xyz.atom.tail()
Out[11]:
In [12]:
np.all(xyz.atom.groupby("frame").size() == 192)
Out[12]:
In [13]:
uni = xyz.to_universe()
len(uni)
Out[13]:
In [14]:
uni.atom is xyz.atom
Out[14]:
In [15]:
uni.frame is xyz.frame
Out[15]:
In [16]:
%time uni.compute_atom_two()
In [17]:
uni.atom_two.shape
Out[17]:
In [18]:
uni.atom_two[uni.atom_two['bond'] == True].shape
Out[18]:
In [19]:
uni.network()
Out[19]:
In [20]:
uni.atom_two.dtypes
Out[20]:
In [21]:
exatomic.UniverseWidget(uni)
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: