Commit c7072d8b authored by Yannick Roehlly's avatar Yannick Roehlly

Postfix the key instead of prefixing

Instead of prefixing the key in the SED with the module name, we postfix
them with the same postfix as the module name if any. This makes easier
to inter-change modules adding the same information (for instance
attenuation modules adding the attenuation value).
That implies that when using several modules adding the same
information, one must postfix the name of each.
parent a78bf8c3
......@@ -34,7 +34,7 @@ class Module(common.SEDCreationModule):
"look for the attenuation (in W) to re-emit. You can give several "
"keys separated with a & (don't use commas), a re-emission "
"contribution will be added for each key.",
None
"attenuation"
))
])
......
......@@ -185,14 +185,14 @@ class Module(common.SEDCreationModule):
"string",
"Name of the contribution containing the spectrum of the "
"young population.",
"m2005_young"
"ssp_young"
)),
("old_contribution_name", (
"string",
"Name of the contribution containing the spectrum of the "
"old population. If it is set to 'None', only one population "
"is considered.",
"m2005_old"
"ssp_old"
)),
("uv_bump_wavelength", (
"float",
......
......@@ -111,14 +111,14 @@ class Module(common.SEDCreationModule):
"string",
"Name of the contribution containing the spectrum of the "
"young population.",
"m2005_young"
"ssp_young"
)),
("old_contribution_name", (
"string",
"Name of the contribution containing the spectrum of the "
"old population. If it is set to 'None', only one population "
"is considered.",
"m2005_old"
"ssp_old"
)),
("uv_bump_wavelength", (
"float",
......
......@@ -82,7 +82,8 @@ class Module(common.SEDCreationModule):
sed.add_module(self.name, self.parameters)
sed.add_info("redshift" + self.postfix, self.parameters['redshift'])
sed.add_info("redshift" + self.postfix,
self.parameters['redshift'])
sed.add_info('rtau' + self.postfix, self.parameters['rtau'])
sed.add_contribution(
......
......@@ -99,7 +99,7 @@ class Module(common.SEDCreationModule):
# We normalise the SFH to have one solar mass produced.
sfr = sfr / np.trapz(sfr * 1.e6, time_grid)
sed.add_module(name, self.parameters)
sed.add_module(self.name, self.parameters)
# Add the sfh and the output parameters to the SED.
sed.sfh = (time_grid, sfr)
......
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