Commit 3957ae60 authored by BURGARELLA Denis's avatar BURGARELLA Denis

Merge branch 'release/v0.7.1'

parents 11dbd038 11c232eb
# Change Log
## 0.7.1 (2015-11-30)
### 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)
### Changed
### Fixed
- Running the scripts in parallel trigger a deadlock on OS X with python 3.5. A workaround has been implemented. (Médéric Boquien)
- When no dust emission module is used, pcigale genconf complains that no dust attenuation module is used. Correctly specify dust emission and not attenuation. (Médéric Boquien and Laure Ciesla)
- Allowing more flexibility to read ASCII files broke the handling of FITS files. It is now fixed. (Yannick Roehlly)
### Optimised
## 0.7.0 (2015-11-19)
### Added
- The pcigale-mock utility has been added to generate plots comparing the exact and pcigale-estimated parameters. This requires pcigale to be run beforehand with the pdf_analysis module and the mock_flag option set to True. (Denis Burgarella and Médéric Boquien)
......
......@@ -126,6 +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]
n_variables = len(analysed_variables)
save = {key: config["save_{}".format(key)].lower() == "true"
for key in ["best_sed", "chi2", "pdf"]}
......@@ -182,7 +184,7 @@ class PdfAnalysis(AnalysisModule):
n_params * n_variables),
(n_params, n_variables))
initargs = (params, filters, analysed_variables, model_redshifts,
initargs = (params, filters, analysed_variables_nolog, model_redshifts,
model_fluxes, model_variables, time.time(),
mp.Value('i', 0))
if cores == 1: # Do not create a new process
......
......@@ -265,14 +265,23 @@ def analysis(idx, obs):
# We compute the weighted average and standard deviation using the
# likelihood as weight.
for i, variable in enumerate(gbl_analysed_variables):
if variable.endswith('_log'):
variable = variable.strip('_log')
_ = np.log10
maxstd = lambda mean, std: max(0.02, std)
else:
_ = lambda x: x
maxstd = lambda mean, std: max(0.05 * mean, std)
if variable in sed.mass_proportional_info:
mean, std = weighted_param(gbl_model_variables[wz, i][wlikely]
* scaling[wlikely], likelihood)
mean, std = weighted_param(_(gbl_model_variables[wz, i][wlikely]
* scaling[wlikely]), likelihood)
else:
mean, std = weighted_param(gbl_model_variables[wz, i][wlikely],
mean, std = weighted_param(_(gbl_model_variables[wz, i][wlikely]),
likelihood)
gbl_analysed_averages[idx, i] = mean
gbl_analysed_std[idx, i] = max(0.05 * mean, std)
gbl_analysed_std[idx, i] = maxstd(mean, std)
gbl_best_fluxes[idx, :] = gbl_model_fluxes[best_index, :] \
* scaling[best_index_z]
......
......@@ -304,7 +304,7 @@ class Configuration(object):
"recommended. Without it the Lyman continuum "
"is left untouched.",
'dust attenuation': "No dust attenuation module found.",
'dust emission': "No dust attenuation module found.",
'dust emission': "No dust emission module found.",
'AGN': "No AGN module found.",
'radio': "No radio module found.",
'redshift': "ERROR! No redshifting module found."}
......
......@@ -32,7 +32,7 @@ def read_table(file_):
"""
try:
table = Table.read(file_, delimiter='\s')
table = Table.read(file_)
except Exception: # astropy should raise a specific exception
try:
table = Table.read(file_, format="ascii", delimiter='\s')
......
......@@ -122,6 +122,12 @@ def plot_filters(fnames):
def main():
if sys.version_info[:2] >= (3, 4):
mp.set_start_method('spawn')
else:
print("Could not set the multiprocessing start method to spawn. If "
"you encounter a deadlock, please upgrade to Python≥3.4.")
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(help="List of commands")
......
......@@ -363,6 +363,12 @@ def sed(config, sed_type, nologo):
def main():
if sys.version_info[:2] >= (3, 4):
mp.set_start_method('spawn')
else:
print("Could not set the multiprocessing start method to spawn. If "
"you encounter a deadlock, please upgrade to Python≥3.4.")
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--conf-file', dest='config_file',
......
......@@ -26,7 +26,7 @@ entry_points = {
setup(
name="pcigale",
version="0.7.0",
version="0.7.1",
packages=find_packages(exclude=["database_builder"]),
install_requires=['numpy', 'scipy', 'sqlalchemy', 'matplotlib',
......
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