pwtools.crys.coord_trans3d¶
- pwtools.crys.coord_trans3d(coords, old=None, new=None, copy=True, axis=-1, timeaxis=0)[source]¶
Special case version for debugging mostly. It does the loop for the general case where coords+old+new are 3d arrays (e.g. variable cell MD trajectory).
This may be be slow for large
nstep
. All other cases (coords
has arbitrary many dimensions, i.e. ndarray + old/new are fixed) are covered by coord_trans(). Also some special cases may be possible to solve with np.dot() alone if the transformation simplifes. Check your math.- Parameters:
coords (3d array) – one axis (axis) must have length-M vectors, another (timeaxis) must be length nstep
old (2d arrays, two axes must be of equal length)
new (2d arrays, two axes must be of equal length)
copy (see coord_trans())
axis (axis where length-M vecs are placed if the timeaxis is removed)
timeaxis (time axis along which 2d arrays are aligned)
Examples
M = 3coords : (nstep,natoms,3)old,new : (nstep,3,3)timeaxis = 0axis = 1 == -1 (remove timeaxis -> 2d slices (natoms,3) and (3,3) -> axis=1)