rebin file target

This commit is contained in:
Lukas Klass 2020-07-14 12:00:22 +02:00
parent b3fb5197e9
commit 275ccf99f8
5 changed files with 9 additions and 9 deletions

View File

@ -26,7 +26,7 @@ class FileTarget(ATarget):
Wavelengths used for binning
"""
# Create spectral quantity from file
sfd = SpectralQty.fromFile(file, u.nm, u.W / (u.m ** 2 * u.nm))
sfd = SpectralQty.fromFile(file, u.nm, u.W / (u.m ** 2 * u.nm)).rebin(wl_bins)
# Initialize the super class
super().__init__(sfd, wl_bins)

View File

@ -12,9 +12,9 @@ class TestAtmosphere(TestCase):
def test_calcSignal(self):
self.assertEqual(self.atmosphere.calcSignal()[0],
SpectralQty(np.arange(200, 210) << u.nm,
SpectralQty(np.arange(200, 208) << u.nm,
np.array([1.10e-15, 1.20e-15, 1.30e-15, 1.26e-15, 1.20e-15, 1.12e-15, 1.02e-15,
0.9e-15, 0, 0]) << u.W / (u.m ** 2 * u.nm)))
0.9e-15]) << u.W / (u.m ** 2 * u.nm)))
def test_calcBackgrounde(self):
self.assertEqual(self.atmosphere.calcBackground(),

View File

@ -19,6 +19,6 @@ class TestBeamSplitter(TestCase):
SpectralQty(self.wl, np.array([4.31413931e-96, 1.37122214e-95, 4.30844544e-95,
1.33846280e-94]) << u.W / (u.m ** 2 * u.nm * u.sr)))
self.assertEqual(self.splitter.calcSignal()[0],
SpectralQty(np.arange(200, 210, 1) << u.nm,
np.array([0, 1.20e-15, 1.30e-15, 1.40e-15, 1.35e-15, 0, 0, 0, 0, 0]) << u.W /
SpectralQty(np.arange(201, 205, 1) << u.nm,
np.array([1.20e-15, 1.30e-15, 1.40e-15, 1.35e-15]) << u.W /
(u.m ** 2 * u.nm)))

View File

@ -18,6 +18,6 @@ class TestLens(TestCase):
SpectralQty(self.wl, np.array([4.31413931e-96, 1.37122214e-95, 4.30844544e-95,
1.33846280e-94]) << u.W / (u.m ** 2 * u.nm * u.sr)))
self.assertEqual(self.lens.calcSignal()[0],
SpectralQty(np.arange(200, 210, 1) << u.nm,
np.array([0, 1.20e-15, 1.30e-15, 1.40e-15, 1.35e-15, 0, 0, 0, 0, 0]) << u.W /
SpectralQty(np.arange(201, 205, 1) << u.nm,
np.array([1.20e-15, 1.30e-15, 1.40e-15, 1.35e-15]) << u.W /
(u.m ** 2 * u.nm)))

View File

@ -18,6 +18,6 @@ class TestMirror(TestCase):
SpectralQty(self.wl, np.array([4.31413931e-96, 1.37122214e-95, 4.30844544e-95,
1.33846280e-94]) << u.W / (u.m ** 2 * u.nm * u.sr)))
self.assertEqual(self.mirror.calcSignal()[0],
SpectralQty(np.arange(200, 210, 1) << u.nm, np.array([0, 1.20e-15, 1.30e-15, 1.40e-15,
1.35e-15, 0, 0, 0, 0, 0]) << u.W /
SpectralQty(np.arange(201, 205, 1) << u.nm, np.array([1.20e-15, 1.30e-15, 1.40e-15,
1.35e-15]) << u.W /
(u.m ** 2 * u.nm)))