Return thermal radiation as lambda
This commit is contained in:
parent
5f0af43b79
commit
b809951fc7
@ -3,7 +3,8 @@ from esbo_etc.classes.ITransmissive import ITransmissive
|
|||||||
from esbo_etc.classes.SpectralQty import SpectralQty
|
from esbo_etc.classes.SpectralQty import SpectralQty
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
import astropy.units as u
|
import astropy.units as u
|
||||||
from astropy.modeling.models import BlackBody
|
from esbo_etc.lib.helpers import gb_factory
|
||||||
|
from typing import Union, Callable
|
||||||
|
|
||||||
|
|
||||||
class AHotOpticalComponent(AOpticalComponent):
|
class AHotOpticalComponent(AOpticalComponent):
|
||||||
@ -12,7 +13,7 @@ class AHotOpticalComponent(AOpticalComponent):
|
|||||||
"""
|
"""
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@u.quantity_input(wl_bins='length', temp=[u.Kelvin, u.Celsius])
|
@u.quantity_input(wl_bins='length', temp=[u.Kelvin, u.Celsius])
|
||||||
def __init__(self, parent: ITransmissive, emissivity: SpectralQty, wl_bins: u.Quantity, temp: u.Quantity):
|
def __init__(self, parent: ITransmissive, emissivity: SpectralQty, temp: u.Quantity):
|
||||||
"""
|
"""
|
||||||
Initialize a new optical component with thermal emission
|
Initialize a new optical component with thermal emission
|
||||||
|
|
||||||
@ -22,8 +23,6 @@ class AHotOpticalComponent(AOpticalComponent):
|
|||||||
The parent element of the optical component from which the electromagnetic radiation is received.
|
The parent element of the optical component from which the electromagnetic radiation is received.
|
||||||
emissivity : SpectralQty
|
emissivity : SpectralQty
|
||||||
The spectral emissivity coefficient for the optical surface.
|
The spectral emissivity coefficient for the optical surface.
|
||||||
wl_bins : Quantity
|
|
||||||
Wavelengths used for binning
|
|
||||||
temp: Quantity in Kelvin / Celsius
|
temp: Quantity in Kelvin / Celsius
|
||||||
Temperature of the optical component
|
Temperature of the optical component
|
||||||
"""
|
"""
|
||||||
@ -31,18 +30,22 @@ class AHotOpticalComponent(AOpticalComponent):
|
|||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
if temp > 0 * u.K:
|
if temp > 0 * u.K:
|
||||||
# Create noise from black body model
|
# Create noise from black body model
|
||||||
bb = BlackBody(temperature=temp, scale=1. * u.W / (u.m ** 2 * u.nm * u.sr))
|
if isinstance(emissivity, SpectralQty):
|
||||||
self._noise = SpectralQty(wl_bins, bb(wl_bins)) * emissivity
|
bb = gb_factory(temp)
|
||||||
|
self._noise = SpectralQty(emissivity.wl, bb(emissivity.wl)) * emissivity
|
||||||
|
else:
|
||||||
|
bb = gb_factory(temp, emissivity)
|
||||||
|
self._noise = bb
|
||||||
else:
|
else:
|
||||||
self._noise = 0
|
self._noise = 0
|
||||||
|
|
||||||
def ownNoise(self) -> SpectralQty:
|
def ownNoise(self) -> Union[SpectralQty, Callable, int, float]:
|
||||||
"""
|
"""
|
||||||
Calculate the noise created by the optical component
|
Calculate the noise created by the optical component
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
noise : SpectralQty
|
noise : Union[SpectralQty, Callable, int, float]
|
||||||
The noise created by the optical component
|
The noise created by the optical component
|
||||||
"""
|
"""
|
||||||
return self._noise
|
return self._noise
|
||||||
|
Loading…
x
Reference in New Issue
Block a user