Пример #1
0
def t2g_vel(trs: "TrsVelocity", time: "Time" = None) -> "GcrsVelocity":
    """Transforms input array from trs to gcrs coordinates"""
    if time is None:
        time = trs.time
        if time is None:
            raise mg_exceptions.InitializationError("Time is not defined")
    trs = nputil.col(trs)
    return _matmul(rotation.dtrs2gcrs_dt(time), trs)
Пример #2
0
def g2t_pos(gcrs: "GcrsPosition", time: "Time" = None) -> "TrsPosition":
    """Transforms input array from gcrs to trs coordinates"""
    if time is None:
        time = gcrs.time
        if time is None:
            raise mg_exceptions.InitializationError("Time is not defined")
    gcrs = nputil.col(gcrs)
    return _matmul(rotation.gcrs2trs(time), gcrs)
Пример #3
0
def t2g_posvel(trs: "TrsPosVel", time: "Time" = None) -> "GcrsPosVel":
    """Transforms input array from trs to gcrs coordinates"""
    if time is None:
        time = trs.time
        if time is None:
            raise mg_exceptions.InitializationError("Time is not defined")
    trs = nputil.col(trs)
    t2g = rotation.trs2gcrs(time)
    dt2g = rotation.dtrs2gcrs_dt(time)

    transformation = np.block([[t2g, np.zeros(t2g.shape)], [dt2g, t2g]])
    return _matmul(transformation, trs)
Пример #4
0
def g2t_posvel(gcrs: "GcrsPosVel", time: "Time" = None) -> "TrsPosVel":
    """Transforms input array from gcrs to trs coordinates"""
    if time is None:
        time = gcrs.time
        if time is None:
            raise mg_exceptions.InitializationError("Time is not defined")
    gcrs = nputil.col(gcrs)
    g2t = rotation.gcrs2trs(time)
    dg2t = rotation.dgcrs2trs_dt(time)

    transformation = np.block([[g2t, np.zeros(g2t.shape)], [dg2t, g2t]])
    return _matmul(transformation, gcrs)