def tordiff(tors1, tors2): Angle = periodnumber.genPNclass(-math.pi, math.pi) return max([abs(Angle(x1-x2)) for x1, x2 in zip(tors1, tors2)])
# $Id$ from itcc.tools.periodnumber import genPNclass __revision__ = '$Rev$' __all__ = ['Angle'] Angle = genPNclass(-180.0, 180.0) Angle.__name__ = 'Angle'
# $Id$ '''calculate the torsion diff of two cycloalkane''' import sys import math from itcc.tools import periodnumber from itcc.molecule import read, molecule, tools from itcc.ccs2 import detectloop, tordiff __revision__ = '$Rev$' __all__ = ['catordiff'] debug = False Angle = periodnumber.genPNclass(-math.pi, math.pi) def catordiff(mol1, mol2, loop=None): assert isinstance(mol1, molecule.Molecule) assert isinstance(mol2, molecule.Molecule) tors1 = getlooptor(mol1, loop) tors2 = getlooptor(mol2, loop) return tordiff.torsdiff(tors1, tors2, True, 0, 1) def getlooptor(mol, loop): if loop is None: loops = detectloop.loopdetect(mol) assert len(loops) == 1 loop = loops[0] return tools.calclooptor(mol, loop)