Commit ede07146 authored by Guang's avatar Guang

enable the output of Lnu_2keV

parent 32e7293e
......@@ -53,12 +53,11 @@ class Xray(SedModule):
# Define wavelenght corresponding to some energy in units of nm.
lam_0p5keV = c*cst.h / (5e2*cst.eV)
lam_2keV = c*cst.h / (2e3*cst.eV)
self.lam_2keV = lam_2keV
lam_10keV = c*cst.h / (1e4*cst.eV)
self.lam_10keV = lam_10keV
lam_100keV = c*cst.h / (1e5*cst.eV)
self.lam_2keV = lam_2keV
self.lam_10keV = c*cst.h / (1e4*cst.eV)
# Define frequency corresponding to 2 keV in units of Hz.
nu_2keV = c / lam_2keV
self.nu_2keV = c / lam_2keV
# We define the wavelength range for the non thermal emission
# corresponding to 0.4-1200 keV
......@@ -83,11 +82,6 @@ class Xray(SedModule):
# Normaliz the SED at 2 keV
self.lumin_corona /= lam_2keV**(self.gam - 3.) * \
np.exp(-lam_100keV/lam_2keV)
# Normalisation factor from the optical/X-ray correlation to apply
# to the AGN 2500A intrinsic luminosity, i.e., L_lam_2keV value
# when L_nu_2500A = 1 W/Hz
L_lam_2keV = 10**(self.alpha_ox/0.3838) * nu_2keV**2/c
self.lumin_corona *= L_lam_2keV
def process(self, sed):
"""Add the X-ray contribution.
......@@ -127,13 +121,17 @@ class Xray(SedModule):
# Mezcua et al. 2018, Eq. 2
l_lmxb_xray_2to10keV = mstar * \
10**(33.276 - 1.503*logT - 0.423*logT**2 + 0.425*logT**3 + 0.136*logT**4)
# Calculate L_lam_2keV from Lnu_2500A
Lnu_2keV = 10**(self.alpha_ox/0.3838) * Lnu_2500A
L_lam_2keV = Lnu_2keV * self.nu_2keV**2/c
# Calculate total AGN corona X-ray luminosity
l_agn_xray_total = np.trapz(Lnu_2500A * self.lumin_corona,
l_agn_xray_total = np.trapz(L_lam_2keV * self.lumin_corona,
x=self.wave)
# Calculate 2-10 keV AGN corona X-ray luminosity
lam_idxs = np.where( (self.wave>=self.lam_10keV) & \
(self.wave<=self.lam_2keV) )
l_agn_xray_2to10keV = np.trapz(Lnu_2500A * self.lumin_corona[lam_idxs],
l_agn_xray_2to10keV = np.trapz(L_lam_2keV * self.lumin_corona[lam_idxs],
x=self.wave[lam_idxs])
# Save the results
......@@ -143,11 +141,12 @@ class Xray(SedModule):
sed.add_info("xray.lmxb_Lx_2to10keV", l_lmxb_xray_2to10keV, True)
sed.add_info("xray.agn_Lx_total", l_agn_xray_total, True)
sed.add_info("xray.agn_Lx_2to10keV", l_agn_xray_2to10keV, True)
sed.add_info("xray.agn_Lnu_2keV", Lnu_2keV, True)
# Add the SED components
sed.add_contribution('xray.hot_gas', self.wave, self.lumin_hotgas * l_hotgas_xray_0p5to2keV)
sed.add_contribution('xray.high_mass_binary', self.wave, self.lumin_xrb * l_hmxb_xray_2to10keV)
sed.add_contribution('xray.low_mass_binary', self.wave, self.lumin_xrb * l_lmxb_xray_2to10keV)
sed.add_contribution('xray.agn_corona', self.wave, self.lumin_corona * Lnu_2500A)
sed.add_contribution('xray.agn_corona', self.wave, self.lumin_corona * L_lam_2keV)
# 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