From 9010def4873e7b26b0213464b9be936be1f7a9bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20Boquien?=
Date: Mon, 7 Dec 2015 11:56:22 -0300
Subject: [PATCH] The detection of the '_log' suffix in variables and its
removal to compute the models was overzealous. Fix this.
---
CHANGELOG.md | 4 ++++
pcigale/analysis_modules/pdf_analysis/__init__.py | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ce354049c..dd19bcf18 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 0.8.1 (2015-12-07)
+### Fixed
+- To estimate parameters in log, pcigale determines which variables end with the "_log" string and removed it to compute the models. However in some circumstances, it was overzealous. This has been fixed. (Médéric Boquien)
+
## 0.8.0 (2015-11-01)
### Added
- The evaluation of the parameters is always done linearly. This can be a problem when estimating the SFR or the stellar mass for instance as it is usual to estimate their log rather. Because the log is non-linear, the likelihood-weigthed mean of the log is not the log of the likelihood-weighted mean. Therefore the estimation of the log of these parameters has to be done during the analysis step. This is now possible. The variables to be analysed in log just need to be indicated with the suffix "_log", for instance "stellar.m_star_log". (Médéric Boquien, idea suggested by Samir Salim)
diff --git a/pcigale/analysis_modules/pdf_analysis/__init__.py b/pcigale/analysis_modules/pdf_analysis/__init__.py
index c9d88d1a0..c1281ac51 100644
--- a/pcigale/analysis_modules/pdf_analysis/__init__.py
+++ b/pcigale/analysis_modules/pdf_analysis/__init__.py
@@ -126,8 +126,8 @@ class PdfAnalysis(AnalysisModule):
# Initalise variables from input arguments.
analysed_variables = config["analysed_variables"]
- analysed_variables_nolog = [variable.rstrip('_log') for variable in
- analysed_variables]
+ analysed_variables_nolog = [''.join(variable.rsplit('_log', 1)) for
+ variable in analysed_variables]
n_variables = len(analysed_variables)
save = {key: config["save_{}".format(key)].lower() == "true"
for key in ["best_sed", "chi2", "pdf"]}
--
2.26.2