Initial commit
This commit is contained in:
parent
9166555994
commit
db0b61acff
11
tests/data/atmosphere/atmosphere_emission_1.csv
Normal file
11
tests/data/atmosphere/atmosphere_emission_1.csv
Normal file
@ -0,0 +1,11 @@
|
||||
wavelength,spectral flux density
|
||||
200,1.1e-16
|
||||
201,1.2e-16
|
||||
202,1.3e-16
|
||||
203,1.4e-16
|
||||
204,1.5e-16
|
||||
205,1.6e-16
|
||||
206,1.7e-16
|
||||
207,1.8e-16
|
||||
208,1.9e-16
|
||||
209,2.0e-16
|
|
9
tests/data/atmosphere/atmosphere_transmittance_1.csv
Normal file
9
tests/data/atmosphere/atmosphere_transmittance_1.csv
Normal file
@ -0,0 +1,9 @@
|
||||
wavelength,spectral flux density
|
||||
200,1
|
||||
201,1
|
||||
202,1
|
||||
203,0.9
|
||||
204,0.8
|
||||
205,0.7
|
||||
206,0.6
|
||||
207,0.5
|
|
11
tests/data/straylight/zodiacal_emission_1.csv
Normal file
11
tests/data/straylight/zodiacal_emission_1.csv
Normal file
@ -0,0 +1,11 @@
|
||||
wavelength,spectral flux density
|
||||
200,1.1e-16
|
||||
201,1.2e-16
|
||||
202,1.3e-16
|
||||
203,1.4e-16
|
||||
204,1.5e-16
|
||||
205,1.6e-16
|
||||
206,1.7e-16
|
||||
207,1.8e-16
|
||||
208,1.9e-16
|
||||
209,2.0e-16
|
|
22
tests/test_Atmosphere.py
Normal file
22
tests/test_Atmosphere.py
Normal file
@ -0,0 +1,22 @@
|
||||
from unittest import TestCase
|
||||
from esbo_etc import Atmosphere, FileTarget, SpectralQty
|
||||
import numpy as np
|
||||
import astropy.units as u
|
||||
|
||||
|
||||
class TestAtmosphere(TestCase):
|
||||
def setUp(self):
|
||||
self.target = FileTarget("data/target/target_demo_1.csv")
|
||||
self.atmosphere = Atmosphere(self.target, "data/atmosphere/atmosphere_transmittance_1.csv",
|
||||
"data/atmosphere/atmosphere_emission_1.csv")
|
||||
|
||||
def test_calcSignal(self):
|
||||
self.assertEqual(self.atmosphere.calcSignal(),
|
||||
SpectralQty(np.arange(200, 208) << u.nm, [1.10e-15, 1.20e-15, 1.30e-15, 1.26e-15, 1.20e-15,
|
||||
1.12e-15, 1.02e-15, 0.9e-15] << u.W / (
|
||||
u.m ** 2 * u.nm)))
|
||||
|
||||
def test_calcNoise(self):
|
||||
self.assertEqual(self.atmosphere.calcNoise(),
|
||||
SpectralQty(np.arange(200, 208) << u.nm, [1.1e-16, 1.2e-16, 1.3e-16, 1.4e-16, 1.5e-16, 1.6e-16,
|
||||
1.7e-16, 1.8e-16] << u.W / (u.m ** 2 * u.nm * u.sr)))
|
22
tests/test_StrayLight.py
Normal file
22
tests/test_StrayLight.py
Normal file
@ -0,0 +1,22 @@
|
||||
from unittest import TestCase
|
||||
from esbo_etc import StrayLight, FileTarget, SpectralQty
|
||||
import numpy as np
|
||||
import astropy.units as u
|
||||
|
||||
|
||||
class TestStrayLight(TestCase):
|
||||
def setUp(self):
|
||||
self.target = FileTarget("data/target/target_demo_1.csv")
|
||||
self.zodiac = StrayLight(self.target, "data/straylight/zodiacal_emission_1.csv")
|
||||
|
||||
def test_calcSignal(self):
|
||||
self.assertEqual(self.zodiac.calcSignal(),
|
||||
SpectralQty(np.arange(200, 210) << u.nm, [1.1e-15, 1.2e-15, 1.3e-15, 1.4e-15, 1.5e-15, 1.6e-15,
|
||||
1.7e-15, 1.8e-15, 1.9e-15, 2.0e-15] << u.W /
|
||||
(u.m ** 2 * u.nm)))
|
||||
|
||||
def test_calcNoise(self):
|
||||
self.assertEqual(self.zodiac.calcNoise(),
|
||||
SpectralQty(np.arange(200, 210) << u.nm, [1.1e-16, 1.2e-16, 1.3e-16, 1.4e-16, 1.5e-16, 1.6e-16,
|
||||
1.7e-16, 1.8e-16, 1.9e-16, 2.0e-16] << u.W /
|
||||
(u.m ** 2 * u.nm * u.sr)))
|
Loading…
Reference in New Issue
Block a user