(self, rot=None, coord=None, inv=None, deg=True, eulertype="ZYX")
Create a rotator with given parameters.
        - rot: a float, a tuple of 1,2 or 3 floats or a sequence of tuples.
               If it is a sequence of tuple, it must have the same length as coord.
        - coord: a string or a tuple of 1 or 2 strings or a sequence of tuple
                 If it is a sequence of tuple, it must have same length as rot.
        - inv: whether to use inverse rotation or not
        - deg: if True, angles in rot are assumed in degree (default: True)
        - eulertype: the convention for Euler angles in rot.
        Note: the coord system conversion is applied first, then the rotation.
Create a rotator with given parameters.
        - rot: a float, a tuple of 1,2 or 3 floats or a sequence of tuples.
               If it is a sequence of tuple, it must have the same length as coord.
        - coord: a string or a tuple of 1 or 2 strings or a sequence of tuple
                 If it is a sequence of tuple, it must have same length as rot.
        - inv: whether to use inverse rotation or not
        - deg: if True, angles in rot are assumed in degree (default: True)
        - eulertype: the convention for Euler angles in rot.
        Note: the coord system conversion is applied first, then the rotation.
Create a rotator with given parameters . - rot : a float a tuple of 1 2 or 3 floats or a sequence of tuples . If it is a sequence of tuple it must have the same length as coord . - coord : a string or a tuple of 1 or 2 strings or a sequence of tuple If it is a sequence of tuple it must have same length as rot . - inv : whether to use inverse rotation or not - deg : if True angles in rot are assumed in degree ( default : True ) - eulertype : the convention for Euler angles in rot . Note : the coord system conversion is applied first then the rotation .
def __init__(self, rot=None, coord=None, inv=None, deg=True, eulertype="ZYX"):
        """Create a rotator with given parameters.
        - rot: a float, a tuple of 1,2 or 3 floats or a sequence of tuples.
               If it is a sequence of tuple, it must have the same length as coord.
        - coord: a string or a tuple of 1 or 2 strings or a sequence of tuple
                 If it is a sequence of tuple, it must have same length as rot.
        - inv: whether to use inverse rotation or not
        - deg: if True, angles in rot are assumed in degree (default: True)
        - eulertype: the convention for Euler angles in rot.
        Note: the coord system conversion is applied first, then the rotation.
        """
        rot_is_seq = hasattr(rot, "__len__") and hasattr(rot[0], "__len__")
        coord_is_seq = (
            hasattr(coord, "__len__")
            and hasattr(coord[0], "__len__")
            and type(coord[0]) is not str
        )
        if rot_is_seq and coord_is_seq:
            if len(rot) != len(coord):
                raise ValueError(Rotator.ErrMessWrongPar)
            else:
                rots = rot
                coords = coord
        elif (rot_is_seq or coord_is_seq) and (rot is not None and coord is not None):
            raise ValueError(Rotator.ErrMessWrongPar)
        else:
            rots = [rot]
            coords = [coord]
        inv_is_seq = hasattr(inv, "__len__")
        if inv_is_seq:
            if len(inv) != len(rots):
                raise ValueError("inv must have same length as rot and/or coord")
            invs = inv
        else:
            invs = [inv] * len(rots)
        # check the argument and normalize them
        if eulertype in ["ZYX", "X", "Y"]:
            self._eultype = eulertype
        else:
            self._eultype = "ZYX"
        self._rots = []
        self._coords = []
        self._invs = []
        for r, c, i in zip(rots, coords, invs):
            rn = normalise_rot(r, deg=deg)
            #            if self._eultype in ['X','Y']:
            #                rn[1] = -rn[1]
            cn = normalise_coord(c)
            self._rots.append(rn)  # append(rn) or insert(0, rn) ?
            self._coords.append(cn)  # append(cn) or insert(0, cn) ?
            self._invs.append(bool(i))
        if not self.consistent:
            log.warning("The chain of coord system rotations is not consistent")
        self._update_matrix()
def __init__ ( self , rot = None , coord = None , inv = None , deg = True , eulertype = "ZYX" ) : rot_is_seq = hasattr ( rot , "__len__" ) and hasattr ( rot [ 0 ] , "__len__" ) coord_is_seq = ( hasattr ( coord , "__len__" ) and hasattr ( coord [ 0 ] , "__len__" ) and type ( coord [ 0 ] ) is not str ) if rot_is_seq and coord_is_seq : if len ( rot ) != len ( coord ) : raise ValueError ( Rotator . ErrMessWrongPar ) else : rots = rot coords = coord elif ( rot_is_seq or coord_is_seq ) and ( rot is not None and coord is not None ) : raise ValueError ( Rotator . ErrMessWrongPar ) else : rots = [ rot ] coords = [ coord ] inv_is_seq = hasattr ( inv , "__len__" ) if inv_is_seq : if len ( inv ) != len ( rots ) : raise ValueError ( "inv must have same length as rot and/or coord" ) invs = inv else : invs = [ inv ] * len ( rots ) # check the argument and normalize them if eulertype in [ "ZYX" , "X" , "Y" ] : self . _eultype = eulertype else : self . _eultype = "ZYX" self . _rots = [ ] self . _coords = [ ] self . _invs = [ ] for r , c , i in zip ( rots , coords , invs ) : rn = normalise_rot ( r , deg = deg ) #            if self._eultype in ['X','Y']: #                rn[1] = -rn[1] cn = normalise_coord ( c ) self . _rots . append ( rn ) # append(rn) or insert(0, rn) ? self . _coords . append ( cn ) # append(cn) or insert(0, cn) ? self . _invs . append ( bool ( i ) ) if not self . consistent : log . warning ( "The chain of coord system rotations is not consistent" ) self . _update_matrix ( )