Commit 38f500f5 authored by Médéric Boquien's avatar Médéric Boquien

Optimise the retrieval of a luminosity component as cigale has not supported...

Optimise the retrieval of a luminosity component as cigale has not supported having several modules of the same name in many years now.
parent 027a891c
...@@ -220,9 +220,6 @@ class SED(object): ...@@ -220,9 +220,6 @@ class SED(object):
def get_lumin_contribution(self, name): def get_lumin_contribution(self, name):
"""Get the luminosity vector of a given contribution """Get the luminosity vector of a given contribution
If the name of the contribution is not unique in the SED, the flux of
the last one is returned.
Parameters Parameters
---------- ----------
name: string name: string
...@@ -235,10 +232,7 @@ class SED(object): ...@@ -235,10 +232,7 @@ class SED(object):
wavelength grid. wavelength grid.
""" """
# Find the index of the _last_ name element return self.luminosities[self.contribution_names.index(name)]
idx = (len(self.contribution_names) - 1 -
self.contribution_names[::-1].index(name))
return self.luminosities[idx]
def compute_fnu(self, filter_name): def compute_fnu(self, filter_name):
""" """
......
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