Commit a3ec3f26 authored by Guang's avatar Guang Committed by Guang
Browse files

xray.py optimized

parent 17f0a820
......@@ -88,6 +88,12 @@ class Xray(SedModule):
# Normaliz the SED at 2 keV
self.lumin_corona /= lam_2keV**(self.gam - 3.) * \
np.exp(-lam_300keV/lam_2keV)
# Calculate total AGN corona X-ray luminosity
self.l_agn_xray_total = np.trapz(self.lumin_corona, x=self.wave)
# Calculate 2-10 keV AGN corona X-ray luminosity
# 2-10 keV corredponds to self.wave[598:798]
self.l_agn_xray_2to10keV = np.trapz(self.lumin_corona[598:798], x=self.wave[598:798])
def process(self, sed):
"""Add the X-ray contribution.
......@@ -135,12 +141,9 @@ class Xray(SedModule):
Lnu_2keV = 10**(alpha_ox/0.3838) * Lnu_2500A
L_lam_2keV = Lnu_2keV * self.nu_2keV**2/self.c
# Calculate total AGN corona X-ray luminosity
l_agn_xray_total = np.trapz(L_lam_2keV * self.lumin_corona,
x=self.wave)
l_agn_xray_total = self.l_agn_xray_total * L_lam_2keV
# Calculate 2-10 keV AGN corona X-ray luminosity
# 2-10 keV corredponds to self.wave[598:798]
l_agn_xray_2to10keV = np.trapz(L_lam_2keV * self.lumin_corona[598:798],
x=self.wave[598:798])
l_agn_xray_2to10keV = self.l_agn_xray_2to10keV * L_lam_2keV
# Save the results
sed.add_info("xray.hotgas_Lx_0p5to2keV", l_hotgas_xray_0p5to2keV, True)
......
Supports Markdown
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