adding property alias for Orientation class to simplify syntax.

This commit is contained in:
Chen Zhang 2015-08-04 20:38:06 +00:00
parent 905b9f8f42
commit dfe0991134
1 changed files with 8 additions and 2 deletions

View File

@ -790,30 +790,36 @@ class Orientation:
def asQuaternion(self):
return self.quaternion.asList()
quaternion = property(asQuaternion)
def asEulers(self,type='bunge'):
return self.quaternion.asEulers(type)
eulers = property(asEulers)
def asRodrigues(self):
return self.quaternion.asRodrigues()
rodrigues = property(asRodrigues)
def asAngleAxis(self):
return self.quaternion.asAngleAxis()
angleAxis = property(asAngleAxis)
def asMatrix(self):
return self.quaternion.asMatrix()
matrix = property(asMatrix)
def inFZ(self):
return self.symmetry.inFZ(self.quaternion.asRodrigues())
infz = property(inFZ)
def equivalentQuaternions(self):
return self.symmetry.equivalentQuaternions(self.quaternion)
equiQuaternions = property(equivalentQuaternions)
def equivalentOrientations(self):
return map(lambda q: Orientation(quaternion=q,symmetry=self.symmetry.lattice),
self.equivalentQuaternions())
equiOrientation = property(equivalentQuaternions)
def reduced(self):
'''