示例#1
0
    def test_b_circular(self):
        """Impact parameter mapping test for circular orbits.
        
        Test impact parameter mapping to ensure that b == z(t0) for circular orbits.
        """
        Is = o.i_from_ba(self.bs, self.a)

        zs = np.concatenate(
            [of.z_circular(self.t, self.t0, self.p, self.a, i, 1) for i in Is])
        npt.assert_array_almost_equal(self.bs, zs)

        zs = np.concatenate([
            of.z_eccentric_newton(self.t, self.t0, self.p, self.a, i, 0, 0, 1)
            for i in Is
        ])
        npt.assert_array_almost_equal(self.bs, zs)

        zs = np.concatenate([
            of.z_eccentric_iter(self.t, self.t0, self.p, self.a, i, 0, 0, 1)
            for i in Is
        ])
        npt.assert_array_almost_equal(self.bs, zs)

        zs = np.concatenate([
            of.z_eccentric_ps3(self.t, self.t0, self.p, self.a, i, 0, 0, 1)
            for i in Is
        ])
        npt.assert_array_almost_equal(self.bs, zs)

        zs = np.concatenate([
            of.z_eccentric_ps5(self.t, self.t0, self.p, self.a, i, 0, 0, 1)
            for i in Is
        ])
        npt.assert_array_almost_equal(self.bs, zs)
示例#2
0
    def test_b_ecc_iter(self):
        """Impact parameter mapping test for z_eccentric_iter.

        Test impact parameter mapping to ensure that b == z(t0) for eccentric orbits
        using the iterative method.
        """
        es = uniform(0, 0.75, 50)
        Is = o.i_from_baew(self.bs, self.a, es, self.ws)
        zs = np.concatenate([of.z_eccentric_iter(self.t, self.t0, self.p, self.a, i, e, w, 1) for i,e,w in zip(Is, es, self.ws)])
        npt.assert_array_almost_equal(self.bs, zs, decimal=4)
示例#3
0
 def test_iter(self):
     for (i, t0), w in product(enumerate(self.t0s), self.ws):
         z = of.z_eccentric_iter(self.t,
                                 t0,
                                 self.p,
                                 self.a,
                                 self.i,
                                 0,
                                 w,
                                 nth=1)
         npt.assert_array_almost_equal(z, self.ref_zs[i], decimal=3)
 def test_iter(self):
     for i, (t0, e, w) in enumerate(product(self.t0s, self.es, self.ws)):
         z = of.z_eccentric_iter(self.t,
                                 t0,
                                 self.p,
                                 self.a,
                                 self.i,
                                 e,
                                 w,
                                 nth=1)
         npt.assert_array_almost_equal(z, self.ref_zs[i], decimal=3)
示例#5
0
    def test_b_ecc_iter(self):
        """Impact parameter mapping test for z_eccentric_iter.

        Test impact parameter mapping to ensure that b == z(t0) for eccentric orbits
        using the iterative method.
        """
        es = uniform(0, 0.75, 50)
        Is = o.i_from_baew(self.bs, self.a, es, self.ws)
        zs = np.concatenate([
            of.z_eccentric_iter(self.t, self.t0, self.p, self.a, i, e, w, 1)
            for i, e, w in zip(Is, es, self.ws)
        ])
        npt.assert_array_almost_equal(self.bs, zs, decimal=4)
示例#6
0
    def test_b_circular(self):
        """Impact parameter mapping test for circular orbits.
        
        Test impact parameter mapping to ensure that b == z(t0) for circular orbits.
        """
        Is = o.i_from_ba(self.bs, self.a)

        zs = np.concatenate([of.z_circular(self.t, self.t0, self.p, self.a, i, 1) for i in Is])
        npt.assert_array_almost_equal(self.bs, zs)

        zs = np.concatenate([of.z_eccentric_newton(self.t, self.t0, self.p, self.a, i, 0, 0, 1) for i in Is])
        npt.assert_array_almost_equal(self.bs, zs)

        zs = np.concatenate([of.z_eccentric_iter(self.t, self.t0, self.p, self.a, i, 0, 0, 1) for i in Is])
        npt.assert_array_almost_equal(self.bs, zs)

        zs = np.concatenate([of.z_eccentric_ps3(self.t, self.t0, self.p, self.a, i, 0, 0, 1) for i in Is])
        npt.assert_array_almost_equal(self.bs, zs)

        zs = np.concatenate([of.z_eccentric_ps5(self.t, self.t0, self.p, self.a, i, 0, 0, 1) for i in Is])
        npt.assert_array_almost_equal(self.bs, zs)
示例#7
0
 def test_iter(self):
     for i, (t0, e, w) in enumerate(product(self.t0s, self.es, self.ws)):
         z = of.z_eccentric_iter(self.t, t0, self.p, self.a, self.i, e, w, nth=1)
         npt.assert_array_almost_equal(z, self.ref_zs[i], decimal=3)
示例#8
0
 def test_iter(self):
     for (i,t0), w in product(enumerate(self.t0s), self.ws):
         z = of.z_eccentric_iter(self.t, t0, self.p, self.a, self.i, 0, w, nth=1)
         npt.assert_array_almost_equal(z, self.ref_zs[i], decimal=3)