fritz2006.py 6.2 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
16
from collections import OrderedDict
from pcigale.data import Database
from . import CreationModule
17
from pcigale.sed.cosmology import cosmology
18

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

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

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    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.
39
40
41
42
43
44

    """

    parameter_list = OrderedDict([
        ('r_ratio', (
            'float',
45
46
            "Ratio of the maximum to minimum radii of the dust torus. "
            "Possible values are: 10, 30, 60, 100, 150.",
47
            60.
48
49
50
        )),
        ('tau', (
            'float',
51
52
            "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.",
53
            1.0
54
55
56
        )),
        ('beta', (
            'float',
57
            "Beta. Possible values are:-1.00, -0.75, -0.50, -0.25, 0.00.",
58
            -0.50
59
60
61
        )),
        ('gamma', (
            'float',
62
            "Gamma. Possible values are: 0.0, 2.0, 4.0, 6.0.",
63
            4.0
64
65
66
        )),
        ('opening_angle', (
            'float',
67
            "Full opening angle of the dust torus (Fig 1 of Fritz 2006). "
68
            "Possible values are: 60., 100., 140.",
69
            100.
70
71
72
        )),
        ('psy', (
            'float',
73
            "Angle between equatorial axis and line of sight. "
Médéric Boquien's avatar
Médéric Boquien committed
74
75
76
            "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.",
77
            50.100
78
79
80
        )),
        ('fracAGN', (
            'float',
81
            "AGN fraction.",
82
            0.1
83
84
85
86
87
        ))
    ])

    out_parameter_list = OrderedDict([
        ('fracAGN', 'Contribution of the AGN'),
Médéric Boquien's avatar
Médéric Boquien committed
88
89
90
91
92
93
        ('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'),
94
        ('agn.luminosity', 'Total luminosity of the AGN contribution')
95
96
97
98
99
100
101
102
    ])

    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"]
103
        opening_angle = (180. - self.parameters["opening_angle"]) / 2.
104
        psy = self.parameters["psy"]
105
106
107

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

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

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

        """

120
        if 'dust.luminosity' not in sed.info:
121
            sed.add_info('dust.luminosity', 1., True)
122
123
124
125
126
127
128
129
130
131
132
133
134
135
        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
136
        if fracAGN < 1.:
137
138
            agn_power = luminosity * (1./(1.-fracAGN) - 1.)
            l_agn_therm = agn_power
Médéric Boquien's avatar
Médéric Boquien committed
139
140
141
142
            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)
143
            l_agn_total = l_agn_therm + l_agn_scatt + l_agn_agn
Médéric Boquien's avatar
Médéric Boquien committed
144

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

149
150
151
152
        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)
153
154

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

# CreationModule to be returned by get_module
Module = Fritz2006