Commit 30b11265 authored by Yannick Roehlly's avatar Yannick Roehlly

Prepare the possibility to compute continuum only fluxes

Prepare to make it possible to get the flux in a filter without taking
into account the contribution from the spectral lines.
parent 272c8703
......@@ -39,7 +39,6 @@ Such SED is characterised by:
import numpy as np
from . import utils
from itertools import chain
from scipy.constants import c
from scipy.interpolate import interp1d
......@@ -309,7 +308,8 @@ class SED(object):
return self.luminosities[idx]
def compute_fnu(self, transmission, lambda_eff,
redshift=0, apply_redshift=False):
redshift=0, apply_redshift=False,
add_line_fluxes=True):
"""
Compute the Fν flux density corresponding the filter which
transmission is given.
......@@ -349,6 +349,10 @@ class SED(object):
flux. The default is False because we generally use a specific
module to apply the redshift.
add_line_flux : boolean
If true (default), the flux coming from the spectral lines will be
taken into account.
Return
------
fnu : float
......
......@@ -275,12 +275,13 @@ class Module(common.SEDCreationModule):
powerlaw_slope = float(self.parameters["powerlaw_slope"])
filters = self.filters
# Fλ fluxes in each filter before attenuation.
# Fλ fluxes (only from continuum) in each filter before attenuation.
flux_noatt = {}
for filter_name, filter_ in filters.items():
flux_noatt[filter_name] = sed.compute_fnu(
filter_.trans_table,
filter_.effective_wavelength)
filter_.effective_wavelength,
add_line_fluxes=False)
# Compute attenuation curve
sel_attenuation = a_vs_ebv(wavelength, uv_bump_wavelength,
......@@ -340,12 +341,13 @@ class Module(common.SEDCreationModule):
sed.add_info(name + "_attenuation",
attenuation_young + attenuation_old)
# Fλ fluxes in each filter after attenuation.
# Fλ fluxes (only from continuum) in each filter after attenuation.
flux_att = {}
for filter_name, filter_ in filters.items():
flux_att[filter_name] = sed.compute_fnu(
filter_.trans_table,
filter_.effective_wavelength)
filter_.effective_wavelength,
add_line_fluxes=False)
# Attenuation in each filter
for filter_name in filters:
......
......@@ -196,12 +196,13 @@ class Module(common.SEDCreationModule):
powerlaw_slope = float(self.parameters["powerlaw_slope"])
filters = self.filters
# Fλ fluxes in each filter before attenuation.
# Fλ fluxes (only from continuum)) in each filter before attenuation.
flux_noatt = {}
for filter_name, filter_ in filters.items():
flux_noatt[filter_name] = sed.compute_fnu(
filter_.trans_table,
filter_.effective_wavelength)
filter_.effective_wavelength,
add_line_fluxes=False)
# Compute attenuation curve
sel_attenuation = alambda_av(wavelength, powerlaw_slope,
......@@ -259,12 +260,13 @@ class Module(common.SEDCreationModule):
sed.add_info(name + "_attenuation",
attenuation_young + attenuation_old)
# Fλ fluxes in each filter after attenuation.
# Fλ fluxes (only in continuum) in each filter after attenuation.
flux_att = {}
for filter_name, filter_ in filters.items():
flux_att[filter_name] = sed.compute_fnu(
filter_.trans_table,
filter_.effective_wavelength)
filter_.effective_wavelength,
add_line_fluxes=False)
# Attenuation in each filter
for filter_name in filters:
......
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