예제 #1
0
    def test_vampola_singleval(self):
        """sin^n model should have d_flux that integrates to input omniflux"""
        omniflux = 3000
        dnflux, alphas = em.vampolaPA(omniflux, order=2, alpha=self.PA)
        d_sum = em.omniFromDirectionalFlux(dnflux, alphas, norm=False)
        np.testing.assert_almost_equal(d_sum, omniflux, decimal=3)

        dnflux, alphas = em.vampolaPA(omniflux, order=4, alpha=self.PA)
        d_sum = em.omniFromDirectionalFlux(dnflux, alphas, norm=False)
        np.testing.assert_almost_equal(d_sum, omniflux, decimal=3)
예제 #2
0
    def test_vampola_singleval(self):
        """sin^n model should have d_flux that integrates to input omniflux"""
        omniflux = 3000
        dnflux, alphas = em.vampolaPA(omniflux, order=2, alpha=self.PA)
        d_sum = em.omniFromDirectionalFlux(dnflux, alphas, norm=False)
        np.testing.assert_almost_equal(d_sum, omniflux, decimal=3)

        dnflux, alphas = em.vampolaPA(omniflux, order=4, alpha=self.PA)
        d_sum = em.omniFromDirectionalFlux(dnflux, alphas, norm=False)
        np.testing.assert_almost_equal(d_sum, omniflux, decimal=3)
예제 #3
0
 def test_vampola_multi_n(self):
     """sin^n model should have d_flux that integrates to input omniflux"""
     omniflux = [3000, 6000]
     dnflux, alphas = em.vampolaPA(omniflux, order=[2,4], alpha=self.PA)
     for i in range(len(omniflux)):
         d_sum = em.omniFromDirectionalFlux(dnflux[:,i], alphas, norm=False)
         np.testing.assert_almost_equal(d_sum, omniflux[i])
예제 #4
0
 def test_vampola_multi_n(self):
     """sin^n model should have d_flux that integrates to input omniflux"""
     omniflux = [3000, 6000]
     dnflux, alphas = em.vampolaPA(omniflux, order=[2, 4], alpha=self.PA)
     for i in range(len(omniflux)):
         d_sum = em.omniFromDirectionalFlux(dnflux[:, i],
                                            alphas,
                                            norm=False)
         np.testing.assert_almost_equal(d_sum, omniflux[i])