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

Port the Casey and the DL07 modules to the new way to deal with the attenuation.

parent ca82fe93
......@@ -36,11 +36,13 @@ class Module(common.SEDCreationModule):
"Mid-infrared powerlaw slope.",
None
)),
("attenuation_value_names", (
"list of strings",
"List of attenuation value names (in the SED's info dictionary)."
"A new re-emission contribution will be added for each one.",
None
('attenuation_value_keys', (
'string',
"Keys of the SED information dictionary where the module will "
"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.",
"attenuation"
))
])
......@@ -100,11 +102,16 @@ class Module(common.SEDCreationModule):
# Base name for adding information to the SED.
name = self.name or 'casey2012'
attenuation_value_keys = [
item.strip() for item in
self.parameters["attenuation_value_keys"].split("&")]
sed.add_module(name, self.parameters)
for key in self.parameters.keys():
sed.add_info(name + '_' + key, self.parameters[key])
sed.add_info("temperature" + self.postfix, self.parameters["temperature"])
sed.add_info("alpha" + self.postfix, self.parameters["alpha"])
sed.add_info("beta" + self.postfix, self.parameters["beta"])
for attenuation in self.parameters["attenuation_value_names"]:
for attenuation in attenuation_value_keys:
sed.add_contribution(
name + '_powerlaw_' + attenuation,
self.wave,
......
......@@ -50,7 +50,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"
))
])
......@@ -106,10 +106,10 @@ class Module(common.SEDCreationModule):
name = self.name or 'dl2007'
sed.add_module(name, self.parameters)
sed.add_info(name + '_qpah', self.parameters["qpah"])
sed.add_info(name + '_umin', self.parameters["umin"])
sed.add_info(name + '_umax', self.parameters["umax"])
sed.add_info(name + '_gamma', self.parameters["gamma"])
sed.add_info('qpah' + self.postfix, self.parameters["qpah"])
sed.add_info('umin' + self.postfix, self.parameters["umin"])
sed.add_info('umax' + self.postfix, self.parameters["umax"])
sed.add_info('gamma' + self.postfix, self.parameters["gamma"])
for attenuation in attenuation_value_keys:
sed.add_contribution(
......
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