Example #1
0
def helio_geo_correction(ra, dec, mjd, st):
    """Motion of earth's center in heliocentric frame"""
    # line-of-sight unit vector to astronomical object
    k_los = sla_dcs2c(ra.radian, dec.radian)
    # Velocity and position of earth in barycentric and heliocentric frames
    # Units are AU and AU/s
    vel_bary, pos_bary, vel_hel, pos_hel = sla_evp(mjd, 2000.0)
    # Radial velocity correction (km/s) due to helio-geocentric transformation  
    # Positive when earth is moving away from object
    return u.AU.to(u.km, -np.dot(vel_hel, k_los))
Example #2
0
def rvcorr(hdr):
    """Calculate helio- and geo-centric corrections to radial velocities

    The result should be subtracted from the observed (topocentric)
    velocities in order to give velocities in the heliocentric frame.

    """
    # The following page was very helpful in pointing to the relevant
    # SLALIB routines and how to use them
    # http://star-www.rl.ac.uk/docs/sun67.htx/node230.html

    # Object coordinates
    ra = coord.RA(hdr["RA"], U.hour)
    dec = coord.Dec(hdr["DEC"], U.degree)
    # Modified Julian Date
    jdate = float(hdr["MJD"])
    # Sidereal time
    st = coord.Angle((hdr["ST"]), U.hour)

    # line-of-sight unit vector to astronomical object
    k_los = sla_dcs2c(ra.radians, dec.radians)

    # Velocity and position of earth in barycentric and heliocentric frames
    # Units are AU and AU/s
    vel_bary, pos_bary, vel_hel, pos_hel = sla_evp(jdate, 2000.0)

    # Radial velocity correction (km/s) due to helio-geocentric transformation
    # Positive when earth is moving away from object
    vcorr_hel = U.AU.to(U.km, -np.dot(vel_hel, k_los))

    # Long/lat/altitude of observatory (radians, radians, meters)
    obs_id, obs_name, obs_long, obs_lat, obs_height = sla_obs(0, "KECK1")

    # Radial velocity correction (km/s) due to geo-topocentric transformation
    # Positive when observatory is moving away from object
    vcorr_geo = sla_rverot(obs_lat, ra.radians, dec.radians, st.radians)

    return vcorr_hel + vcorr_geo
Example #3
0
 def test_slalib(self, mjd, config):
     from pyslalib import slalib
     ra = numpy.zeros(len(mjd), 'float')
     dec = numpy.zeros(len(mjd), 'float')
     for i in range(len(mjd)):
         # Calculate sun's (topocentric) position. 
         #ra_RAD, dec_RAD, diam = slalib.sla_rdplan(mjd[i], 0,
         #                                          config['longitude']*_deg2rad, config['latitude']*_deg2rad)
         # Sun's (geocentric?) position.
         bary_vel, bary_pos, helio_vel, helio_pos = slalib.sla_evp(mjd, 2000)
         sun_pos = -1 * (bary_pos)
         ra_RAD, dec_RAD = slalib.sla_dcc2s(sun_pos)
         ra[i] = ra_RAD * _rad2deg
         dec[i] = dec_RAD * _rad2deg
     print "Sun: Test_slalib results"
     print " ... ra(slalib)"
     print ra
     print "  ... ra(self)"
     print self.ra
     print self.ra.min(), self.ra.max()
     print " ... dec(slalib)"    
     print dec
     print " ... dec(self)"
     print self.dec