Commit f79932ee authored by Médéric Boquien's avatar Médéric Boquien

Allow the fit of emission lines along with broadband data.

parent f255a11d
......@@ -4,6 +4,7 @@
### Added
- It is now possible to optionally indicate the distance in Mpc in the input file. If present it will be used in lieu of the distance computed from the redshift. This is especially useful in the nearby universe where the redshift is a very poor indicator of the actual distance. (Médéric Boquien)
- It is now possible to fit any physical property indicated by the code (e.g. equivalent width, dust luminosity, etc.). For this the physical property needs to be given in the input file and the properties to be fitted must be given in the properties filed in pcigale.ini. (Héctor Salas & Médéric Boquien)
- It is now possible to fit emission lines. For this the line has to be indicated in the same way as any other band both in the input flux file (in units of W/m²) and in the list of bands in `pcigale.ini`. Lines are prefixed with `line.` followed by the name of the line, for instance `line.H-alpha` for Hɑ. The following lines are supported at the moment: `Ly-alpha`, `CII-133.5`, `SiIV-139.7`, `CIV-154.9`, `HeII-164.0`, `OIII-166.5`, `CIII-190.9`, `CII-232.6`, `MgII-279.8`, `OII-372.7`, `H-10`, `H-9`, `NeIII-386.9` `HeI-388.9`, `H-epsilon`, `SII-407.0`, `H-delta`, `H-gamma`, `H-beta`, `OIII-495.9`, `OIII-500.7`, `OI-630.0`, `NII-654.8`, `H-alpha`, `NII-658.4`, `SII-671.6`, `SII-673.1`.
### Changed
- The `sfhdelayed` module has been extended to optionally include an exponential burst to model the latest episode of star formation. (Médéric Boquien & Barbara Lo Faro)
......
......@@ -55,8 +55,12 @@ class ModelsManager(object):
table = Table()
table.add_column(Column(self.block, name='id'))
for band in sorted(self.flux.keys()):
if band.startswith('line.'):
unit = 'W/m^2'
else:
unit = 'mJy'
table.add_column(Column(self.flux[band], name=band,
unit='mJy'))
unit=unit))
for prop in sorted(self.extprop.keys()):
table.add_column(Column(self.extprop[prop], name=prop))
for prop in sorted(self.intprop.keys()):
......
......@@ -371,8 +371,12 @@ class ResultsManager(object):
name="best."+prop))
for band in self.obs.bands:
if band.startswith('line.'):
unit = 'W/m^2'
else:
unit = 'mJy'
table.add_column(Column(self.best.flux[band],
name="best."+band, unit='mJy'))
name="best."+band, unit=unit))
table.write("out/{}.txt".format(filename), format='ascii.fixed_width',
......
......@@ -64,6 +64,7 @@ class SED(object):
self.contribution_names = []
self.luminosity = None
self.luminosities = None
self.lines = dict()
self.info = dict()
self.mass_proportional_info = set()
......@@ -286,6 +287,13 @@ class SED(object):
key = (wavelength.size, filter_name, 0.)
dist = 10. * parsec
if filter_name.startswith('line.'):
lum = 0
for name in filter_name.split('+'):
line = self.lines[name.split('.', maxsplit=1)[1]]
lum += line[1] + line[2] # Young and old components
return utils.luminosity_to_flux(lum, dist)
if key in self.cache_filters:
wavelength_r, transmission_r, lambda_piv = self.cache_filters[key]
else:
......@@ -373,6 +381,7 @@ class SED(object):
sed.luminosity = self.luminosity.copy()
sed.luminosities = self.luminosities.copy()
sed.contribution_names = self.contribution_names[:]
sed.lines = self.lines.copy()
sed.info = self.info.copy()
sed.mass_proportional_info = self.mass_proportional_info.copy()
......
......@@ -69,11 +69,12 @@ class Configuration(object):
"File containing the input data. The columns are 'id' (name of the"
" object), 'redshift' (if 0 the distance is assumed to be 10 pc), "
"'distance' (Mpc, optional, if present it will be used in lieu "
"of the distance computed from the redshift), the filter names for"
" the fluxes, and the filter names with the '_err' suffix for the "
"uncertainties. The fluxes and the uncertainties must be in mJy. "
"This file is optional to generate the configuration file, in "
"particular for the savefluxes module.")
"of the distance computed from the redshift), the filter names for "
"the fluxes, and the filter names with the '_err' suffix for the "
"uncertainties. The fluxes and the uncertainties must be in mJy "
"for broadband data and in W/m² for emission lines. This file is "
"optional to generate the configuration file, in particular for "
"the savefluxes module.")
self.spec['data_file'] = "string()"
self.config['parameters_file'] = ""
......
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