Exemplo n.º 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)
Exemplo n.º 2
0
    def test_b_ecc_ps5(self):
        """Impact parameter mapping test for z_eccentric_ps5.

        Test impact parameter mapping to ensure that b == z(t0) for eccentric orbits
        using the ps5 method.
        """
        es = uniform(0, 0.20, 50)
        Is = o.i_from_baew(self.bs, self.a, es, self.ws)
        zs = np.concatenate([of.z_eccentric_ps5(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=3)
Exemplo n.º 3
0
 def test_ps5(self):
     for (i, t0), w in product(enumerate(self.t0s), self.ws):
         z = of.z_eccentric_ps5(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)
Exemplo n.º 4
0
 def test_ps5(self):
     for i, (t0, e, w) in enumerate(product(self.t0s, self.es, self.ws)):
         if e < 0.35:
             z = of.z_eccentric_ps5(self.t,
                                    t0,
                                    self.p,
                                    self.a,
                                    self.i,
                                    e,
                                    w,
                                    nth=1)
             npt.assert_array_almost_equal(z, self.ref_zs[i], decimal=2)
Exemplo n.º 5
0
    def test_b_ecc_ps5(self):
        """Impact parameter mapping test for z_eccentric_ps5.

        Test impact parameter mapping to ensure that b == z(t0) for eccentric orbits
        using the ps5 method.
        """
        es = uniform(0, 0.20, 50)
        Is = o.i_from_baew(self.bs, self.a, es, self.ws)
        zs = np.concatenate([
            of.z_eccentric_ps5(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=3)
Exemplo n.º 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)
Exemplo n.º 7
0
 def test_ps5(self):
     for i, (t0, e, w) in enumerate(product(self.t0s, self.es, self.ws)):
         if e < 0.35:
             z = of.z_eccentric_ps5(self.t, t0, self.p, self.a, self.i, e, w, nth=1)
             npt.assert_array_almost_equal(z, self.ref_zs[i], decimal=2)
Exemplo n.º 8
0
 def test_ps5(self):
     for (i,t0), w in product(enumerate(self.t0s), self.ws):
         z = of.z_eccentric_ps5(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)