Commit f84db63e authored by Médéric Boquien's avatar Médéric Boquien

Simplify a bit the code by removing the normalisation option from the convolve...

Simplify a bit the code by removing the normalisation option from the convolve procedure as it duplicates the functionality from the SFH modules.
parent 3007158e
......@@ -61,7 +61,7 @@ class BC03(object):
self.color_table = color_table
self.lumin_table = lumin_table
def convolve(self, sfh_time, sfh_sfr, norm=False):
def convolve(self, sfh_time, sfh_sfr):
"""Convolve the SSP with a Star Formation History
Given a SFH (an time grid and the corresponding star formation rate
......@@ -79,8 +79,6 @@ class BC03(object):
the SSP time.
sfh_sfr: array of floats
Star Formation Rates in Msun/yr at each time of the SFH time grid.
norm: boolean
If true, the sfh will be normalised to 1 solar mass produced.
Returns
-------
......@@ -117,11 +115,6 @@ class BC03(object):
# Step between two item in the time grid in Myr
step = self.time_grid[1] - self.time_grid[0]
# If needed, we normalise the SFH to 1 solar mass produced.
if norm:
sfh_sfr = sfh_sfr / np.trapz(sfh_sfr * 1.e6,
self.time_grid[:idx + 1])
# As both the SFH and the SSP (limited to the age of the SFH) data now
# share the same time grid, the convolution is just a matter of
# reverting one and computing the sum of the one to one product; this
......
......@@ -70,7 +70,7 @@ class M2005(object):
self.mass_table = mass_table
self.spec_table = spec_table
def convolve(self, sfh_time, sfh_sfr, norm=False):
def convolve(self, sfh_time, sfh_sfr):
"""Convolve the SSP with a Star Formation History
Given a SFH (an time grid and the corresponding star formation rate
......@@ -89,8 +89,6 @@ class M2005(object):
compatible, i.e. with a precision limited to 1 Myr.
sfh_sfr: array of floats
Star Formation Rates in Msun/yr at each time of the SFH time grid.
norm: boolean
If true, the sfh will be normalised to 1 solar mass produced.
Returns
-------
......@@ -123,11 +121,6 @@ class M2005(object):
sfh_time, sfh_sfr,
left=0., right=0.)
# If needed, we normalise the SFH to 1 solar mass produced.
if norm:
sfh_sfr = sfh_sfr / np.trapz(sfh_sfr * 1.e6,
self.time_grid[:nb_steps])
# As both the SFH and the SSP (limited to the age of the SFH) data now
# share the same time grid, the convolution is just a matter of
# reverting one and computing the sum of the one to one product; this
......
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