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

PEP8-fication of mbb.py

parent 8818ce40
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
Modified Black Body module Modified Black Body module
====================================== ======================================
This module implements a modified black body (MBB). This MMB can be This module implements a modified black body (MBB). This MMB can be a
a stand-alone IR emission or it can come as an additional component. stand-alone IR emission or it can come as an additional component. The energy
The energy balance can be set to check the presence of a component balance can be set to check the presence of a component or not to account for
or not to account for the emission of a region completely embedded the emission of a region completely embedded in dust and not visible in the
in dust and not visible in the wavelength range. wavelength range.
""" """
...@@ -104,24 +104,27 @@ class MBB(CreationModule): ...@@ -104,24 +104,27 @@ class MBB(CreationModule):
energy_balance = (self.parameters["energy_balance"].lower() == "true") energy_balance = (self.parameters["energy_balance"].lower() == "true")
if energy_balance: if energy_balance:
# Since we can have another contribution to L_dust and the modified black body # Since we can have another contribution to L_dust and the modified
# enters into the energy budget, energy balance, we have to save a new negative # black body enters into the energy budget, energy balance, we have
# component for each one, previously existing as: # to save a new negative component for each one, previously
# existing as:
# luminosity_other_balance = -luminosity_other * (1-epsilon); # luminosity_other_balance = -luminosity_other * (1-epsilon);
# epsilon being the contribution of the present MBB to L_dust. # epsilon being the contribution of the present MBB to L_dust.
other_dust_contributions = [contrib for contrib in sed.contribution_names other_dust_contributions = [contrib for contrib in
if "dust" in contrib] sed.contribution_names if
"dust" in contrib]
for item in other_dust_contributions: for item in other_dust_contributions:
item_balance = item + '_balance' item_balance = item + '_balance'
lumin = sed.get_lumin_contribution(item) lumin = sed.get_lumin_contribution(item)
wavelength = sed.wavelength_grid wavelength = sed.wavelength_grid
sed.add_info(item_balance, 1., True) sed.add_info(item_balance, 1., True)
sed.add_contribution(item_balance, wavelength, -lumin * epsilon) sed.add_contribution(item_balance, wavelength, -lumin *
epsilon)
# If the modified black body does not enter into the energy budget, # If the modified black body does not enter into the energy budget,
# we do not change the luminosity of other dust contributions. # we do not change the luminosity of other dust contributions.
# The luminosity of the modified black body L_MBB = epsilon * L_dust. # Luminosity of the modified black body: L_MBB = epsilon * L_dust.
# The total dust luminosity will be : L_dust(inside energy budget) + L_MBB. # Total dust luminosity: L_dust(inside energy budget) + L_MBB.
# We add the contribution of the MBB to L_dust. # We add the contribution of the MBB to L_dust.
sed.add_contribution('dust.mbb', self.wave, sed.add_contribution('dust.mbb', self.wave,
......
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