Commit 1c11ed6a authored by Guang's avatar Guang

add type-1 AGN extinction & add 2-7 keV X-ray filter

parent f8fa47a8
# xray_boxcar_2to7keV
# energy
# boxcar shape filter for 2-7 keV X-ray
1.7712e+00 0.000
1.7938e+00 1.000
1.8166e+00 1.000
1.8397e+00 1.000
1.8632e+00 1.000
1.8869e+00 1.000
1.9109e+00 1.000
1.9353e+00 1.000
1.9599e+00 1.000
1.9849e+00 1.000
2.0101e+00 1.000
2.0357e+00 1.000
2.0617e+00 1.000
2.0879e+00 1.000
2.1145e+00 1.000
2.1414e+00 1.000
2.1687e+00 1.000
2.1963e+00 1.000
2.2243e+00 1.000
2.2526e+00 1.000
2.2813e+00 1.000
2.3103e+00 1.000
2.3398e+00 1.000
2.3696e+00 1.000
2.3997e+00 1.000
2.4303e+00 1.000
2.4612e+00 1.000
2.4926e+00 1.000
2.5243e+00 1.000
2.5565e+00 1.000
2.5890e+00 1.000
2.6220e+00 1.000
2.6554e+00 1.000
2.6892e+00 1.000
2.7235e+00 1.000
2.7581e+00 1.000
2.7933e+00 1.000
2.8288e+00 1.000
2.8649e+00 1.000
2.9013e+00 1.000
2.9383e+00 1.000
2.9757e+00 1.000
3.0136e+00 1.000
3.0520e+00 1.000
3.0908e+00 1.000
3.1302e+00 1.000
3.1701e+00 1.000
3.2104e+00 1.000
3.2513e+00 1.000
3.2927e+00 1.000
3.3346e+00 1.000
3.3771e+00 1.000
3.4201e+00 1.000
3.4637e+00 1.000
3.5078e+00 1.000
3.5525e+00 1.000
3.5977e+00 1.000
3.6435e+00 1.000
3.6899e+00 1.000
3.7369e+00 1.000
3.7845e+00 1.000
3.8327e+00 1.000
3.8815e+00 1.000
3.9309e+00 1.000
3.9810e+00 1.000
4.0317e+00 1.000
4.0830e+00 1.000
4.1350e+00 1.000
4.1877e+00 1.000
4.2410e+00 1.000
4.2950e+00 1.000
4.3497e+00 1.000
4.4051e+00 1.000
4.4612e+00 1.000
4.5180e+00 1.000
4.5755e+00 1.000
4.6338e+00 1.000
4.6928e+00 1.000
4.7526e+00 1.000
4.8131e+00 1.000
4.8744e+00 1.000
4.9365e+00 1.000
4.9993e+00 1.000
5.0630e+00 1.000
5.1275e+00 1.000
5.1928e+00 1.000
5.2589e+00 1.000
5.3258e+00 1.000
5.3937e+00 1.000
5.4624e+00 1.000
5.5319e+00 1.000
5.6024e+00 1.000
5.6737e+00 1.000
5.7460e+00 1.000
5.8191e+00 1.000
5.8932e+00 1.000
5.9683e+00 1.000
6.0443e+00 1.000
6.1213e+00 1.000
6.1992e+00 0.000
......@@ -84,8 +84,23 @@ class Fritz2006(SedModule):
'cigale_list(minvalue=0., maxvalue=1.)',
"AGN fraction.",
0.1
)),
('EBV', (
'cigale_list(minvalue=0.)',
"E(B-V) for extinction in polar direction",
0.1
)),
('temperature', (
'cigale_list(minvalue=0.)',
"Temperature of the dust in K",
100.
)),
("emissivity", (
"cigale_list(minvalue=0.)",
"Emissivity index of the dust.",
1.6
))
])
])
def _init_code(self):
"""Get the template set out of the database"""
......@@ -96,6 +111,9 @@ class Fritz2006(SedModule):
self.opening_angle = (180. - self.parameters["opening_angle"]) / 2.
self.psy = float(self.parameters["psy"])
self.fracAGN = float(self.parameters["fracAGN"])
self.EBV = float(self.parameters["EBV"])
self.temperature = float(self.parameters["temperature"])
self.emissivity = float(self.parameters["emissivity"])
with Database() as base:
self.fritz2006 = base.get_fritz2006(self.r_ratio, self.tau,
......@@ -124,19 +142,50 @@ class Fritz2006(SedModule):
sed.add_info('agn.opening_angle', self.parameters["opening_angle"])
sed.add_info('agn.psy', self.psy)
sed.add_info('agn.fracAGN', self.fracAGN)
sed.add_info('agn.EBV', self.EBV)
sed.add_info('agn.temperature', self.temperature)
sed.add_info('agn.emissivity', self.emissivity)
# We define various constants necessary to compute the model. For
# consistency, we define the speed of light in nm s¯¹ rather than in
# m s¯¹.
c = cst.c * 1e9
lambda_0 = 200e3
# Calculate the extinction (SMC)
k_lam = 1.39*(self.fritz2006.wave/1e3)**-1.2-0.38
A_lam = k_lam * self.EBV
# Set negative value to zero
A_lam[np.where(A_lam<0)] = 0
# The extinction factor, flux_1/flux_0
ext_fac = 10**(A_lam/-2.5)
# Calculate the new AGN SED shape after extinction
# The direct and scattered components (line-of-sight) are extincted
lumin_agn_new = self.fritz2006.lumin_agn * ext_fac
lumin_scatt_new = self.fritz2006.lumin_scatt * ext_fac
# Calculate the total extincted luminosity averaged over all directions
l_ext = np.trapz(self.fritz2006.lumin_intrin_agn * (1-ext_fac),
x=self.fritz2006.wave) * \
(1 - np.sin( np.deg2rad(self.opening_angle/2.) ))
# Casey (2012) modified black body model
conv = c / (self.fritz2006.wave * self.fritz2006.wave)
lumin_blackbody = (conv * (1. - np.exp(-(lambda_0 / self.fritz2006.wave)
** self.emissivity)) * (c / self.fritz2006.wave) ** 3. / (np.exp(
cst.h * c / (self.fritz2006.wave * cst.k * self.temperature)) - 1.))
lumin_blackbody *= l_ext / np.trapz(lumin_blackbody, x=self.fritz2006.wave)
# Add the black body to dust thermal emission
lumin_therm_new = self.fritz2006.lumin_therm + lumin_blackbody
# Normalize direct, scatter, and thermal components
norm = np.trapz(lumin_therm_new, x=self.fritz2006.wave)
lumin_therm_new /= norm
lumin_scatt_new /= norm
lumin_agn_new /= norm
# Compute the AGN luminosity
if self.fracAGN < 1.:
agn_power = luminosity * (1./(1.-self.fracAGN) - 1.)
l_agn_therm = agn_power
l_agn_scatt = np.trapz(agn_power * self.fritz2006.lumin_scatt,
x=self.fritz2006.wave)
l_agn_agn = np.trapz(agn_power * self.fritz2006.lumin_agn,
x=self.fritz2006.wave)
l_agn_scatt = np.trapz(agn_power * lumin_scatt_new, x=self.fritz2006.wave)
l_agn_agn = np.trapz(agn_power * lumin_agn_new, x=self.fritz2006.wave)
l_agn_total = l_agn_therm + l_agn_scatt + l_agn_agn
# Intrinsic (de-reddened) AGN luminosity from the central source
l_agn_intrin_agn = np.trapz(agn_power * self.fritz2006.lumin_intrin_agn,
......@@ -160,11 +209,11 @@ class Fritz2006(SedModule):
sed.add_info('agn.agn_intrin_Lnu_2500A', l_agn_2500A, True)
sed.add_contribution('agn.fritz2006_therm', self.fritz2006.wave,
agn_power * self.fritz2006.lumin_therm)
agn_power * lumin_therm_new)
sed.add_contribution('agn.fritz2006_scatt', self.fritz2006.wave,
agn_power * self.fritz2006.lumin_scatt)
agn_power * lumin_scatt_new)
sed.add_contribution('agn.fritz2006_agn', self.fritz2006.wave,
agn_power * self.fritz2006.lumin_agn)
agn_power * lumin_agn_new)
# SedModule to be returned by get_module
......
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