2020-04-08 09:56:04 +02:00
|
|
|
from abc import abstractmethod
|
2020-04-16 09:35:24 +02:00
|
|
|
from ..IRadiant import IRadiant
|
2020-04-08 09:56:04 +02:00
|
|
|
from ..SpectralQty import SpectralQty
|
2020-04-08 13:36:08 +02:00
|
|
|
import astropy.units as u
|
2020-04-16 09:35:24 +02:00
|
|
|
import numpy as np
|
2020-04-24 11:05:01 +02:00
|
|
|
from logging import info, debug
|
2020-04-08 09:56:04 +02:00
|
|
|
|
|
|
|
|
2020-04-16 09:35:24 +02:00
|
|
|
class ATarget(IRadiant):
|
2020-04-08 09:56:04 +02:00
|
|
|
"""
|
|
|
|
Abstract super class for target models
|
|
|
|
"""
|
2020-04-08 18:16:12 +02:00
|
|
|
|
2020-04-08 09:56:04 +02:00
|
|
|
@abstractmethod
|
2020-04-16 15:08:47 +02:00
|
|
|
@u.quantity_input(wl_bins="length")
|
|
|
|
def __init__(self, sfd: SpectralQty, wl_bins: u.Quantity):
|
2020-04-08 09:56:04 +02:00
|
|
|
"""
|
|
|
|
Initialize a new target
|
|
|
|
|
|
|
|
Parameters
|
|
|
|
----------
|
|
|
|
sfd: SpectralQty
|
|
|
|
The spectral flux density of the target
|
|
|
|
"""
|
2020-04-16 13:04:21 +02:00
|
|
|
self.__sfd = sfd
|
2020-04-16 15:08:47 +02:00
|
|
|
self.__wl_bins = wl_bins
|
2020-04-08 09:56:04 +02:00
|
|
|
|
2020-04-24 17:10:08 +02:00
|
|
|
def calcBackground(self) -> SpectralQty:
|
2020-04-08 09:56:04 +02:00
|
|
|
"""
|
2020-04-24 17:10:08 +02:00
|
|
|
Calculate the spectral radiance of the target's background
|
2020-04-08 09:56:04 +02:00
|
|
|
|
|
|
|
Returns
|
|
|
|
-------
|
2020-04-24 17:10:08 +02:00
|
|
|
background : SpectralQty
|
|
|
|
The spectral radiance of the target's background
|
2020-04-08 09:56:04 +02:00
|
|
|
"""
|
2020-04-24 11:05:01 +02:00
|
|
|
info("Calculating Noise for class '" + self.__class__.__name__ + "'.")
|
2020-04-24 17:10:08 +02:00
|
|
|
background = SpectralQty(self.__wl_bins, np.repeat(0, len(self.__wl_bins)) << u.W / (u.m**2 * u.nm * u.sr))
|
|
|
|
debug(background)
|
|
|
|
return background
|
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-24 11:05:01 +02:00
|
|
|
info("Calculating Signal for class '" + self.__class__.__name__ + "'.")
|
|
|
|
debug(self.__sfd)
|
2020-04-16 13:04:21 +02:00
|
|
|
return self.__sfd
|