fritz2006.py 6.15 KB
Newer Older
1
2
3
4
5
6
7
8
9
# -*- coding: utf-8 -*-
# Copyright (C) 2013, 2014 Department of Physics, University of Crete
# Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt
# Author: Laure Ciesla

"""
Fritz et al. (2006) AGN dust torus emission module
==================================================

10
This module implements the Fritz et al. (2006) models.
11
12

"""
13
import numpy as np
14
15
from pcigale.data import Database
from . import CreationModule
16
from pcigale.sed.cosmology import cosmology
17

Médéric Boquien's avatar
Médéric Boquien committed
18

19
20
21
class Fritz2006(CreationModule):
    """Fritz et al. (2006) AGN dust torus emission

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    The AGN emission is computed from the library of Fritz et al. (2006) from
    which all of the models are available. They take into account two emission
    components linked to the AGN. The first one is the isotropic emission of
    the central source, which is assumed to be point-like. This emission is a
    composition of power laws with variable indices, in the wavelength range of
    0.001-20 microns. The second one is the thermal and scattering dust torus
    emission. The conservation of the energy is always verified within 1% for
    typical solutions, and up to 10% in the case of very high optical depth and
    non-constant dust density. We refer the reader to Fritz et al. (2006) for
    more information on the library.

    The relative normalization of these components is handled through a
    parameter which is the fraction of the total IR luminosity due to the AGN
    so that: L_AGN = fracAGN * L_IRTOT, where L_AGN is the AGN luminosity,
    fracAGN is the contribution of the AGN to the total IR luminosity
    (L_IRTOT), i.e. L_Starburst+L_AGN.
38
39
40

    """

41
    parameter_list = dict([
42
43
        ('r_ratio', (
            'float',
44
45
            "Ratio of the maximum to minimum radii of the dust torus. "
            "Possible values are: 10, 30, 60, 100, 150.",
46
            60.
47
48
49
        )),
        ('tau', (
            'float',
50
51
            "Optical depth at 9.7 microns. "
            "Possible values are: 0.1, 0.3, 0.6, 1.0, 2.0, 3.0, 6.0, 10.0.",
52
            1.0
53
54
55
        )),
        ('beta', (
            'float',
56
            "Beta. Possible values are:-1.00, -0.75, -0.50, -0.25, 0.00.",
57
            -0.50
58
59
60
        )),
        ('gamma', (
            'float',
61
            "Gamma. Possible values are: 0.0, 2.0, 4.0, 6.0.",
62
            4.0
63
64
65
        )),
        ('opening_angle', (
            'float',
66
            "Full opening angle of the dust torus (Fig 1 of Fritz 2006). "
67
            "Possible values are: 60., 100., 140.",
68
            100.
69
70
71
        )),
        ('psy', (
            'float',
72
            "Angle between equatorial axis and line of sight. "
Médéric Boquien's avatar
Médéric Boquien committed
73
74
75
            "Psy = 90◦ for type 1 and Psy = 0° for type 2. Possible values "
            "are: 0.001, 10.100, 20.100, 30.100, 40.100, 50.100, 60.100, "
            "70.100, 80.100, 89.990.",
76
            50.100
77
78
79
        )),
        ('fracAGN', (
            'float',
80
            "AGN fraction.",
81
            0.1
82
83
84
        ))
    ])

85
    out_parameter_list = dict([
86
        ('fracAGN', 'Contribution of the AGN'),
Médéric Boquien's avatar
Médéric Boquien committed
87
88
89
90
91
92
        ('agn.therm_luminosity', 'Luminosity of the AGN contribution due to '
                                 'the dust torus'),
        ('agn.scatt_luminosity', 'Luminosity of the AGN contribution due to '
                                 'the photon scattering'),
        ('agn.agn_luminosity', 'Luminosity of the AGN contribution due to the '
                               'central source'),
93
        ('agn.luminosity', 'Total luminosity of the AGN contribution')
94
95
96
97
98
99
100
101
    ])

    def _init_code(self):
        """Get the template set out of the database"""
        r_ratio = self.parameters["r_ratio"]
        tau = self.parameters["tau"]
        beta = self.parameters["beta"]
        gamma = self.parameters["gamma"]
102
        opening_angle = (180. - self.parameters["opening_angle"]) / 2.
103
        psy = self.parameters["psy"]
104
105
106

        with Database() as base:
            self.fritz2006 = base.get_fritz2006(r_ratio, tau, beta, gamma,
107
                                                opening_angle, psy)
108
109
110
111
112
113

    def process(self, sed):
        """Add the IR re-emission contributions

        Parameters
        ----------
114
115
        sed: pcigale.sed.SED object
        parameters: dictionary containing the parameters
116
117
118

        """

119
        if 'dust.luminosity' not in sed.info:
120
            sed.add_info('dust.luminosity', 1., True)
121
122
123
124
125
126
127
128
129
130
131
132
133
134
        luminosity = sed.info['dust.luminosity']

        fracAGN = self.parameters["fracAGN"]

        sed.add_module(self.name, self.parameters)
        sed.add_info('r_ratio', self.parameters["r_ratio"])
        sed.add_info('tau', self.parameters["tau"])
        sed.add_info('beta', self.parameters["beta"])
        sed.add_info('gamma', self.parameters["gamma"])
        sed.add_info('opening_angle', self.parameters["opening_angle"])
        sed.add_info('psy', self.parameters["psy"])
        sed.add_info('fracAGN', self.parameters["fracAGN"])

        # Compute the AGN luminosity
135
        if fracAGN < 1.:
136
137
            agn_power = luminosity * (1./(1.-fracAGN) - 1.)
            l_agn_therm = agn_power
Médéric Boquien's avatar
Médéric Boquien committed
138
139
140
141
            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)
142
            l_agn_total = l_agn_therm + l_agn_scatt + l_agn_agn
Médéric Boquien's avatar
Médéric Boquien committed
143

144
145
146
        else:
            raise Exception("AGN fraction is exactly 1. Behaviour "
                            "undefined.")
147

148
149
150
151
        sed.add_info('agn.therm_luminosity', l_agn_therm, True)
        sed.add_info('agn.scatt_luminosity', l_agn_scatt, True)
        sed.add_info('agn.agn_luminosity', l_agn_agn, True)
        sed.add_info('agn.luminosity', l_agn_total, True)
152
153

        sed.add_contribution('agn.fritz2006_therm', self.fritz2006.wave,
154
                             agn_power * self.fritz2006.lumin_therm)
155
        sed.add_contribution('agn.fritz2006_scatt', self.fritz2006.wave,
156
                             agn_power * self.fritz2006.lumin_scatt)
157
        sed.add_contribution('agn.fritz2006_agn', self.fritz2006.wave,
158
                             agn_power * self.fritz2006.lumin_agn)
159
160
161

# CreationModule to be returned by get_module
Module = Fritz2006