Example #1
0
def _get_barycorr_bvcs_withvels(coos, loc, injupyter=False):
    """
    Gets the barycentric correction of the test data from the
    http://astroutils.astronomy.ohio-state.edu/exofast/barycorr.html web site.
    Requires the https://github.com/tronsgaard/barycorr python interface to that
    site.

    Provided to reproduce the test data above, but not required to actually run
    the tests.
    """
    import barycorr
    from astropy.utils.console import ProgressBar

    bvcs = []
    for coo in ProgressBar(coos, ipython_widget=injupyter):
        res = barycorr.bvc(test_input_time.utc.jd,
                           coo.ra.deg,
                           coo.dec.deg,
                           lat=loc.geodetic[1].deg,
                           lon=loc.geodetic[0].deg,
                           pmra=coo.pm_ra_cosdec.to_value(u.mas / u.yr),
                           pmdec=coo.pm_dec.to_value(u.mas / u.yr),
                           parallax=coo.distance.to_value(
                               u.mas, equivalencies=u.parallax()),
                           rv=coo.radial_velocity.to_value(u.m / u.s),
                           epoch=test_input_time.utc.jd,
                           elevation=loc.geodetic[2].to(u.m).value)
        bvcs.append(res)
    return bvcs * u.m / u.s
Example #2
0
def test():
    import barycorr
    import numpy as np
    params = {
        'jd_utc': [2457535.067362, 2457462.12724721],
        'ra': 293.08995940,
        'dec': 69.66117649,
        'lat': 28.2983,
        'lon': -16.5094,
        'elevation': 2400,
        'pmra': 598.07,
        'pmdec': -1738.40,
        'parallax': 173.77,
        'rv': 26780,
        'zmeas': [-4.99432219e-06, 1.16637407e-05]
    }
    result = barycorr.bvc(**params)
    diff = result - [-1312.08186269, 515.87479325]

    # Returns: numpy.array([-1312.08186269,   515.87479325])
    assert np.all(diff < 0.01), "Should be [-1312.08186269,   515.87479325]"
def _get_barycorr_bvcs(coos, loc, injupyter=False):
    """
    Gets the barycentric correction of the test data from the
    http://astroutils.astronomy.ohio-state.edu/exofast/barycorr.html web site.
    Requires the https://github.com/tronsgaard/barycorr python interface to that
    site.

    Provided to reproduce the test data above, but not required to actually run
    the tests.
    """
    import barycorr
    from ...utils.console import ProgressBar

    bvcs = []
    for ra, dec in ProgressBar(list(zip(coos.ra.deg, coos.dec.deg)),
                               ipython_widget=injupyter):
        res = barycorr.bvc(test_input_time.utc.jd, ra, dec,
                           lat=loc.geodetic[1].deg,
                           lon=loc.geodetic[0].deg,
                           elevation=loc.geodetic[2].to(u.m).value)
        bvcs.append(res)
    return bvcs*u.m/u.s
def _get_barycorr_bvcs(coos, loc, injupyter=False):
    """
    Gets the barycentric correction of the test data from the
    http://astroutils.astronomy.ohio-state.edu/exofast/barycorr.html web site.
    Requires the https://github.com/tronsgaard/barycorr python interface to that
    site.

    Provided to reproduce the test data above, but not required to actually run
    the tests.
    """
    import barycorr
    from astropy.utils.console import ProgressBar

    bvcs = []
    for ra, dec in ProgressBar(list(zip(coos.ra.deg, coos.dec.deg)),
                               ipython_widget=injupyter):
        res = barycorr.bvc(test_input_time.utc.jd, ra, dec,
                           lat=loc.geodetic[1].deg,
                           lon=loc.geodetic[0].deg,
                           elevation=loc.geodetic[2].to(u.m).value)
        bvcs.append(res)
    return bvcs*u.m/u.s