Commit 5e3ee50c authored by Guang's avatar Guang

smooth the transition between X-ray to UV (3-10 nm)

parent b5104ef1
......@@ -62,7 +62,7 @@ class Xray(SedModule):
# We define the wavelength range for the non thermal emission
# corresponding to 0.4-1200 keV
self.wave = np.logspace(-3, 0.5, 1000.)
self.wave = np.logspace(-3, 0.5, 1000)
# X-ray emission from galaxies: 1.hot-gas & 2.X-ray binaries
# 1.Hot-gas, assuming power-law index gamma=3
......@@ -137,7 +137,6 @@ class Xray(SedModule):
x=self.wave[lam_idxs])
# Save the results
#import pdb; pdb.set_trace()
sed.add_info("xray.hotgas_Lx_0p5to2keV", l_hotgas_xray_0p5to2keV, True)
sed.add_info("xray.hmxb_Lx_2to10keV", l_hmxb_xray_2to10keV, True)
sed.add_info("xray.lmxb_Lx_2to10keV", l_lmxb_xray_2to10keV, True)
......@@ -150,6 +149,33 @@ class Xray(SedModule):
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 * L_lam_2keV)
# Smooth the SED between X-ray and UV
# Get the current total SED
lam_tot = sed.wavelength_grid
lumin_tot = sed.luminosity
# Define the wavelength between X-ray and UV
lam_lim = [3., 10.]
# Get the wavelength index between X-ray and UV
lam_idx = np.where( (lam_tot>=lam_lim[0]) & (lam_tot<=lam_lim[1]) )
# Set the wavelength and luminosity grids between X-ray and UV
lam_xuv = lam_tot[lam_idx].copy()
lumin_xuv = lumin_tot[lam_idx].copy()
# If UV flux is 0, use linear interpolation
# else, use log-linear interpolation
if lumin_xuv[-1]<=0:
# Note that we need to add a negative component, so that the total luminosity is subtracted cleanly
lumin_xuv = (lam_xuv-lam_xuv[0])/(lam_xuv[-1]-lam_xuv[0])*(lumin_xuv[-1]-lumin_xuv[0]) + lumin_xuv[0] - lumin_xuv
else:
# Convert to log-scale
log_lam_xuv = np.log10(lam_xuv)
# The log-luminosity at the end points
log_lumin_lim = [np.log10(lumin_xuv[0]), np.log10(lumin_xuv[-1])]
# Reset the luminosity (keep endpoints, log-linearly interpolate the rest)
log_lumin_xuv = (log_lam_xuv-log_lam_xuv[0])/(log_lam_xuv[-1]-log_lam_xuv[0])*(log_lumin_lim[-1]-log_lumin_lim[0]) + log_lumin_lim[0]
# Convert back to linear scale and add a negative component, so that the total luminosity is subtracted cleanly
lumin_xuv = 10**log_lumin_xuv - lumin_xuv
# Add this X-ray-UV bridging component
sed.add_contribution('xray.xray_uv_bridge', lam_xuv, lumin_xuv)
# SedModule to be returned by get_module
Module = Xray
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