Ejemplo n.º 1
0
def _tof_equation_y(x, y, T0, ll, M):
    """Time of flight equation with externally computated y."""
    if M == 0 and np.sqrt(0.6) < x < np.sqrt(1.4):
        eta = y - ll * x
        S_1 = (1 - ll - x * eta) * 0.5
        Q = 4 / 3 * hyp2f1b(S_1)
        T_ = (eta**3 * Q + 4 * ll * eta) * 0.5
    else:
        psi = _compute_psi(x, y, ll)
        T_ = np.divide(
            np.divide(psi + M * pi, np.sqrt(np.abs(1 - x**2))) - x + ll * y,
            (1 - x**2),
        )

    return T_ - T0
Ejemplo n.º 2
0
def _tof_equation(x, y, T0, ll, M):
    """Time of flight equation.

    """
    if M == 0 and np.sqrt(0.6) < x < np.sqrt(1.4):
        eta = y - ll * x
        S_1 = (1 - ll - x * eta) * .5
        Q = 4 / 3 * hyp2f1b(S_1)
        T_ = (eta ** 3 * Q + 4 * ll * eta) * .5
    else:
        psi = _compute_psi(x, y, ll)
        T_ = np.divide(np.divide(psi + M * pi,
                                 np.sqrt(np.abs(1 - x ** 2))) - x + ll * y,
                       (1 - x ** 2))

    return T_ - T0