# Path: condor/utils/log.py
# def log(logger, message, lvl, exception=None, rollback=1):
# def log_execution_time(logger):
#     def st_time(func):
#         def st_func(*args, **keyArgs):


import sys, numpy, types, pickle, time, math
import logging
import condor.utils.linalg
from .log import log_and_raise_error,log_warning,log_info,log_debug
        if values is None and formalism is None:
            # No rotation (rotation matrix = identity matrix)
            self.rotation_matrix = numpy.ones(shape=(3,3))
        elif formalism.startswith("euler_angles_") and len(formalism) == len("euler_angles_xyz"):
            self.set_with_euler_angles(values, rotation_axes=formalism[-3:])
        elif formalism == "rotation_matrix":
            self.set_with_rotation_matrix(values)
        elif formalism == "quaternion":
            self.set_with_quaternion(values)
        elif formalism in ["random","random_x","random_y","random_z"]:
            if values is not None:
                log_warning(logger, "Specified formalism=%s but values is not None." % formalism)

            self._set_as_random_formalism(formalism)
        else:
            log_and_raise_error(logger, "formalism=%s is not implemented" % formalism)
            return

    def set_with_euler_angles(self, euler_angles, rotation_axes="zxz"):
        r"""
        Set rotation with an array of three euler angles

        Args:
           :euler_angles: Array of the three euler angles representing consecutive rotations

        Kwargs:
           :rotation_axes(str): Rotation axes of the three consecutive rotations (default = \'zxz\') 
        """
        # Check input
        if euler_angles.size != 3:

# Path: condor/utils/log.py
# def log(logger, message, lvl, exception=None, rollback=1):
# def log_execution_time(logger):
#     def st_time(func):
#         def st_func(*args, **keyArgs):


# Path: condor/utils/rotation.py
import sys, numpy, types, pickle, time, math
import logging
import condor.utils.linalg
from .log import log_and_raise_error,log_warning,log_info,log_debug

        if values is None and formalism is None:
            # No rotation (rotation matrix = identity matrix)
            self.rotation_matrix = numpy.ones(shape=(3,3))
        elif formalism.startswith("euler_angles_") and len(formalism) == len("euler_angles_xyz"):
            self.set_with_euler_angles(values, rotation_axes=formalism[-3:])
        elif formalism == "rotation_matrix":
            self.set_with_rotation_matrix(values)
        elif formalism == "quaternion":
            self.set_with_quaternion(values)
        elif formalism in ["random","random_x","random_y","random_z"]:
            if values is not None:
                log_warning(logger, "Specified formalism=%s but values is not None." % formalism)

            self._set_as_random_formalism(formalism)
        else:
            log_and_raise_error(logger, "formalism=%s is not implemented" % formalism)
            return

    def set_with_euler_angles(self, euler_angles, rotation_axes="zxz"):
        r"""
        Set rotation with an array of three euler angles

        Args:
           :euler_angles: Array of the three euler angles representing consecutive rotations

        Kwargs:
           :rotation_axes(str): Rotation axes of the three consecutive rotations (default = \'zxz\') 
        """
        # Check input
        if euler_angles.size != 3:

            log_and_raise_error(logger, "Size of rotation variable does not match expected shape")