diff --git a/esbo_etc/classes/target/FileTarget.py b/esbo_etc/classes/target/FileTarget.py index b207bd8..8819529 100644 --- a/esbo_etc/classes/target/FileTarget.py +++ b/esbo_etc/classes/target/FileTarget.py @@ -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) diff --git a/tests/optical_component/test_Atmosphere.py b/tests/optical_component/test_Atmosphere.py index 102e728..ed7a148 100644 --- a/tests/optical_component/test_Atmosphere.py +++ b/tests/optical_component/test_Atmosphere.py @@ -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(), diff --git a/tests/optical_component/test_BeamSplitter.py b/tests/optical_component/test_BeamSplitter.py index fb122e9..d9f713e 100644 --- a/tests/optical_component/test_BeamSplitter.py +++ b/tests/optical_component/test_BeamSplitter.py @@ -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))) diff --git a/tests/optical_component/test_Lens.py b/tests/optical_component/test_Lens.py index aee8af7..666b56f 100644 --- a/tests/optical_component/test_Lens.py +++ b/tests/optical_component/test_Lens.py @@ -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))) diff --git a/tests/optical_component/test_Mirror.py b/tests/optical_component/test_Mirror.py index e253f28..240603e 100644 --- a/tests/optical_component/test_Mirror.py +++ b/tests/optical_component/test_Mirror.py @@ -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)))