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

Change how the IMF is handled. Now rather than a string with require an...

Change how the IMF is handled. Now rather than a string with require an integer. It is slightly less user friendly but it will make possible to store all the sed.info in a numpy array, which reduces the amount of memory required per model.
parent 610a74b2
......@@ -28,8 +28,8 @@ class BC03(CreationModule):
parameter_list = OrderedDict([
("imf", (
"string",
"Initial mass function: salp (Salpeter) or chab (Chabrier)",
"int",
"Initial mass function: 0 (Salpeter) or 1 (Chabrier)",
None
)),
("metallicity", (
......@@ -64,7 +64,10 @@ class BC03(CreationModule):
def _init_code(self):
"""Read the SSP from the database."""
imf = self.parameters["imf"]
if self.parameters["imf"] == 0:
imf = 'salp'
elif self.parameters["imf"] == 1:
imf = 'chab'
metallicity = float(self.parameters["metallicity"])
with Database() as database:
self.ssp = database.get_bc03(imf, metallicity)
......
......@@ -42,8 +42,8 @@ class M2005(CreationModule):
parameter_list = OrderedDict([
('imf', (
'string',
"Initial mass function, salp (Salpeter) or krou (Krupa)",
'int',
"Initial mass function: 0 (Salpeter) or 1 (Chabrier)",
None
)),
('metallicity', (
......@@ -102,7 +102,10 @@ class M2005(CreationModule):
def _init_code(self):
"""Read the SSP from the database."""
imf = self.parameters["imf"]
if self.parameters["imf"] == 0:
imf = 'salp'
elif self.parameters["imf"] == 1:
imf = 'chab'
metallicity = float(self.parameters["metallicity"])
with Database() as database:
self.ssp = database.get_m2005(imf, metallicity)
......
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