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)
|
||||
self.__noise = SpectralQty(emissivity.wl, bb(emissivity.wl)) * emissivity
|
||||
elif isinstance(emissivity, str):
|
||||
em = SpectralQty.fromFile(emissivity, u.nm, u.dimensionless_unscaled)
|
||||
bb = self.__gb_factory(temp)
|
||||
self.__noise = SpectralQty(em.wl, bb(em.wl)) * em
|
||||
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
|
||||
else:
|
||||
bb = self.__gb_factory(temp, emissivity)
|
||||
self.__noise = bb
|
||||
|
Loading…
Reference in New Issue
Block a user