Tests adapted to new bands

This commit is contained in:
Lukas Klass 2020-04-24 11:41:39 +02:00
parent cd59386152
commit 657c15d845
3 changed files with 8 additions and 7 deletions

View File

@ -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(),

View File

@ -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):

View File

@ -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))