astrobase/varbase/transits.py
def estimate_achievable_tmid_precision(snr, t_ingress_min=10,
                                       t_duration_hr=2.14):
    '''Using Carter et al. 2009's estimate, calculate the theoretical optimal
    precision on mid-transit time measurement possible given a transit of a
    particular SNR.

    The relation used is::

        sigma_tc = Q^{-1} * T * sqrt(θ/2)

        Q = SNR of the transit.
        T = transit duration, which is 2.14 hours from discovery paper.
        θ = τ/T = ratio of ingress to total duration
                ~= (few minutes [guess]) / 2.14 hours

    Parameters
    ----------

    snr : float
        The measured signal-to-noise of the transit, e,g. from
        :py:func:`astrobase.periodbase.kbls.bls_stats_singleperiod` or from
        running the `.compute_stats()` method on an Astropy BoxLeastSquares
        object.

    t_ingress_min : float
        The ingress duration in minutes. This is t_I to t_II in Winn (2010)
        nomenclature.

    t_duration_hr : float
        The transit duration in hours. This is t_I to t_IV in Winn (2010)
        nomenclature.

    Returns
    -------

    float
        Returns the precision achievable for transit-center time as calculated
        from the relation above. This is in days.

    '''

    t_ingress = t_ingress_min*u.minute
    t_duration = t_duration_hr*u.hour

    theta = t_ingress/t_duration

    sigma_tc = (1/snr * t_duration * np.sqrt(theta/2))

    LOGINFO('assuming t_ingress = {:.1f}'.format(t_ingress))
    LOGINFO('assuming t_duration = {:.1f}'.format(t_duration))
    LOGINFO('measured SNR={:.2f}\n\t'.format(snr) +
            '-->theoretical sigma_tc = {:.2e} = {:.2e} = {:.2e}'.format(
                sigma_tc.to(u.minute), sigma_tc.to(u.hour), sigma_tc.to(u.day)))

    return sigma_tc.to(u.day).value
def estimate_achievable_tmid_precision(snr, t_ingress_min=10,
                                       t_duration_hr=2.14):
    '''Using Carter et al. 2009's estimate, calculate the theoretical optimal
    precision on mid-transit time measurement possible given a transit of a
    particular SNR.

    The relation used is::

        sigma_tc = Q^{-1} * T * sqrt(θ/2)

        Q = SNR of the transit.
        T = transit duration, which is 2.14 hours from discovery paper.
        θ = τ/T = ratio of ingress to total duration
                ~= (few minutes [guess]) / 2.14 hours

    Parameters
    ----------

    snr : float
        The measured signal-to-noise of the transit, e,g. from
        :py:func:`astrobase.periodbase.kbls.bls_stats_singleperiod` or from
        running the `.compute_stats()` method on an Astropy BoxLeastSquares
        object.

    t_ingress_min : float
        The ingress duration in minutes. This is t_I to t_II in Winn (2010)
        nomenclature.

    t_duration_hr : float
        The transit duration in hours. This is t_I to t_IV in Winn (2010)
        nomenclature.

    Returns
    -------

    float
        Returns the precision achievable for transit-center time as calculated
        from the relation above. This is in days.

    '''

    t_ingress = t_ingress_min*u.minute
    t_duration = t_duration_hr*u.hour

    theta = t_ingress/t_duration

    sigma_tc = (1/snr * t_duration * np.sqrt(theta/2))

    LOGINFO('assuming t_ingress = {:.1f}'.format(t_ingress))
    LOGINFO('assuming t_duration = {:.1f}'.format(t_duration))
    LOGINFO('measured SNR={:.2f}\n\t'.format(snr) +
            '-->theoretical sigma_tc = {:.2e} = {:.2e} = {:.2e}'.format(
                sigma_tc.to(u.minute), sigma_tc.to(u.hour), sigma_tc.to(u.day)))

    return sigma_tc.to(u.day).value
Using Carter et al. 2009's estimate, calculate the theoretical optimal
    precision on mid-transit time measurement possible given a transit of a
    particular SNR.

    The relation used is::

        sigma_tc = Q^{-1} * T * sqrt(θ/2)

        Q = SNR of the transit.
        T = transit duration, which is 2.14 hours from discovery paper.
        θ = τ/T = ratio of ingress to total duration
                ~= (few minutes [guess]) / 2.14 hours

    Parameters
    ----------

    snr : float
        The measured signal-to-noise of the transit, e,g. from
        :py:func:`astrobase.periodbase.kbls.bls_stats_singleperiod` or from
        running the `.compute_stats()` method on an Astropy BoxLeastSquares
        object.

    t_ingress_min : float
        The ingress duration in minutes. This is t_I to t_II in Winn (2010)
        nomenclature.

    t_duration_hr : float
        The transit duration in hours. This is t_I to t_IV in Winn (2010)
        nomenclature.

    Returns
    -------

    float
        Returns the precision achievable for transit-center time as calculated
        from the relation above. This is in days.