Commit a3e9b416 authored by Médéric Boquien's avatar Médéric Boquien
Browse files

PEP-8 fication of the radio module.

parent 0bac3629
......@@ -8,9 +8,9 @@
Radio module
=============================
This module implements the radio emission of galaxies, taking into account only the non-thermal emission.
The thermal emission is handled by the nebular module.
The parameters that this module takes as input are:
This module implements the radio emission of galaxies, taking into account only
the non-thermal emission. The thermal emission is handled by the nebular
module. The parameters that this module takes as input are:
- the value of the coefficient of the FIR/radio correlation
- the value of the spectral index of the power law emission from synchrotron.
......@@ -25,8 +25,9 @@ from . import CreationModule
class Radio(CreationModule):
"""Radio emission
Given the number of Lyman photons, the module computes the free-free (thermal) emission of galaxies.
Based on the SN collapse rate, the module computes the synchrotron (non-thermal) emission of galaxies.
Given the number of Lyman photons, the module computes the free-free
(thermal) emission of galaxies. Based on the SN collapse rate, the module
computes the synchrotron (non-thermal) emission of galaxies.
"""
......@@ -50,7 +51,7 @@ class Radio(CreationModule):
def _init_code(self):
"""Build the model for a given set of parameters."""
qir = float(self.parameters["qir"])
alpha = float(self.parameters["alpha"])
......@@ -59,15 +60,15 @@ class Radio(CreationModule):
# m s¯¹.
c = cst.c * 1e9
# We define the wavelength range for the non thermal emission
self.wave = np.logspace(5., 9., 1000.)
# We compute the synchrotron emission normalised at 21cm
self.lumin_nonthermal = (1./self.wave)**(-alpha + 2) / (1./2.1e8)**(-alpha + 2)
# Normalisation factor from the FIR/radio correlation to apply to the
self.wave = np.logspace(5., 9., 1000.)
# We compute the synchrotron emission normalised at 21cm
self.lumin_nonthermal = ((1./self.wave)**(-alpha + 2) /
(1./2.1e8)**(-alpha + 2))
# Normalisation factor from the FIR/radio correlation to apply to the
# IR luminosity
S21cm = (1./ (10**qir*3.75e12))*(c/(2.1e8)**2)
S21cm = (1. / (10**qir*3.75e12)) * (c/(2.1e8)**2)
self.lumin_nonthermal *= S21cm
def process(self, sed):
"""Add the radio contribution.
......@@ -83,7 +84,8 @@ class Radio(CreationModule):
sed.add_module(self.name, self.parameters)
sed.add_info("radio.qir", self.parameters["qir"])
sed.add_info("radio.alpha", self.parameters["alpha"])
sed.add_contribution('radio_nonthermal', self.wave, self.lumin_nonthermal * luminosity)
sed.add_contribution('radio_nonthermal', self.wave,
self.lumin_nonthermal * luminosity)
# CreationModule to be returned by get_module
Module = Radio
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment