Commit c8bf4f2c authored by Médéric Boquien's avatar Médéric Boquien

Precompute the normalised luminosity of the different AGN components for the fritz2006 module

parent 7334ecab
......@@ -15,6 +15,7 @@
- Make sure that the best-fit models are stored with the correct scaling factor when the distance is given explicitly (Médéric Boquien)
### Optimised
- Slight speedup of the computation of the likelihood from the χ² (Médéric Boquien)
- The the fritz2006 module should now run faster thanks to an optimisation of the computation of the luminosity of the various AGN components (Médéric Boquien & Guang Yang)
## 2018.0 (2018-11-06)
### Added
......
......@@ -100,6 +100,10 @@ class Fritz2006(SedModule):
self.fritz2006 = base.get_fritz2006(self.r_ratio, self.tau,
self.beta, self.gamma,
self.opening_angle, self.psy)
self.l_agn_scatt = np.trapz(self.fritz2006.lumin_scatt,
x=self.fritz2006.wave)
self.l_agn_agn = np.trapz(self.fritz2006.lumin_agn,
x=self.fritz2006.wave)
def process(self, sed):
"""Add the IR re-emission contributions
......@@ -128,10 +132,8 @@ class Fritz2006(SedModule):
if self.fracAGN < 1.:
agn_power = luminosity * (1./(1.-self.fracAGN) - 1.)
l_agn_therm = agn_power
l_agn_scatt = np.trapz(agn_power * self.fritz2006.lumin_scatt,
x=self.fritz2006.wave)
l_agn_agn = np.trapz(agn_power * self.fritz2006.lumin_agn,
x=self.fritz2006.wave)
l_agn_scatt = agn_power * self.l_agn_scatt
l_agn_agn = agn_power * self.l_agn_agn
l_agn_total = l_agn_therm + l_agn_scatt + l_agn_agn
else:
......
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