(self, *args, **kwds)
return np.arctan2(sinalpha, cosalpha)
Compute the angle between transverse reference direction of initial and final frames

        For example, if angle of polarisation is psi in initial frame, it will be psi+angle_ref in final
        frame.

        Parameters
        ----------
        dir_or_vec : array
          Direction or vector (see Rotator.__call__)
        lonlat: bool, optional
          If True, assume input is longitude,latitude in degrees. Otherwise,
          theta,phi in radian. Default: False
        inv : bool, optional
          If True, use the inverse transforms. Default: False

        Returns
        -------
        angle : float, scalar or array
          Angle in radian (a scalar or an array if input is a sequence of direction/vector)
Compute the angle between transverse reference direction of initial and final frames
Compute the angle between transverse reference direction of initial and final frames
def angle_ref(self, *args, **kwds):
        """Compute the angle between transverse reference direction of initial and final frames

        For example, if angle of polarisation is psi in initial frame, it will be psi+angle_ref in final
        frame.

        Parameters
        ----------
        dir_or_vec : array
          Direction or vector (see Rotator.__call__)
        lonlat: bool, optional
          If True, assume input is longitude,latitude in degrees. Otherwise,
          theta,phi in radian. Default: False
        inv : bool, optional
          If True, use the inverse transforms. Default: False

        Returns
        -------
        angle : float, scalar or array
          Angle in radian (a scalar or an array if input is a sequence of direction/vector)
        """
        R = self
        lonlat = kwds.get("lonlat", False)
        inv = kwds.get("inv", False)
        if len(args) == 1:
            arg = args[0]
            if not hasattr(arg, "__len__") or len(arg) < 2 or len(arg) > 3:
                raise TypeError("Argument must be a sequence of 2 or 3 " "elements")
            if len(arg) == 2:
                v = dir2vec(arg[0], arg[1], lonlat=lonlat)
            else:
                v = arg
        elif len(args) == 2:
            v = dir2vec(args[0], args[1], lonlat=lonlat)
        elif len(args) == 3:
            v = args
        else:
            raise TypeError("Either 1, 2 or 3 arguments accepted")
        vp = R(v, inv=inv)
        north_pole = R([0.0, 0.0, 1.0], inv=inv)
        sinalpha = north_pole[0] * vp[1] - north_pole[1] * vp[0]
        cosalpha = north_pole[2] - vp[2] * np.dot(north_pole, vp)
        return np.arctan2(sinalpha, cosalpha)
def angle_ref ( self , * args , * * kwds ) : R = self lonlat = kwds . get ( "lonlat" , False ) inv = kwds . get ( "inv" , False ) if len ( args ) == 1 : arg = args [ 0 ] if not hasattr ( arg , "__len__" ) or len ( arg ) < 2 or len ( arg ) > 3 : raise TypeError ( "Argument must be a sequence of 2 or 3 " "elements" ) if len ( arg ) == 2 : v = dir2vec ( arg [ 0 ] , arg [ 1 ] , lonlat = lonlat ) else : v = arg elif len ( args ) == 2 : v = dir2vec ( args [ 0 ] , args [ 1 ] , lonlat = lonlat ) elif len ( args ) == 3 : v = args else : raise TypeError ( "Either 1, 2 or 3 arguments accepted" ) vp = R ( v , inv = inv ) north_pole = R ( [ 0.0 , 0.0 , 1.0 ] , inv = inv ) sinalpha = north_pole [ 0 ] * vp [ 1 ] - north_pole [ 1 ] * vp [ 0 ] cosalpha = north_pole [ 2 ] - vp [ 2 ] * np . dot ( north_pole , vp ) return np . arctan2 ( sinalpha , cosalpha )