Commit 1f0a652f authored by Médéric Boquien's avatar Médéric Boquien

Allow for the AGN fraction to be defined at any wavelength.

parent e38cd073
Pipeline #3051 skipped with stage
......@@ -9,6 +9,7 @@
### Fixed
- Ensure that `pcigale-plots` correctly detects the `skirtor2016` AGN models. (Médéric Boquien, reported by Guang Yang)
- Correct a typo in the `themis` module. (Médéric Boquien, reported by Alexandros Maragkoudakis)
- Make sure that the best fit is also given for the bands for which `pdf\_analysis` provides a Bayesian estimate. (Médéric Boquien)
### Optimised
- The estimation of the physical properties and the related uncertainties has been made up to 50% faster. The final gain in the analysis speed accounting for all the steps depends on the number of properties to be evaluated and the number of models but can be over 25% when estimating many properties over a large parameter space. (Médéric Boquien)
......
......@@ -183,7 +183,9 @@ class BestResultsManager(object):
# to the pool. Each worker will fill a part of the RawArrays. It is
# important that there is no conflict and that two different workers do
# not write on the same section.
self.flux = {band: SharedArray(nobs) for band in models.obs.bands}
fluxnames = list(dict.fromkeys(models.obs.bands +
models.conf['analysis_params']['bands']))
self.flux = {band: SharedArray(nobs) for band in fluxnames}
allintpropnames = models.allintpropnames
allextpropnames = models.allextpropnames
self.intprop = {prop: SharedArray(nobs)
......@@ -418,7 +420,7 @@ class ResultsManager(object):
name="best."+prop,
unit=Unit(self.unit[prop])))
for band in self.obs.bands:
for band in self.best.flux:
if band.startswith('line.') or band.startswith('linefilter.'):
unit = 'W/m^2'
else:
......
......@@ -132,6 +132,12 @@ class SKIRTOR2016(SedModule):
"AGN fraction.",
0.1
)),
('lambda_fracAGN', (
'float(min=0, max=500)',
'Wavelength in micron where to compute the AGN fraction. If zero '
'then the total dust luminosity is adopted.',
0
)),
('law', (
'cigale_list(dtype=int, options=0 & 1 & 2)',
"Extinction law of the polar dust: "
......@@ -165,6 +171,7 @@ class SKIRTOR2016(SedModule):
self.Mcl = float(self.parameters["Mcl"])
self.i = int(self.parameters["i"])
self.fracAGN = float(self.parameters["fracAGN"])
self.lambda_fracAGN = float(self.parameters["lambda_fracAGN"]) * 1e3
self.law = int(self.parameters["law"])
self.EBV = float(self.parameters["EBV"])
self.temperature = float(self.parameters["temperature"])
......@@ -229,6 +236,12 @@ class SKIRTOR2016(SedModule):
# Integrate AGN luminosity for different components
self.lumin_disk = np.trapz(self.SKIRTOR2016.disk, x=self.SKIRTOR2016.wave)
if self.lambda_fracAGN > 0.:
self.AGNfluxatlambda = np.interp(self.lambda_fracAGN,
self.SKIRTOR2016.wave,
self.SKIRTOR2016.dust +
self.SKIRTOR2016.disk)
def process(self, sed):
"""Add the IR re-emission contributions
......@@ -259,7 +272,13 @@ class SKIRTOR2016(SedModule):
# Compute the AGN luminosity
if self.fracAGN < 1.:
agn_power = luminosity * (1./(1.-self.fracAGN) - 1.)
if self.lambda_fracAGN > 0.:
scale = np.interp(self.lambda_fracAGN, sed.wavelength_grid,
sed.luminosity) / self.AGNfluxatlambda
else:
scale = luminosity
agn_power = scale * (1. / (1. - self.fracAGN) - 1.)
lumin_dust = agn_power
lumin_disk = agn_power * np.trapz(self.SKIRTOR2016.disk,
x=self.SKIRTOR2016.wave)
......
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