Commit 8325609e authored by Yannick Roehlly's avatar Yannick Roehlly

Give name to module classes

It will make the documentation clearer.
parent 157a6c3e
......@@ -48,7 +48,7 @@ PLOT_L_MIN = 91
PLOT_L_MAX = 1e6
class Module(AnalysisModule):
class Psum(AnalysisModule):
"""psum analysis"""
parameter_list = OrderedDict([
......@@ -661,3 +661,6 @@ def bin_evenly(values, max_bins):
bin_digits = np.digitize(values, digitize_boundaries)
return (boundaries, bin_digits)
# AnalysisModule to be returned by get_module
Module = Psum
......@@ -26,7 +26,7 @@ from ..warehouse import SedWarehouse
from ..data import Database
class Module(AnalysisModule):
class SaveFluxes(AnalysisModule):
"""Save fluxes analysis module
This module saves a table containing all the parameters and desired fluxes
......@@ -147,3 +147,6 @@ class Module(AnalysisModule):
# The zip call is to convert the list of rows to a list of columns.
out_table = Table(zip(*out_rows), names=out_columns)
out_table.write(out_file, format=out_format)
# AnalysisModule to be returned by get_module
Module = SaveFluxes
......@@ -18,7 +18,7 @@ from . import CreationModule
from ..data import Database
class Module(CreationModule):
class BC03(CreationModule):
"""Bruzual and Charlot (2003) stellar emission module
This SED creation module convolves the SED star formation history with a
......@@ -132,3 +132,6 @@ class Module(CreationModule):
sed.add_contribution("ssp_young" + self.postfix,
young_wave,
young_lumin)
# CreationModule to be returned by get_module
Module = BC03
......@@ -17,7 +17,7 @@ from collections import OrderedDict
from . import CreationModule
class Module(CreationModule):
class Casey2012(CreationModule):
"""Casey (2012) templates IR re-emission
Given an amount of attenuation (e.g. resulting from the action of a dust
......@@ -128,3 +128,6 @@ class Module(CreationModule):
self.wave,
sed.info[attenuation] * self.lumin_blackbody
)
# CreationModule to be returned by get_module
Module = Casey2012
......@@ -16,7 +16,7 @@ from pcigale.data import Database
from . import CreationModule
class Module(CreationModule):
class Dale2014(CreationModule):
"""Dale et al. (2014) templates IR re-emission
Given an amount of attenuation (e.g. resulting from the action of a dust
......@@ -102,3 +102,6 @@ class Module(CreationModule):
self.model_quasar.wave,
frac_agn * sed.info[attenuation] * self.model_quasar.lumin
)
# CreationModule to be returned by get_module
Module = Dale2014
......@@ -16,7 +16,7 @@ from . import CreationModule
from ..data import Database
class Module(CreationModule):
class DH2002(CreationModule):
"""Dale and Helou (2002) templates IR re-emission module
Given an amount of attenuation (e.g. resulting from the action of a dust
......@@ -76,3 +76,6 @@ class Module(CreationModule):
self.dh2002.wavelength_grid,
sed.info[attenuation] * ir_template
)
# CreationModule to be returned by get_module
Module = DH2002
......@@ -17,7 +17,7 @@ from pcigale.data import Database
from . import CreationModule
class Module(CreationModule):
class DL2007(CreationModule):
"""Draine and Li (2007) templates IR re-emission module
Given an amount of attenuation (e.g. resulting from the action of a dust
......@@ -128,3 +128,6 @@ class Module(CreationModule):
self.model_minmax.wave,
sed.info[attenuation] * self.model_minmax.lumin
)
# CreationModule to be returned by get_module
Module = DL2007
......@@ -168,7 +168,7 @@ def a_vs_ebv(wavelength, bump_wave, bump_width, bump_ampl, power_slope):
return attenuation
class Module(CreationModule):
class CalzLeit(CreationModule):
"""Calzetti + Leitherer attenuation module
This module computes the Cardelli, Clayton and Mathis attenuation using the
......@@ -363,3 +363,6 @@ class Module(CreationModule):
sed.add_info(filter_name + "_attenuation" + self.postfix,
-2.5 * np.log(flux_att[filter_name] /
flux_noatt[filter_name]))
# CreationModule to be returned by get_module
Module = CalzLeit
......@@ -94,7 +94,7 @@ def alambda_av(wavelength, delta, bump_wave, bump_width, bump_ampl):
return attenuation
class Module(CreationModule):
class PowerLawAtt(CreationModule):
"""Power law attenuation module
This module computes the Cardelli, Clayton and Mathis attenuation using
......@@ -285,3 +285,6 @@ class Module(CreationModule):
sed.add_info(filter_name + "_attenuation" + self.postfix,
-2.5 * np.log(flux_att[filter_name] /
flux_noatt[filter_name]))
# CreationModule to be returned by get_module
Module = PowerLawAtt
......@@ -20,7 +20,7 @@ from ..sed import utils
from ..extern.lsst import Sed as lsst
class Module(CreationModule):
class IGMAtt(CreationModule):
"""Redshift a SED and add IGM attenuation
This module adds both the effect of redshift and inter-galactic medium
......@@ -102,3 +102,6 @@ class Module(CreationModule):
new_wavelen,
igm_effect
)
# CreationModule to be returned by get_module
Module = IGMAtt
......@@ -9,7 +9,7 @@ from scipy.constants import c
from . import CreationModule
class Module(CreationModule):
class Lines(CreationModule):
parameter_list = OrderedDict([
("Nly_key", (
......@@ -92,3 +92,6 @@ class Module(CreationModule):
intensity = ratio*flow_H
sed.add_lines(self.parameters["set_name"], wav, intensity, sigma)
# CreationModule to be returned by get_module
Module = Lines
......@@ -16,7 +16,7 @@ from collections import OrderedDict
from . import CreationModule
class Module(CreationModule):
class LoadSpecFile(CreationModule):
"""Module reading a spectrum from a file and adding it to the SED.
Note that this module uses the atpy module, which is not automatically
......@@ -62,3 +62,6 @@ class Module(CreationModule):
table[self.parameters['lambda_column']],
table[self.parameters['l_lambda_column']]
)
# CreationModule to be returned by get_module
Module = LoadSpecFile
......@@ -17,7 +17,7 @@ from . import CreationModule
from ..data import Database
class Module(CreationModule):
class M2005(CreationModule):
"""Maraston (2005) stellar emission module
This SED creation module convolves the SED star formation history with
......@@ -189,3 +189,6 @@ class Module(CreationModule):
sed.add_contribution("ssp_young" + self.postfix,
ssp.wavelength_grid,
young_spectrum)
# CreationModule to be returned by get_module
Module = M2005
......@@ -21,7 +21,7 @@ from . import CreationModule
AGE_LAPSE = 1
class Module(CreationModule):
class Sfh2Exp(CreationModule):
"""Double decreasing exponential Star Formation History
This module sets the SED star formation history (SFH) as a combination of
......@@ -115,3 +115,6 @@ class Module(CreationModule):
sed.add_info("sfh_tau_burst" + self.postfix, tau_burst)
sed.add_info("sfh_f_burst" + self.postfix, f_burst)
sed.add_info("sfh_burst_age" + self.postfix, burst_age)
# CreationModule to be returned by get_module
Module = Sfh2Exp
......@@ -17,7 +17,7 @@ from collections import OrderedDict
from . import CreationModule
class Module(CreationModule):
class SfhFromFile(CreationModule):
"""Module reading the SFH from a file
This module is used to read the Star Formation Histories from a FITS or
......@@ -88,3 +88,6 @@ class Module(CreationModule):
sed.add_module(self.name, self.parameters)
sed.sfh = (time_grid, sfr)
sed.add_info("sfh_id" + self.postfix, sfr_column_name)
# CreationModule to be returned by get_module
Module = SfhFromFile
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