Commit bc781275 authored by Médéric Boquien's avatar Médéric Boquien
Browse files

If there is the redshift information then there is necessarily the luminosity...

If there is the redshift information then there is necessarily the luminosity distance too. No need to test separately for the presence of each.
parent 7b73f41d
......@@ -282,8 +282,11 @@ class SED(object):
# have to resample to spectrum.
if 'redshift' in self.info:
key = (wavelength.size, filter_name, self.info['redshift'])
dist = self.info['universe.luminosity_distance']
else:
key = (wavelength.size, filter_name, 0.)
dist = 10. * parsec
if key in self.cache_filters:
wavelength_r, transmission_r, lambda_eff = self.cache_filters[key]
else:
......@@ -314,11 +317,6 @@ class SED(object):
l_lambda_r = np.interp(wavelength_r, wavelength, self.luminosity)
if 'universe.luminosity_distance' in self.info:
dist = self.info['universe.luminosity_distance']
else:
dist = 10. * parsec
f_lambda = utils.luminosity_to_flux(
utils.flux_trapz(transmission_r * l_lambda_r, wavelength_r, key),
dist)
......
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