From 9166555994d5c923edc9d5c0632031116f6679e1 Mon Sep 17 00:00:00 2001 From: LukasK13 Date: Tue, 14 Apr 2020 14:29:50 +0200 Subject: [PATCH] Initial commit --- .../classes/optical_component/StrayLight.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 esbo_etc/classes/optical_component/StrayLight.py diff --git a/esbo_etc/classes/optical_component/StrayLight.py b/esbo_etc/classes/optical_component/StrayLight.py new file mode 100644 index 0000000..9f0442e --- /dev/null +++ b/esbo_etc/classes/optical_component/StrayLight.py @@ -0,0 +1,30 @@ +from esbo_etc.classes.optical_component.AOpticalComponent import AOpticalComponent +from esbo_etc.classes.ITransmissive import ITransmissive +from esbo_etc.classes.SpectralQty import SpectralQty +import astropy.units as u + + +class StrayLight(AOpticalComponent): + """ + A class to model additional stray light sources e.g. zodiacal light + """ + def __init__(self, parent: ITransmissive, emission: str = None) -> "Atmosphere": + """ + Initialize a new stray light source + + Parameters + ---------- + parent : ITransmissive + The parent element from which the electromagnetic radiation is received. + This element is usually of type Target or StrayLight. + emission : str + Path to the file containing the spectral radiance of the stray light source. + The format of the file will be guessed by `astropy.io.ascii.read()`. + """ + # Read the emission + emission_sqty = SpectralQty.fromFile(emission, wl_unit_default=u.nm, + qty_unit_default=u.W / (u.m**2 * u.nm * u.sr)) + # Create dummy transmittance + transmittance_sqty = SpectralQty(emission_sqty.wl, [1] * len(emission_sqty.wl) * u.dimensionless_unscaled) + # Initialize the super class + super().__init__(parent, transmittance_sqty, emission_sqty)