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

Ensure that the .fnu @property returns a result even if the redshifting module...

Ensure that the .fnu @property returns a result even if the redshifting module has not been applied. By default in that case we assume a distance of 10 parsecs. Note that as the redshifting module is mandatory (it is needed to apply the IGM absorption, which has a small effect even at z=0 with this formula), it should not happen. Issue found by Yannick Roehlly.
parent 00aad4d4
......@@ -107,9 +107,12 @@ class SED(object):
"""
# Fλ flux density in W/m²/nm
f_lambda = utils.luminosity_to_flux(self.luminosity,
self.info
['universe.luminosity_distance'])
if 'universe.luminosity_distance' in self.info:
f_lambda = utils.luminosity_to_flux(self.luminosity,
self.info
['universe.luminosity_distance'])
else:
f_lambda = utils.luminosity_to_flux(self.luminosity, 10. * parsec)
# Fν flux density in mJy
f_nu = utils.lambda_flambda_to_fnu(self.wavelength_grid, f_lambda)
......
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