Test RadiantFactory
This commit is contained in:
parent
e7fbcaebe7
commit
fd4ae520f3
12
tests/data/atmosphere/emission.csv
Normal file
12
tests/data/atmosphere/emission.csv
Normal file
@ -0,0 +1,12 @@
|
||||
wavelength [nm],emission [W/(m^2*nm*sr)]
|
||||
400,1.00E-15
|
||||
410,1.00E-15
|
||||
420,1.00E-15
|
||||
430,1.00E-15
|
||||
440,1.00E-15
|
||||
450,1.00E-15
|
||||
460,1.00E-15
|
||||
470,1.00E-15
|
||||
480,1.00E-15
|
||||
490,1.00E-15
|
||||
500,1.00E-15
|
|
12
tests/data/atmosphere/transmittance.csv
Normal file
12
tests/data/atmosphere/transmittance.csv
Normal file
@ -0,0 +1,12 @@
|
||||
wavelength [nm],transmittance []
|
||||
400,1
|
||||
410,1
|
||||
420,1
|
||||
430,1
|
||||
440,1
|
||||
450,1
|
||||
460,1
|
||||
470,1
|
||||
480,1
|
||||
490,1
|
||||
500,1
|
|
12
tests/data/filter/emissivity.csv
Normal file
12
tests/data/filter/emissivity.csv
Normal file
@ -0,0 +1,12 @@
|
||||
wavelength [nm],emissivity []
|
||||
400,1
|
||||
410,1
|
||||
420,1
|
||||
430,1
|
||||
440,1
|
||||
450,1
|
||||
460,1
|
||||
470,1
|
||||
480,1
|
||||
490,1
|
||||
500,1
|
|
12
tests/data/lens/emissivity.csv
Normal file
12
tests/data/lens/emissivity.csv
Normal file
@ -0,0 +1,12 @@
|
||||
wavelength [nm],emissivity []
|
||||
400,1
|
||||
410,1
|
||||
420,1
|
||||
430,1
|
||||
440,1
|
||||
450,1
|
||||
460,1
|
||||
470,1
|
||||
480,1
|
||||
490,1
|
||||
500,1
|
|
12
tests/data/lens/transmittance.csv
Normal file
12
tests/data/lens/transmittance.csv
Normal file
@ -0,0 +1,12 @@
|
||||
wavelength [nm],transmittance []
|
||||
400,1
|
||||
410,1
|
||||
420,1
|
||||
430,1
|
||||
440,1
|
||||
450,1
|
||||
460,1
|
||||
470,1
|
||||
480,1
|
||||
490,1
|
||||
500,1
|
|
12
tests/data/mirror/emissivity.csv
Normal file
12
tests/data/mirror/emissivity.csv
Normal file
@ -0,0 +1,12 @@
|
||||
wavelength [nm],emissivity []
|
||||
400,1
|
||||
410,1
|
||||
420,1
|
||||
430,1
|
||||
440,1
|
||||
450,1
|
||||
460,1
|
||||
470,1
|
||||
480,1
|
||||
490,1
|
||||
500,1
|
|
12
tests/data/mirror/reflectance.csv
Normal file
12
tests/data/mirror/reflectance.csv
Normal file
@ -0,0 +1,12 @@
|
||||
wavelength [nm],reflectance []
|
||||
400,1
|
||||
410,1
|
||||
420,1
|
||||
430,1
|
||||
440,1
|
||||
450,1
|
||||
460,1
|
||||
470,1
|
||||
480,1
|
||||
490,1
|
||||
500,1
|
|
12
tests/data/straylight/emission.csv
Normal file
12
tests/data/straylight/emission.csv
Normal file
@ -0,0 +1,12 @@
|
||||
wavelength [nm],emission [W/(m^2*nm*sr)]
|
||||
400,1.00E-15
|
||||
410,1.00E-15
|
||||
420,1.00E-15
|
||||
430,1.00E-15
|
||||
440,1.00E-15
|
||||
450,1.00E-15
|
||||
460,1.00E-15
|
||||
470,1.00E-15
|
||||
480,1.00E-15
|
||||
490,1.00E-15
|
||||
500,1.00E-15
|
|
26
tests/test_RadiantFactory.py
Normal file
26
tests/test_RadiantFactory.py
Normal file
@ -0,0 +1,26 @@
|
||||
from unittest import TestCase
|
||||
from esbo_etc.classes.config import Configuration
|
||||
from esbo_etc.classes.RadiantFactory import RadiantFactory
|
||||
import esbo_etc.classes.optical_component as oc
|
||||
from esbo_etc.classes.target import BlackBodyTarget
|
||||
import astropy.units as u
|
||||
|
||||
|
||||
class TestRadiantFactory(TestCase):
|
||||
def test_fromConfig(self):
|
||||
conf = Configuration("data/esbo-etc_defaults.xml").conf
|
||||
factory = RadiantFactory(conf.common.wl_bins())
|
||||
parent = factory.fromConfig(conf)
|
||||
|
||||
parent_2 = BlackBodyTarget(conf.common.wl_bins(), 5778 * u.K, 10 * u.mag, "V")
|
||||
parent_2 = oc.Atmosphere(parent_2, "data/atmosphere/transmittance.csv", "data/atmosphere/emission.csv")
|
||||
parent_2 = oc.StrayLight(parent_2, "data/straylight/emission.csv")
|
||||
parent_2 = oc.Mirror(parent_2, "data/mirror/reflectance.csv", "data/mirror/emissivity.csv", 70 * u.K,
|
||||
obstruction=0.1, obstructor_temp=70 * u.K)
|
||||
parent_2 = oc.Mirror(parent_2, "data/mirror/reflectance.csv", "data/mirror/emissivity.csv", 70 * u.K)
|
||||
parent_2 = oc.Mirror(parent_2, "data/mirror/reflectance.csv", "data/mirror/emissivity.csv", 70 * u.K)
|
||||
parent_2 = oc.Filter.fromRange(parent_2, 400 * u.nm, 480 * u.nm, "data/filter/emissivity.csv", 70 * u.K)
|
||||
parent_2 = oc.Lens(parent_2, "data/lens/transmittance.csv", "data/lens/emissivity.csv", 70 * u.K)
|
||||
|
||||
self.assertEqual(parent.calcSignal(), parent_2.calcSignal())
|
||||
self.assertEqual(parent.calcNoise(), parent_2.calcNoise())
|
Loading…
x
Reference in New Issue
Block a user