Try to convert emissivity to float

This commit is contained in:
Lukas Klass 2020-04-22 10:36:27 +02:00
parent 4bd8df8f86
commit 9b31b5d26e

View File

@ -45,6 +45,11 @@ class AHotOpticalComponent(AOpticalComponent):
bb = self.__gb_factory(temp)
self.__noise = SpectralQty(emissivity.wl, bb(emissivity.wl)) * emissivity
elif isinstance(emissivity, str):
try:
em = float(emissivity)
bb = self.__gb_factory(temp, em)
self.__noise = bb
except ValueError:
em = SpectralQty.fromFile(emissivity, u.nm, u.dimensionless_unscaled)
bb = self.__gb_factory(temp)
self.__noise = SpectralQty(em.wl, bb(em.wl)) * em