Commit 7d83a5c4 authored by Médéric Boquien's avatar Médéric Boquien

Implement the possibility of specifying a list of bands for which to carry out...

Implement the possibility of specifying a list of bands for which to carry out a Bayesian flux estimate.
parent 8f826c53
......@@ -3,6 +3,7 @@
## Unreleased
### Added
- The (1+z1)/(1+z2) factor between observed and grid flux densities caused by the differential redshifting is now taken into account. With a default grid redshift rounding of two decimals this yields a difference of at most 0.5% in the estimated physical properties at z=0 and even less at higher z. (Médéric Boquien)
- The list of bands for which to carry out a Bayesian flux estimate is now configurable. By default this corresponds to the fitted bands but it also supports bands that are not included in the fit. This can be set in the `fluxes` parameter of the `pdf\_analysis` module. (Médéric Boquien)
### Changed
- Python 3.6 is now the minimum required version. (Médéric Boquien)
- The logo has now been moved to the lower-right corner of the figure so that it does not overlap with any information and it has been updated for a less pixelated version. (Médéric Boquien & Rodrigo González Castillo)
......
......@@ -55,6 +55,13 @@ class PdfAnalysis(AnalysisModule):
"are many models).",
["sfh.sfr", "sfh.sfr10Myrs", "sfh.sfr100Myrs"]
)),
("bands", (
"cigale_string_list()",
"List of bands for which to estimate the fluxes. Note that this is "
"independent from the fluxes actually fitted to estimate the "
"physical properties.",
None
)),
("save_best_sed", (
"boolean()",
"If true, save the best SED for each observation to a file.",
......
......@@ -39,7 +39,8 @@ class ModelsManager(object):
self.allextpropnames & props_nolog)
size = len(params.blocks[iblock])
self.flux = {band: SharedArray(size) for band in obs.bands}
self.flux = {band: SharedArray(size)
for band in set(obs.bands+conf['analysis_params']['bands'])}
self.intprop = {prop: SharedArray(size) for prop in self.intpropnames}
self.extprop = {prop: SharedArray(size) for prop in self.extpropnames}
......
......@@ -36,6 +36,7 @@ class BayesResultsManager(object):
intpropnames = [prop for prop in models.obs.conf['analysis_params']['variables']
if (prop in models.allintpropnames or
prop[:-4] in models.allintpropnames)]
fluxnames = [name for name in models.conf['analysis_params']['bands']]
self.nproperties = len(intpropnames) + len(extpropnames)
# Arrays where we store the data related to the models. For memory
......@@ -47,8 +48,8 @@ class BayesResultsManager(object):
self.interror = {prop: SharedArray(nobs) for prop in intpropnames}
self.extmean = {prop: SharedArray(nobs) for prop in extpropnames}
self.exterror = {prop: SharedArray(nobs) for prop in extpropnames}
self.fluxmean = {band: SharedArray(nobs) for band in models.flux}
self.fluxerror = {band: SharedArray(nobs) for band in models.flux}
self.fluxmean = {band: SharedArray(nobs) for band in fluxnames}
self.fluxerror = {band: SharedArray(nobs) for band in fluxnames}
self.weight = SharedArray(nobs)
@property
......
......@@ -247,6 +247,11 @@ class Configuration(object):
self.config['analysis_params'].comments[name] = wrap(desc)
self.spec['analysis_params'][name] = typ
if 'pdf_analysis' == module_name:
bands = [band for band in self.config['bands']
if not band.endswith('_err')]
self.config['analysis_params']['bands'] = bands
self.config.write()
self.spec.write()
......
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