Commit 44e99b1d authored by Médéric Boquien's avatar Médéric Boquien

The galaxy_mass parameter confuses a lot of people. Change its name to...

The galaxy_mass parameter confuses a lot of people. Change its name to sfh.integrated because it is actually the integral of the SFR.
parent cfd85b8c
......@@ -92,13 +92,13 @@ class Sfh2Exp(CreationModule):
# Compute the galaxy mass and normalise the SFH to 1 solar mass
# produced if asked to.
self.galaxy_mass = np.sum(self.sfr) * 1e6
self.sfr_integrated = np.sum(self.sfr) * 1e6
if normalise:
self.sfr /= self.galaxy_mass
self.galaxy_mass = 1.
self.sfr /= self.sfr_integrated
self.sfr_integrated = 1.
else:
self.sfr *= sfr_0
self.galaxy_mass *= sfr_0
self.sfr_integrated *= sfr_0
def process(self, sed):
"""Add a double decreasing exponential Star Formation History.
......@@ -113,7 +113,7 @@ class Sfh2Exp(CreationModule):
# Add the sfh and the output parameters to the SED.
sed.sfh = (self.time_grid, self.sfr)
sed.add_info("galaxy_mass", self.galaxy_mass, True)
sed.add_info("sfh.integrated", self.sfr_integrated, True)
sed.add_info("sfh.tau_main", self.tau_main)
sed.add_info("sfh.tau_burst", self.tau_burst)
sed.add_info("sfh.f_burst", self.f_burst)
......
......@@ -83,22 +83,21 @@ class SfhBuat08(CreationModule):
c = np.interp(velocity, paper_velocities, paper_cs)
# Main SFR
#
t = time_grid / 1000 # The time is in Gyr in the formulae
sfr = 10**(a + b * np.log10(t) + c * t**.5) / 1.e9
# Compute the galaxy mass and normalise the SFH to 1 solar mass
# produced if asked to.
galaxy_mass = np.sum(sfr) * 1e6
sfr_integrated = np.sum(sfr) * 1e6
if normalise:
sfr /= galaxy_mass
galaxy_mass = 1.
sfr /= sfr_integrated
sfr_integrated = 1.
sed.add_module(self.name, self.parameters)
# Add the sfh and the output parameters to the SED.
sed.sfh = (time_grid, sfr)
sed.add_info("galaxy_mass", galaxy_mass, True)
sed.add_info("sfh.integrated", sfr_integrated, True)
sed.add_info("sfh.velocity", velocity)
# CreationModule to be returned by get_module
......
......@@ -76,13 +76,13 @@ class SfhQuench(CreationModule):
# Compute the galaxy mass and normalise the SFH to 1 solar mass
# produced if asked to.
galaxy_mass = np.sum(sfr) * 1e6
sfr_integrated = np.sum(sfr) * 1e6
if normalise:
sfr /= galaxy_mass
galaxy_mass = 1.
sfr /= sfr_integrated
sfr_integrated = 1.
sed.sfh = (time, sfr)
sed.add_info("galaxy_mass", galaxy_mass, True, force=True)
sed.add_info("sfh.integrated", sfr_integrated, True, force=True)
sed.add_module(self.name, self.parameters)
......
......@@ -72,19 +72,19 @@ class SFHDelayed(CreationModule):
# Compute the galaxy mass and normalise the SFH to 1 solar mass
# produced if asked to.
galaxy_mass = np.sum(sfr) * 1e6
sfr_integrated = np.sum(sfr) * 1e6
if normalise:
sfr /= galaxy_mass
galaxy_mass = 1.
sfr /= sfr_integrated
sfr_integrated = 1.
else:
sfr *= sfr_A
galaxy_mass *= sfr_A
sfr_integrated *= sfr_A
sed.add_module(self.name, self.parameters)
# Add the sfh and the output parameters to the SED.
sed.sfh = (time_grid, sfr)
sed.add_info("galaxy_mass", galaxy_mass, True)
sed.add_info("sfh.integrated", sfr_integrated, True)
sed.add_info("sfh.tau_main", tau_main)
# CreationModule to be returned by get_module
......
......@@ -83,14 +83,14 @@ class SfhFromFile(CreationModule):
# Compute the galaxy mass and normalise the SFH to 1 solar mass
# produced if asked to.
galaxy_mass = np.sum(sfr) * 1e6
sfr_integrated = np.sum(sfr) * 1e6
if normalise:
sfr /= galaxy_mass
galaxy_mass = 1.
sfr /= sfr_integrated
sfr_integrated = 1.
sed.add_module(self.name, self.parameters)
sed.sfh = (time_grid, sfr)
sed.add_info("galaxy_mass", galaxy_mass, True)
sed.add_info("sfh.integrated", sfr_integrated, True)
sed.add_info("sfh.id", sfr_column_number+1)
# CreationModule to be returned by get_module
......
......@@ -96,13 +96,13 @@ class SfhPeriodic(CreationModule):
# Compute the galaxy mass and normalise the SFH to 1 solar mass
# produced if asked to.
self.galaxy_mass = np.sum(self.sfr) * 1e6
self.sfr_integrated = np.sum(self.sfr) * 1e6
if normalise:
self.sfr /= self.galaxy_mass
self.galaxy_mass = 1.
self.sfr /= self.sfr_integrated
self.sfr_integrated = 1.
else:
self.sfr *= sfr_A
self.galaxy_mass *= sfr_A
self.sfr_integrated *= sfr_A
def process(self, sed):
"""Add a star formation history formed by several regularly-spaced SF
......@@ -117,7 +117,7 @@ class SfhPeriodic(CreationModule):
sed.add_module(self.name, self.parameters)
sed.sfh = (self.time_grid, self.sfr)
sed.add_info("galaxy_mass", self.galaxy_mass, True)
sed.add_info("sfh.integrated", self.sfr_integrated, True)
sed.add_info("sfh.type_bursts", self.type_bursts)
sed.add_info("sfh.delta_bursts", self.delta_bursts)
sed.add_info("sfh.tau_bursts", self.tau_bursts)
......
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