Commit 51008fe7 authored by Médéric Boquien's avatar Médéric Boquien

Merge branch 'develop' into SSP

parents b6b61a90 7334ecab
......@@ -11,6 +11,8 @@
- Internally the luminosity distance was erroneously stored in Mpc rather than in m for non-zero redshifts. This has now been standardised to m. (Médéric Boquien)
- As the best-fit properties are computed at the exact observed redshift, correct the scaling factor as it is computed at the grid redshift. This corrects for slight offsets on the best-fit properties when the input redshift has more decimals than the grid redshift. (Médéric Boquien)
- Fix the pip install by making pcigale.managers discoverable. (Yannick Roehlly)
- When using a parameters file, Boolean values were not correctly interpreted. (Médéric Boquien, reported by Eric Martínez, INAOE)
- Make sure that the best-fit models are stored with the correct scaling factor when the distance is given explicitly (Médéric Boquien)
### Optimised
- Slight speedup of the computation of the likelihood from the χ² (Médéric Boquien)
......
......@@ -269,6 +269,6 @@ def bestfit(oidx, obs):
* corr_dz
if gbl_conf['analysis_params']["save_best_sed"]:
sed.to_fits('out/{}'.format(obs.id), scaling)
sed.to_fits('out/{}'.format(obs.id), scaling * corr_dz)
gbl_counter.inc()
......@@ -64,7 +64,10 @@ class MBB(SedModule):
self.epsilon = float(self.parameters["epsilon_mbb"])
self.T = float(self.parameters["t_mbb"])
self.beta = float(self.parameters["beta_mbb"])
self.energy_balance = bool(self.parameters["energy_balance"])
if type(self.parameters["energy_balance"]) is str:
self.energy_balance = self.parameters["energy_balance"].lower() == 'true'
else:
self.energy_balance = bool(self.parameters["energy_balance"])
if self.epsilon < 0.:
raise Exception("Error, epsilon_mbb must be ≥ 0.")
......
......@@ -95,7 +95,10 @@ class NebularEmission(SedModule):
self.fesc = float(self.parameters['f_esc'])
self.fdust = float(self.parameters['f_dust'])
self.lines_width = float(self.parameters['lines_width'])
self.emission = bool(self.parameters["emission"])
if type(self.parameters["emission"]) is str:
self.emission = self.parameters["emission"].lower() == 'true'
else:
self.emission = bool(self.parameters["emission"])
if self.fesc < 0. or self.fesc > 1:
raise Exception("Escape fraction must be between 0 and 1")
......
......@@ -73,7 +73,10 @@ class Sfh2Exp(SedModule):
self.burst_age = int(self.parameters["burst_age"])
age = int(self.parameters["age"])
sfr_0 = float(self.parameters["sfr_0"])
normalise = bool(self.parameters["normalise"])
if type(self.parameters["normalise"]) is str:
normalise = self.parameters["normalise"].lower() == 'true'
else:
normalise = bool(self.parameters["normalise"])
# Time grid and age. If needed, the age is rounded to the inferior Myr
time_grid = np.arange(age)
......
......@@ -63,7 +63,10 @@ class SfhBuat08(SedModule):
def _init_code(self):
self.velocity = float(self.parameters["velocity"])
self.age = int(self.parameters["age"])
normalise = bool(self.parameters["normalise"])
if type(self.parameters["normalise"]) is str:
normalise = self.parameters["normalise"].lower() == 'true'
else:
normalise = bool(self.parameters["normalise"])
# Time grid and age. If needed, the age is rounded to the inferior Myr
time_grid = np.arange(self.age)
......
......@@ -52,7 +52,10 @@ class SfhQuenchSmooth(SedModule):
def _init_code(self):
self.quenching_age = int(self.parameters["quenching_time"])
self.quenching_factor = float(self.parameters["quenching_factor"])
self.normalise = bool(self.parameters["normalise"])
if type(self.parameters["normalise"]) is str:
normalise = self.parameters["normalise"].lower() == 'true'
else:
normalise = bool(self.parameters["normalise"])
def process(self, sed):
"""
......
......@@ -52,7 +52,10 @@ class SfhQuenchTrunk(SedModule):
def _init_code(self):
self.quenching_age = int(self.parameters["quenching_age"])
self.quenching_factor = float(self.parameters["quenching_factor"])
self.normalise = bool(self.parameters["normalise"])
if type(self.parameters["normalise"]) is str:
normalise = self.parameters["normalise"].lower() == 'true'
else:
normalise = bool(self.parameters["normalise"])
def process(self, sed):
"""
......
......@@ -81,7 +81,10 @@ class SFHDelayed(SedModule):
self.age_burst = int(self.parameters["age_burst"])
self.f_burst = float(self.parameters["f_burst"])
sfr_A = float(self.parameters["sfr_A"])
normalise = bool(self.parameters["normalise"])
if type(self.parameters["normalise"]) is str:
normalise = self.parameters["normalise"].lower() == 'true'
else:
normalise = bool(self.parameters["normalise"])
# Time grid for each component
t = np.arange(self.age_main)
......
......@@ -76,7 +76,10 @@ class SFHDelayedBQ(SedModule):
self.age_bq = int(self.parameters["age_bq"])
self.r_sfr = float(self.parameters["r_sfr"])
sfr_A = float(self.parameters["sfr_A"])
normalise = bool(self.parameters["normalise"])
if type(self.parameters["normalise"]) is str:
normalise = self.parameters["normalise"].lower() == 'true'
else:
normalise = bool(self.parameters["normalise"])
# Delayed SFH
t = np.arange(self.age_main)
......
......@@ -59,9 +59,12 @@ class SfhFromFile(SedModule):
def _init_code(self):
filename = self.parameters['filename']
normalise = bool(self.parameters["normalise"])
age = int(self.parameters['age'])
self.sfr_column_number = int(self.parameters['sfr_column'])
if type(self.parameters["normalise"]) is str:
normalise = self.parameters["normalise"].lower() == 'true'
else:
normalise = bool(self.parameters["normalise"])
table = read_table(filename)
self.sfr = table.columns[self.sfr_column_number].data.astype(np.float)
......
......@@ -73,7 +73,10 @@ class SfhPeriodic(SedModule):
self.tau_bursts = float(self.parameters["tau_bursts"])
age = int(self.parameters["age"])
sfr_A = float(self.parameters["sfr_A"])
normalise = bool(self.parameters["normalise"])
if type(self.parameters["normalise"]) is str:
normalise = self.parameters["normalise"].lower() == 'true'
else:
normalise = bool(self.parameters["normalise"])
time_grid = np.arange(0, age)
self.sfr = np.zeros_like(time_grid, dtype=np.float)
......
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