Try to convert emissivity to float
This commit is contained in:
parent
4bd8df8f86
commit
9b31b5d26e
@ -45,9 +45,14 @@ class AHotOpticalComponent(AOpticalComponent):
|
|||||||
bb = self.__gb_factory(temp)
|
bb = self.__gb_factory(temp)
|
||||||
self.__noise = SpectralQty(emissivity.wl, bb(emissivity.wl)) * emissivity
|
self.__noise = SpectralQty(emissivity.wl, bb(emissivity.wl)) * emissivity
|
||||||
elif isinstance(emissivity, str):
|
elif isinstance(emissivity, str):
|
||||||
em = SpectralQty.fromFile(emissivity, u.nm, u.dimensionless_unscaled)
|
try:
|
||||||
bb = self.__gb_factory(temp)
|
em = float(emissivity)
|
||||||
self.__noise = SpectralQty(em.wl, bb(em.wl)) * em
|
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
|
||||||
else:
|
else:
|
||||||
bb = self.__gb_factory(temp, emissivity)
|
bb = self.__gb_factory(temp, emissivity)
|
||||||
self.__noise = bb
|
self.__noise = bb
|
||||||
|
Loading…
Reference in New Issue
Block a user