Ejemplo n.º 1
0
def calc_anoms(params, MJD):
    """
    Calculate the mean, eccentric, and true anomalies at the barycentric
    epoch MJD (written by Scott Ransom)

    Input
    -----
        params - a list of parameter values
        MJD - the barycentric epoch MJD

    Output
    ------
        mean_anom - mean anomaly in radians
        ecc_anom - eccentric enomaly in radians
        true_anom - the true anomaly in radians
    """
    MJD = myasarray(MJD)
    difft = (MJD - params[3]) * SECPERDAY
    sec_since_peri = fmod(difft, params[1])
    sec_since_peri[sec_since_peri < 0.0] += params[1]
    mean_anom = sec_since_peri / params[1] * TWOPI
    ecc_anom = eccentric_anomaly(
        [params[0], params[1], params[2], params[3], params[4], params[5]],
        mean_anom)
    true_anom = psr_utils.true_anomaly(ecc_anom, params[4])
    return (mean_anom, ecc_anom, true_anom)
Ejemplo n.º 2
0
def calc_anoms(params, MJD):
    """
    Calculate the mean, eccentric, and true anomalies at the barycentric
    epoch MJD (written by Scott Ransom)

    Input
    -----
        params - a list of parameter values
        MJD - the barycentric epoch MJD

    Output
    ------
        mean_anom - mean anomaly in radians
        ecc_anom - eccentric enomaly in radians
        true_anom - the true anomaly in radians
    """
    MJD = myasarray(MJD)
    difft = (MJD - params[3])*SECPERDAY
    sec_since_peri = fmod(difft, params[1])
    sec_since_peri[sec_since_peri < 0.0] += params[1]
    mean_anom = sec_since_peri/params[1]*TWOPI
    ecc_anom = eccentric_anomaly([params[0],params[1],
                                  params[2],params[3],params[4],
                                  params[5]], mean_anom)
    true_anom = psr_utils.true_anomaly(ecc_anom, params[4])
    return (mean_anom, ecc_anom, true_anom)
Ejemplo n.º 3
0
 def calc_anoms(self, MJD):
     """
     calc_anoms(MJD):
         Return a tuple of the mean, eccentric, and true anomalies (all
             in radians) at the barycentric epoch MJD(s).
     """
     MJD = myasarray(MJD)
     difft = (MJD - self.T0) * SECPERDAY
     sec_since_peri = Num.fmod(difft, self.PBsec)
     sec_since_peri[sec_since_peri < 0.0] += self.PBsec
     mean_anom = sec_since_peri / self.PBsec * TWOPI
     ecc_anom = self.eccentric_anomaly(mean_anom)
     true_anom = psr_utils.true_anomaly(ecc_anom, self.par.E)
     return (mean_anom, ecc_anom, true_anom)
Ejemplo n.º 4
0
 def calc_anoms(self, MJD):
     """
     calc_anoms(MJD):
         Return a tuple of the mean, eccentric, and true anomalies (all
             in radians) at the barycentric epoch MJD(s).
     """
     MJD = myasarray(MJD)
     difft = (MJD - self.T0)*SECPERDAY
     sec_since_peri = Num.fmod(difft, self.PBsec)
     sec_since_peri[sec_since_peri < 0.0] += self.PBsec
     mean_anom = sec_since_peri/self.PBsec*TWOPI
     ecc_anom = self.eccentric_anomaly(mean_anom)
     true_anom = psr_utils.true_anomaly(ecc_anom, self.par.E)
     return (mean_anom, ecc_anom, true_anom)