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

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
...@@ -6,6 +6,7 @@ ...@@ -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) - 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) - 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) - 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 ### Changed
- Python 3.6 is now the minimum required version. (Médéric Boquien) - 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) - 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): ...@@ -68,10 +68,10 @@ class PdfAnalysis(AnalysisModule):
False False
)), )),
("save_chi2", ( ("save_chi2", (
"boolean()", "option('all', 'none', 'properties', 'fluxes')",
"If true, for each observation and each analysed property, save " "Save the raw chi2. It occupies ~15 MB/million models/variable. "
"the raw chi2. It occupies ~15 MB/million models/variable.", "Allowed values are 'all', 'none', 'properties', and 'fluxes'.",
False "none"
)), )),
("lim_flag", ( ("lim_flag", (
"boolean()", "boolean()",
......
...@@ -177,7 +177,8 @@ def analysis(idx, obs): ...@@ -177,7 +177,8 @@ def analysis(idx, obs):
mean, std = weighted_param(_(values[wlikely]), likelihood) mean, std = weighted_param(_(values[wlikely]), likelihood)
gbl_results.bayes.intmean[prop][idx] = mean gbl_results.bayes.intmean[prop][idx] = mean
gbl_results.bayes.interror[prop][idx] = std 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)) save_chi2(obs, prop, gbl_models, chi2, _(values))
for prop in gbl_results.bayes.extmean: for prop in gbl_results.bayes.extmean:
...@@ -191,7 +192,8 @@ def analysis(idx, obs): ...@@ -191,7 +192,8 @@ def analysis(idx, obs):
likelihood) likelihood)
gbl_results.bayes.extmean[prop][idx] = mean gbl_results.bayes.extmean[prop][idx] = mean
gbl_results.bayes.exterror[prop][idx] = std 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, save_chi2(obs, prop, gbl_models, chi2,
_(values * scaling * corr_dz)) _(values * scaling * corr_dz))
...@@ -201,7 +203,8 @@ def analysis(idx, obs): ...@@ -201,7 +203,8 @@ def analysis(idx, obs):
likelihood) likelihood)
gbl_results.bayes.fluxmean[band][idx] = mean gbl_results.bayes.fluxmean[band][idx] = mean
gbl_results.bayes.fluxerror[band][idx] = std 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) save_chi2(obs, band, gbl_models, chi2, values * scaling)
best_idx_z = np.nanargmin(chi2) 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