From 657c15d845df7cba7d56d7131716706a0ada0ee9 Mon Sep 17 00:00:00 2001 From: LukasK13 Date: Fri, 24 Apr 2020 11:41:39 +0200 Subject: [PATCH] Tests adapted to new bands --- tests/optical_component/test_AOpticalComponent.py | 4 ++-- tests/optical_component/test_Filter.py | 4 ++-- tests/target/test_BlackBodyTarget.py | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/optical_component/test_AOpticalComponent.py b/tests/optical_component/test_AOpticalComponent.py index e2fabbb..23b909a 100644 --- a/tests/optical_component/test_AOpticalComponent.py +++ b/tests/optical_component/test_AOpticalComponent.py @@ -22,8 +22,8 @@ class TestAOpticalComponent(TestCase): def test_calcSignal(self): self.assertEqual(self.comp.calcSignal(), - SpectralQty(self.wl, np.array([1.25575776e-17, 5.50570557e-18, 2.77637739e-18, - 1.54664415e-18]) << u.W / (u.m ** 2 * u.nm))) + SpectralQty(self.wl, np.array([1.29074440e-17, 5.65909989e-18, 2.85372997e-18, + 1.58973516e-18]) << u.W / (u.m ** 2 * u.nm))) def test_calcNoise(self): self.assertEqual(self.comp.calcNoise(), diff --git a/tests/optical_component/test_Filter.py b/tests/optical_component/test_Filter.py index a046a45..9d01b5c 100644 --- a/tests/optical_component/test_Filter.py +++ b/tests/optical_component/test_Filter.py @@ -9,8 +9,8 @@ class TestFilter(TestCase): wl = np.array([400, 500, 501, 545, 589, 590, 600]) << u.nm target = BlackBodyTarget(wl, temp=5778 * u.K, mag=10 * u.mag, band="U") filt = Filter.fromBand(target, "V") - self.assertEqual(filt.calcSignal(), SpectralQty(wl, np.array([0.0, 0.0, 5.46516556e-15, 5.37748512e-15, - 5.15313966e-15, 0.0, 0.0]) << u.W / + self.assertEqual(filt.calcSignal(), SpectralQty(wl, np.array([0.0, 0.0, 0.0, 5.52730709e-15, 5.29671115e-15, + 5.29030718e-15, 0.0]) << u.W / (u.m ** 2 * u.nm))) def test_fromFile(self): diff --git a/tests/target/test_BlackBodyTarget.py b/tests/target/test_BlackBodyTarget.py index 57e2f43..4688ead 100644 --- a/tests/target/test_BlackBodyTarget.py +++ b/tests/target/test_BlackBodyTarget.py @@ -11,9 +11,10 @@ class TestBlackBodyTarget(TestCase): temp=5778 * u.K, mag=10 * u.mag, band="U") def test_signal(self): - signal = SpectralQty(np.arange(400, 800, 100) << u.nm, np.array([4.77851291e-15, 5.46505832e-15, 5.08243077e-15, - 4.31009246e-15]) << u.W / (u.m ** 2 * u.nm)) - self.assertTrue(self.target.calcSignal().__eq__(signal)) + signal = SpectralQty(np.arange(400, 800, 100) << u.nm, np.array([4.91164694e-15, 5.61732017e-15, 5.22403225e-15, + 4.43017583e-15]) << u.W / (u.m ** 2 * u.nm)) + print(self.target.calcSignal().qty) + self.assertEqual(self.target.calcSignal(), signal) def test_noise(self): noise = SpectralQty(np.arange(400, 800, 100) << u.nm, np.repeat(0, 4) << u.W / (u.m ** 2 * u.nm * u.sr))