startracker.py
def wahba(A, B, weight=[]):
    """
    Take in two matrices of points and finds the attitude matrix needed to.

    transform one onto the other.

    Input:
        A: nx3 matrix - x,y,z in body frame
        B: nx3 matrix - x,y,z in eci
        Note: the "n" dimension of both matrices must match
    Output:
        attitude_matrix: returned as a numpy matrix
    """
    assert len(A) == len(B)
    if (len(weight) == 0):
        weight = np.array([1] * len(A))
    # dot is matrix multiplication for array
    H = np.dot(np.transpose(A) * weight, B)

    # calculate attitude matrix
    # from http://malcolmdshuster.com/FC_MarkleyMortari_Girdwood_1999_AAS.pdf
    U, S, Vt = np.linalg.svd(H)
    flip = np.linalg.det(U) * np.linalg.det(Vt)

    U[:, 2] *= flip

    body2eci = np.dot(U, Vt)
    return body2eci

    Take in two matrices of points and finds the attitude matrix needed to.

    transform one onto the other.

    Input:
        A: nx3 matrix - x,y,z in body frame
        B: nx3 matrix - x,y,z in eci
        Note: the "n" dimension of both matrices must match
    Output:
        attitude_matrix: returned as a numpy matrix
    
Take in two matrices of points and finds the attitude matrix needed to.
transform one onto the other.

nx3 matrix - x,y,z in body frame
B: nx3 matrix - x,y,z in eci
Note: the "n" dimension of both matrices must match
Output:
attitude_matrix: returned as a numpy matrix
Take in two matrices of points and finds the attitude matrix needed to . transform one onto the other . nx3 matrix - x y z in body frame B : nx3 matrix - x y z in eci Note : the " n " dimension of both matrices must match Output : attitude_matrix : returned as a numpy matrix
def wahba(A, B, weight=[]):
    assert len(A) == len(B)
    if (len(weight) == 0):
        weight = np.array([1] * len(A))
    H = np.dot(np.transpose(A) * weight, B)
    U, S, Vt = np.linalg.svd(H)
    flip = np.linalg.det(U) * np.linalg.det(Vt)
    U[:, 2] *= flip
    body2eci = np.dot(U, Vt)
    return body2eci
def wahba ( A , B , weight = [ ] ) : assert len ( A ) == len ( B ) if ( len ( weight ) == 0 ) : weight = np . array ( [ 1 ] * len ( A ) ) H = np . dot ( np . transpose ( A ) * weight , B ) U , S , Vt = np . linalg . svd ( H ) flip = np . linalg . det ( U ) * np . linalg . det ( Vt ) U [ : , 2 ] *= flip body2eci = np . dot ( U , Vt ) return body2eci
Take in two matrices of points and finds the attitude matrix needed to.
Take in two matrices of points and finds the attitude matrix needed to .
"""
    Take in two matrices of points and finds the attitude matrix needed to.

    transform one onto the other.

    Input:
        A: nx3 matrix - x,y,z in body frame
        B: nx3 matrix - x,y,z in eci
        Note: the "n" dimension of both matrices must match
    Output:
        attitude_matrix: returned as a numpy matrix
    """ # dot is matrix multiplication for array # calculate attitude matrix # from http://malcolmdshuster.com/FC_MarkleyMortari_Girdwood_1999_AAS.pdf
A
B
weight