Commit 1c774339 authored by Médéric Boquien's avatar Médéric Boquien

Raise an exception if the IMF is unknown

parent b2ff47cd
......@@ -55,6 +55,8 @@ class BC03(CreationModule):
imf = 'salp'
elif self.parameters["imf"] == 1:
imf = 'chab'
else:
raise Exception("IMF #{} unknown".format(self.parameters["imf"]))
metallicity = float(self.parameters["metallicity"])
with Database() as database:
self.ssp = database.get_bc03(imf, metallicity)
......
......@@ -67,6 +67,8 @@ class M2005(CreationModule):
imf = 'salp'
elif self.parameters["imf"] == 1:
imf = 'krou'
else:
raise Exception("IMF #{} unknown".format(self.parameters["imf"]))
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