From e210cf0fa2baee33bc8316b7e9baba7db25da120 Mon Sep 17 00:00:00 2001 From: LukasK13 Date: Mon, 5 Oct 2020 20:47:10 +0200 Subject: [PATCH] Parameter local oscillator wavelength added --- docs/source/configuration/sensor.rst | 20 ++++++++++++++++++-- esbo_etc/classes/sensor/Heterodyne.py | 21 +++++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/docs/source/configuration/sensor.rst b/docs/source/configuration/sensor.rst index acbc2bb..c096417 100644 --- a/docs/source/configuration/sensor.rst +++ b/docs/source/configuration/sensor.rst @@ -227,7 +227,7 @@ Attributes: Heterodyne ---------- -The heterodyne sensor type allows to model a generic heterodyne radio receiver which uses an local oscillator and an mixer to create spectral images. The heterodyne-component contains several parameters which are explained in the following. All parameters are defined according to the `Guide to GREAT `_. +The heterodyne sensor type allows to model a generic DSB heterodyne radio receiver which uses an local oscillator and an mixer to create spectral images. The heterodyne-component contains several parameters which are explained in the following. All parameters are defined according to the `Guide to GREAT `_. .. code-block:: xml :linenos: @@ -238,6 +238,7 @@ The heterodyne sensor type allows to model a generic heterodyne radio receiver w + @@ -300,7 +301,7 @@ Attributes: lambda_line ^^^^^^^^^^^ -The wavelength of the observed line. +The wavelength or frequency of the observed line. .. code-block:: xml @@ -312,6 +313,21 @@ Attributes: * | **val_unit:** str, *optional* = "m" | The unit of the observed line wavelength. This has to be on of [``nm``, ``um``, ``mm``, ``cm``, ``m``, ``Hz``, ``kHZ``, ``MHz``, ``GHz``, ``THz``]. +lambda_local_oscillator +^^^^^^^^^^^ +The wavelength or frequency of the local oscillator. This parameter is optional. If no value is given, the noise temperature of the signal band is doubled. + +.. code-block:: xml + + + +Attributes: + * | **val:** float + | The wavelength of the local oscillator. + * | **val_unit:** str, *optional* = "m" + | The unit of the local oscillator wavelength. This has to be on of [``nm``, ``um``, ``mm``, ``cm``, ``m``, ``Hz``, ``kHZ``, ``MHz``, ``GHz``, ``THz``]. + + kappa ^^^^^ The instrument's backend degradation factor. diff --git a/esbo_etc/classes/sensor/Heterodyne.py b/esbo_etc/classes/sensor/Heterodyne.py index 1259a5c..79634c3 100644 --- a/esbo_etc/classes/sensor/Heterodyne.py +++ b/esbo_etc/classes/sensor/Heterodyne.py @@ -18,7 +18,7 @@ class Heterodyne(ASensor): def __init__(self, parent: IRadiant, aperture_efficiency: float, main_beam_efficiency: float, receiver_temp: u.Quantity, eta_fss: float, lambda_line: u.Quantity, kappa: float, common_conf: Entry, - n_on: float = None): + n_on: float = None, lambda_local_oscillator: u.Quantity = None): """ Initialize a new heterodyne detector @@ -48,6 +48,7 @@ class Heterodyne(ASensor): self.__receiver_temp = receiver_temp self.__eta_fss = eta_fss self.__lambda_line = lambda_line + self.__lambda_local_oscillator = lambda_local_oscillator self.__kappa = kappa self.__common_conf = common_conf self.__n_on = n_on @@ -78,7 +79,7 @@ class Heterodyne(ASensor): # Calculate the signal and background temperatures t_signal, t_background = self.calcTemperatures(background, signal, obstruction) line_ind = np.where(t_signal.wl == self.__lambda_line)[0][0] - t_sys = 2 * (t_background + self.__receiver_temp + t_signal) + t_sys = t_background + 2 * self.__receiver_temp + t_signal # Calculate the noise bandwidth delta_nu = t_signal.wl.to(u.Hz, equivalencies=u.spectral()) / (t_signal.wl / self.__common_conf.wl_delta() + 1) snr = [] @@ -121,7 +122,7 @@ class Heterodyne(ASensor): # Calculate the signal and background temperatures t_signal, t_background = self.calcTemperatures(background, signal, obstruction) line_ind = np.where(t_signal.wl == self.__lambda_line)[0][0] - t_sys = 2 * (t_background + self.__receiver_temp + t_signal) + t_sys = t_background + 2 * self.__receiver_temp + t_signal # Calculate the noise bandwidth delta_nu = t_signal.wl.to(u.Hz, equivalencies=u.spectral()) / (t_signal.wl / self.__common_conf.wl_delta() + 1) exp_time = [] @@ -172,7 +173,7 @@ class Heterodyne(ASensor): # Calculate the signal and background temperatures t_signal, t_background = self.calcTemperatures(background, signal, obstruction) line_ind = np.where(t_signal.wl == self.__lambda_line)[0][0] - t_sys = 2 * (t_background + self.__receiver_temp + t_signal) + t_sys = t_background + 2 * self.__receiver_temp + t_signal # Calculate the noise bandwidth delta_nu = t_signal.wl.to(u.Hz, equivalencies=u.spectral()) / (t_signal.wl / self.__common_conf.wl_delta() + 1) sensitivity = [] @@ -318,6 +319,14 @@ class Heterodyne(ASensor): t_signal = signal * (self.__main_beam_efficiency * signal.wl ** 2 / ( 2 * k_B) * self.__eta_fss * u.sr) t_signal = SpectralQty(t_signal.wl, t_signal.qty.decompose()) + + if self.__lambda_local_oscillator is None: + t_signal = t_signal * 2 + t_background = t_background * 2 + else: + t_signal = t_signal + t_signal.rebin(2 * self.__lambda_local_oscillator - t_signal.wl) + t_background = t_background + t_background.rebin(2 * self.__lambda_local_oscillator - t_background.wl) + logger.debug("Spectral signal temperature") logger.debug(t_signal) logger.debug("Target size: " + size) @@ -368,6 +377,10 @@ class Heterodyne(ASensor): mes = sensor.lambda_line.check_quantity("val", u.nm) if mes is not None: return "lambda_line: " + mes + if hasattr(sensor, "lambda_local_oscillator"): + mes = sensor.lambda_local_oscillator.check_quantity("val", u.nm) + if mes is not None: + return "lambda_local_oscillator: " + mes if not hasattr(sensor, "kappa"): return "Missing container 'kappa'." mes = sensor.kappa.check_float("val")