Skip to content

Commit

Permalink
changes before prepare_mols
Browse files Browse the repository at this point in the history
  • Loading branch information
svela-bs committed Feb 23, 2024
1 parent 6e67267 commit 3161d47
Show file tree
Hide file tree
Showing 13 changed files with 222 additions and 5,461 deletions.
2 changes: 1 addition & 1 deletion cell2mol/c2m_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from cell2mol.c2m_module import save_cell, cell2mol
from cell2mol.cif2info import cif_2_info
from cell2mol.classes import *
from cell2mol.readwrite import readinfo
from cell2mol.cell2mol.read_write import readinfo

if __name__ != "__main__" and __name__ != "cell2mol.c2m_driver": sys.exit(1)

Expand Down
35 changes: 35 additions & 0 deletions cell2mol/cell_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,38 @@ def cart2frac(cartCoords, cellvec):
newcoord.append([float(newx), float(newy), float(newz)])

return newcoord

#######################################################
def translate(vector, coords, cellvec):
""" Translate coordinates by a vector
Args:
vector (list): list of vector components
coords (list): list of coordinates
cellvec (list): list of cell vectors
Returns:
newcoord (list): list of translated coordinates
"""

newcoord = []
for idx, coord in enumerate(coords):
newx = (
coord[0]
+ vector[0] * cellvec[0][0]
+ vector[1] * cellvec[1][0]
+ vector[2] * cellvec[2][0]
)
newy = (
coord[1]
+ vector[0] * cellvec[0][1]
+ vector[1] * cellvec[1][1]
+ vector[2] * cellvec[2][1]
)
newz = (
coord[2]
+ vector[0] * cellvec[0][2]
+ vector[1] * cellvec[1][2]
+ vector[2] * cellvec[2][2]
)
newcoord.append([float(newx), float(newy), float(newz)])

return newcoord
File renamed without changes.
187 changes: 0 additions & 187 deletions cell2mol/cellconversions.py

This file was deleted.

Loading

0 comments on commit 3161d47

Please sign in to comment.