示例#1
0
def v_rad(K, tau, e, long, T0, v0, times):
    """
    Calculate the radial (line-of-sight) velocity for a Keplerian orbit
    as a function of orbital parameters, COM velocity, and time.  The
    parameters are:
      K = velocity amplitude
      tau = period
      e = eccentricity
      long = longitude of periastron (radians)
      T0 = time of periastron crossing
      v0 = COM velocity
    The times argument can be either a single float (with the velocity
    returned as a float) or an array of floats (with the velocity
    returned as a corresponding array).

    tau, T0 and times should be in the same units (typically days).
    K can use a different unit of time (typically m/s).
    """
    fkepler.setup_Tp(tau, e, T0)
    if type(times)==float:
        c, s = fkepler.t2TA(times)  # Get cos, sin of true anomaly
    else:
        c, s = fkepler.vt2TA(times)
    return v0 + K*cos(long)*(e+c) + K*sin(long)*s
示例#2
0
def v_rad(K, tau, e, long, T0, v0, times):
    """
    Calculate the radial (line-of-sight) velocity for a Keplerian orbit
    as a function of orbital parameters, COM velocity, and time.  The
    parameters are:
      K = velocity amplitude
      tau = period
      e = eccentricity
      long = longitude of periastron (radians)
      T0 = time of periastron crossing
      v0 = COM velocity
    The times argument can be either a single float (with the velocity
    returned as a float) or an array of floats (with the velocity
    returned as a corresponding array).

    tau, T0 and times should be in the same units (typically days).
    K can use a different unit of time (typically m/s).
    """
    fkepler.setup_Tp(tau, e, T0)
    if type(times) == float:
        c, s = fkepler.t2TA(times)  # Get cos, sin of true anomaly
    else:
        c, s = fkepler.vt2TA(times)
    return v0 + K * cos(long) * (e + c) + K * sin(long) * s
示例#3
0
    def true_anom(self, times):
        """Calculate the cosine & sine of the true anomaly for a vector
		of observing times."""
        fkepler.setup_Tp(tau, e, T0)
        self.cs_TA = fkepler.vt2TA(times)
        return self.cs_TA
示例#4
0
def Kepler_setup(tau, e, T0, times):
    global cs_vals
    fkepler.setup(tau, e, T0)
    return fkepler.vt2TA(times)
示例#5
0
def Kepler_setup(tau, e, T0, times):
	global cs_vals
	fkepler.setup(tau, e, T0)
	return fkepler.vt2TA(times)
示例#6
0
 def true_anom(self, times):
     """Calculate the cosine & sine of the true anomaly for a vector
             of observing times."""
     fkepler.setup_Tp(tau, e, T0)
     self.cs_TA = fkepler.vt2TA(times)
     return self.cs_TA