Commit 91ae47f6 authored by Médéric Boquien's avatar Médéric Boquien

We need to start the age grid at 0 rather than 1. Otherwise when we do not...

We need to start the age grid at 0 rather than 1. Otherwise when we do not normalise the SFH, the scale would be wrong, with the SFR at the first time step being sfr0×exp(-1/tau_main) rather than sfr0.
parent 8af8476b
......@@ -16,6 +16,7 @@
- When estimating a parameter in log, these were not scaled appropriately and taken in log when saving the related χ² and PDF. (Médéric Boquien)
- In the presence of upper limits, correct the scaling factor of the models to the observations before computing the χ², not after. (Médéric Boquien)
- When called without arguments, pcigale-plots would crash and display the backtrace. Now it displays the a short help showing how to use it. (Médéric Boquien)
- For sfh2exp, when setting the scale of the SFH with sfr0, the normalisation was incorrect by a factor exp(-1/tau_main). (Médéric Boquien)
### Optimised
- Prior to version 0.7.0, we needed to maintain the list of redshifts for all the computed models. Past 0.7.0 we just infer the redshift from a list unique redshifts. This means that we can now discard the list of redshifts for all the models and only keep the list of unique redshifts. This saves ~8 MB of memory for every 10⁶ models. the models should be computed slightly faster but it is in the measurement noise. (Médéric Boquien)
......
......@@ -76,8 +76,8 @@ class Sfh2Exp(CreationModule):
normalise = (self.parameters["normalise"].lower() == "true")
# Time grid and age. If needed, the age is rounded to the inferior Myr
self.time_grid = np.arange(1, age + 1)
time_grid_burst = np.arange(1, self.burst_age + 1)
self.time_grid = np.arange(age)
time_grid_burst = np.arange(self.burst_age)
# SFR for each component
self.sfr = np.exp(-self.time_grid / self.tau_main)
......@@ -88,7 +88,7 @@ class Sfh2Exp(CreationModule):
# We add the age burst exponential for ages superior to age -
# burst_age
self.sfr[-time_grid_burst[-1]:] += sfr_burst
self.sfr[-(time_grid_burst[-1]+1):] += sfr_burst
# Compute the galaxy mass and normalise the SFH to 1 solar mass
# produced if asked to.
......
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