Commit 9763d14e authored by Guang's avatar Guang
Browse files

enable the output of AGN total and 2-10keV X-ray luminosity

parent 00bc0855
......@@ -51,8 +51,11 @@ class Xray(SedModule):
# We define various constants necessary to compute the model. For
# consistency, we define speed of light in units of nm s¯¹
c = cst.c * 1e9
# Define wavelenght corresponding to 2 keV and 100 keV in units of nm.
# Define wavelenght corresponding to some energy in units of nm.
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)
# Define wavelenght corresponding to 2 keV in units of Hz.
nu_2keV = c / lam_2keV
......@@ -81,15 +84,26 @@ class Xray(SedModule):
sed: pcigale.sed.SED object
"""
# AGN 2500A intrinsic luminosity
if 'agn.agn_intrin_Lnu_2500A' not in sed.info:
sed.add_info('agn.agn_intrin_Lnu_2500A', 1., True)
luminosity = sed.info['agn.agn_intrin_Lnu_2500A']
Lnu_2500A = sed.info['agn.agn_intrin_Lnu_2500A']
# Calculate total AGN corona X-ray luminosity
l_agn_xray_total = np.trapz(Lnu_2500A * 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],
x=self.wave[lam_idxs])
sed.add_module(self.name, self.parameters)
sed.add_info("xray.gam", self.gam)
sed.add_info("xray.alpha_ox", self.alpha_ox)
sed.add_info("xray.agn_Lx_total", l_agn_xray_total)
sed.add_info("xray.agn_Lx_2to10keV", l_agn_xray_2to10keV)
sed.add_contribution('xray_corona', self.wave,
self.lumin_corona * luminosity)
self.lumin_corona * Lnu_2500A)
# 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