ESBO-ETC/esbo_etc/classes/target/ATarget.py

45 lines
1.1 KiB
Python
Raw Normal View History

2020-04-08 09:56:04 +02:00
from abc import abstractmethod
from ..ITransmissive import ITransmissive
from ..SpectralQty import SpectralQty
2020-04-08 13:36:08 +02:00
import astropy.units as u
2020-04-08 09:56:04 +02:00
class ATarget(ITransmissive):
"""
Abstract super class for target models
"""
@abstractmethod
def __init__(self, sfd: SpectralQty):
"""
Initialize a new target
Parameters
----------
sfd: SpectralQty
The spectral flux density of the target
"""
self._sfd = sfd
def calcNoise(self) -> SpectralQty:
"""
Calculate the spectral radiance of the target's noise
Returns
-------
noise : SpectralQty
The spectral radiance of the target's noise
"""
2020-04-08 13:36:08 +02:00
return SpectralQty(self._sfd.wl, [0] * len(self._sfd.wl) << u.W / (u.m**2 * u.nm * u.sr))
2020-04-08 09:56:04 +02:00
def calcSignal(self) -> SpectralQty:
"""
Calculate the spectral flux density of the target's signal
Returns
-------
signal : SpectralQty
The spectral flux density of the target's signal
"""
2020-04-08 13:36:08 +02:00
return self._sfd
2020-04-08 09:56:04 +02:00