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

bug fixed for skirtor and fritz

parent 11edf982
......@@ -124,14 +124,18 @@ class Fritz2006(SedModule):
self.l_agn_agn = np.trapz(self.fritz2006.lumin_agn,
x=self.fritz2006.wave)
# Apply wavelength cut
# Apply wavelength cut to avoid X-ray wavelength
lam_cut = 5.
lam_use_idxs = self.fritz2006.wave>=lam_cut
self.fritz2006.wave = self.fritz2006.wave[lam_use_idxs]
self.fritz2006.lumin_agn = self.fritz2006.lumin_agn[lam_use_idxs]
self.fritz2006.lumin_scatt = self.fritz2006.lumin_scatt[lam_use_idxs]
self.fritz2006.lumin_therm = self.fritz2006.lumin_therm[lam_use_idxs]
self.fritz2006.lumin_intrin_agn = self.fritz2006.lumin_intrin_agn[lam_use_idxs]
lam_idxs = self.fritz2006.wave>=lam_cut
# Calculate the re-normalization factor to keep energy conservation
norm_fac = np.trapz(self.fritz2006.lumin_intrin_agn, x=self.fritz2006.wave) /\
np.trapz(self.fritz2006.lumin_intrin_agn[lam_idxs], x=self.fritz2006.wave[lam_idxs])
# Perform the cut
self.fritz2006.wave = self.fritz2006.wave[lam_idxs]
self.fritz2006.lumin_agn = self.fritz2006.lumin_agn[lam_idxs]*norm_fac
self.fritz2006.lumin_scatt = self.fritz2006.lumin_scatt[lam_idxs]*norm_fac
self.fritz2006.lumin_therm = self.fritz2006.lumin_therm[lam_idxs]
self.fritz2006.lumin_intrin_agn = self.fritz2006.lumin_intrin_agn[lam_idxs]*norm_fac
# Apply polar-dust obscuration
# We define various constants necessary to compute the model
......
......@@ -120,21 +120,27 @@ class SKIRTOR2016(SedModule):
self.oa, self.R, self.Mcl,
self.i)
# Apply wavelength cut
# Apply wavelength cut to avoid X-ray wavelength
lam_cut = 5.
lam_use_idxs = self.SKIRTOR2016.wave>=lam_cut
self.SKIRTOR2016.wave = self.SKIRTOR2016.wave[lam_use_idxs]
self.SKIRTOR2016.disk = self.SKIRTOR2016.disk[lam_use_idxs]
self.SKIRTOR2016.dust = self.SKIRTOR2016.dust[lam_use_idxs]
self.SKIRTOR2016.intrin_iso_disk = self.SKIRTOR2016.intrin_iso_disk[lam_use_idxs]
lam_idxs = self.SKIRTOR2016.wave>=lam_cut
# Calculate the re-normalization factor to keep energy conservation
norm_fac = np.trapz(self.SKIRTOR2016.intrin_iso_disk, x=self.SKIRTOR2016.wave) /\
np.trapz(self.SKIRTOR2016.intrin_iso_disk[lam_idxs], x=self.SKIRTOR2016.wave[lam_idxs])
# Perform the cut
self.SKIRTOR2016.wave = self.SKIRTOR2016.wave[lam_idxs]
self.SKIRTOR2016.disk = self.SKIRTOR2016.disk[lam_idxs]*norm_fac
self.SKIRTOR2016.dust = self.SKIRTOR2016.dust[lam_idxs]
self.SKIRTOR2016.intrin_iso_disk = self.SKIRTOR2016.intrin_iso_disk[lam_idxs]*norm_fac
# Modify the model so that the central source is isotropic
# Calculate the coverting factors disk emission
# (only for type-1 case, since disk emission in type-2 is zero)
# (dust emission is normalized to unity, so it remains same)
disk_fac = 7/(12*np.cos(self.i*np.pi/180)**2 + 6*np.cos(self.i *np.pi/180))
dust_fac = 7/(4*np.sin(self.oa*np.pi/180)**2 + 3*np.sin(self.oa*np.pi/180))
# Only apply disk_fac to type 1 (for type 2 it is zero)
if self.i<=(90-self.oa):
self.SKIRTOR2016.disk*= (4*np.sin(self.oa*np.pi/180)**2 + 3*np.sin(self.oa*np.pi/180)) / \
(12*np.cos(self.i*np.pi/180)**2 + 6*np.cos(self.i *np.pi/180))
self.SKIRTOR2016.disk*= disk_fac/dust_fac
self.SKIRTOR2016.intrin_iso_disk /= dust_fac
# Apply polar-dust obscuration
# We define various constants necessary to compute the model
......
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