Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cigale
CIGALE
Commits
b0f4a3dd
Commit
b0f4a3dd
authored
Aug 31, 2015
by
Médéric Boquien
Browse files
PEP8-fication of mbb.py
parent
8818ce40
Changes
1
Show whitespace changes
Inline
Side-by-side
pcigale/creation_modules/mbb.py
View file @
b0f4a3dd
...
...
@@ -8,11 +8,11 @@
Modified Black Body module
======================================
This module implements a modified black body (MBB). This MMB can be
a
stand-alone IR emission or it can come as an additional component.
The energy
balance can be set to check the presence of a component
or not to account for
the emission of a region completely embedded
in dust and not visible in the
wavelength range.
This module implements a modified black body (MBB). This MMB can be
a
stand-alone IR emission or it can come as an additional component.
The energy
balance can be set to check the presence of a component
or not to account for
the emission of a region completely embedded
in dust and not visible in the
wavelength range.
"""
...
...
@@ -104,24 +104,27 @@ class MBB(CreationModule):
energy_balance
=
(
self
.
parameters
[
"energy_balance"
].
lower
()
==
"true"
)
if
energy_balance
:
# Since we can have another contribution to L_dust and the modified black body
# enters into the energy budget, energy balance, we have to save a new negative
# component for each one, previously existing as:
# Since we can have another contribution to L_dust and the modified
# black body enters into the energy budget, energy balance, we have
# to save a new negative component for each one, previously
# existing as:
# luminosity_other_balance = -luminosity_other * (1-epsilon);
# epsilon being the contribution of the present MBB to L_dust.
other_dust_contributions
=
[
contrib
for
contrib
in
sed
.
contribution_names
if
"dust"
in
contrib
]
other_dust_contributions
=
[
contrib
for
contrib
in
sed
.
contribution_names
if
"dust"
in
contrib
]
for
item
in
other_dust_contributions
:
item_balance
=
item
+
'_balance'
lumin
=
sed
.
get_lumin_contribution
(
item
)
wavelength
=
sed
.
wavelength_grid
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,
# we do not change the luminosity of other dust contributions.
#
The l
uminosity of the modified black body L_MBB = epsilon * L_dust.
# T
he t
otal dust luminosity
will be
: L_dust(inside energy budget) + L_MBB.
#
L
uminosity of the modified black body
:
L_MBB = epsilon * L_dust.
# Total dust luminosity: L_dust(inside energy budget) + L_MBB.
# We add the contribution of the MBB to L_dust.
sed
.
add_contribution
(
'dust.mbb'
,
self
.
wave
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment