Initial commit

This commit is contained in:
Lukas Klass 2020-04-14 14:30:02 +02:00
parent 9166555994
commit db0b61acff
5 changed files with 75 additions and 0 deletions

View 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
1 wavelength spectral flux density
2 200 1.1e-16
3 201 1.2e-16
4 202 1.3e-16
5 203 1.4e-16
6 204 1.5e-16
7 205 1.6e-16
8 206 1.7e-16
9 207 1.8e-16
10 208 1.9e-16
11 209 2.0e-16

View 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
1 wavelength spectral flux density
2 200 1
3 201 1
4 202 1
5 203 0.9
6 204 0.8
7 205 0.7
8 206 0.6
9 207 0.5

View 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
1 wavelength spectral flux density
2 200 1.1e-16
3 201 1.2e-16
4 202 1.3e-16
5 203 1.4e-16
6 204 1.5e-16
7 205 1.6e-16
8 206 1.7e-16
9 207 1.8e-16
10 208 1.9e-16
11 209 2.0e-16

22
tests/test_Atmosphere.py Normal file
View 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
View 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)))