On 13 Jul, 2015, at 07:23,
contact.life...@gmail.com wrote:
1) How can I get xmin, xmax, y min and Y max values and delta value for my trajectory
If your trajectory contains unitcell information, look at Timestep.dimensions:
import numpy as np
maxL = np.zeros(3)
for ts in u.trajectory:
L = ts.dimensions[:3] # Lx, Ly, Lz
angles = ts.dimensions[3:] # alpha, beta, gamma -- not needed
replace = (maxL < L)
maxL[replace] = L[replace]
print("L: {0} maxL: {1}".format(L, maxL))
print("maximum dimensions: {}".format(maxL))
If you really need coordinates, use the same idea as above but instead of dimensions look at AtomGroup.bbox() ("bounding box" ). From the help:
Signature: u.atoms.bbox(**kwargs)
Docstring:
Return the bounding box of the selection.
The lengths A,B,C of the orthorhombic enclosing box are::
L = AtomGroup.bbox()
A,B,C = L[1] - L[0]
:Keywords:
*pbc*
``True``: Move all atoms within the primary unit cell before calculation [``False``]
In code:
bb = u.atoms.bbox()
L = bb[1] - bb[0]
and then as above.
Hope that helps,
Oliver