Commit 2daf1d55 authored by Médéric Boquien's avatar Médéric Boquien

Allow to save the χ² only related to fluxes or to properties rather than an...

Allow to save the χ² only related to fluxes or to properties rather than an all or nothing approach.
parent 51f7afe7
Pipeline #1641 skipped with stage
......@@ -6,6 +6,7 @@
- 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)
- Implementation of the auto-detection of lines in the input flux file so they are automatically added to the list of bands in `pcigale.ini`. (Médéric Boquien)
- The `dl2007` and `dl2014` modules now provide \<U\>. (Médéric Boquien)
- Saving the χ² is now a bit more fine-grained. It is possible to save none, all, only the properties, or only the fluxes. (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)
......
......@@ -68,10 +68,10 @@ class PdfAnalysis(AnalysisModule):
False
)),
("save_chi2", (
"boolean()",
"If true, for each observation and each analysed property, save "
"the raw chi2. It occupies ~15 MB/million models/variable.",
False
"option('all', 'none', 'properties', 'fluxes')",
"Save the raw chi2. It occupies ~15 MB/million models/variable. "
"Allowed values are 'all', 'none', 'properties', and 'fluxes'.",
"none"
)),
("lim_flag", (
"boolean()",
......
......@@ -177,7 +177,8 @@ def analysis(idx, obs):
mean, std = weighted_param(_(values[wlikely]), likelihood)
gbl_results.bayes.intmean[prop][idx] = mean
gbl_results.bayes.interror[prop][idx] = std
if gbl_models.conf['analysis_params']['save_chi2'] is True:
if (gbl_models.conf['analysis_params']['save_chi2'] in
['all', 'properties']):
save_chi2(obs, prop, gbl_models, chi2, _(values))
for prop in gbl_results.bayes.extmean:
......@@ -191,7 +192,8 @@ def analysis(idx, obs):
likelihood)
gbl_results.bayes.extmean[prop][idx] = mean
gbl_results.bayes.exterror[prop][idx] = std
if gbl_models.conf['analysis_params']['save_chi2'] is True:
if (gbl_models.conf['analysis_params']['save_chi2'] in
['all', 'properties']):
save_chi2(obs, prop, gbl_models, chi2,
_(values * scaling * corr_dz))
......@@ -201,7 +203,8 @@ def analysis(idx, obs):
likelihood)
gbl_results.bayes.fluxmean[band][idx] = mean
gbl_results.bayes.fluxerror[band][idx] = std
if gbl_models.conf['analysis_params']['save_chi2'] is True:
if (gbl_models.conf['analysis_params']['save_chi2'] in
['all', 'fluxes']):
save_chi2(obs, band, gbl_models, chi2, values * scaling)
best_idx_z = np.nanargmin(chi2)
......
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