fritz2006.py 3.87 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- 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
==================================================

TODO: Describe the module

"""

from collections import OrderedDict
from pcigale.data import Database
from . import CreationModule


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

    TODO: Describe de module actions.

    Information added to the SED: fracAGN, L_AGN.

    """

    parameter_list = OrderedDict([
        ('r_ratio', (
            'float',
31
32
            "Ratio of the maximum to minimum radii of the dust torus. "
            "Possible values are: 10, 30, 60, 100, 150.",
33
34
35
36
            None
        )),
        ('tau', (
            'float',
37
38
            "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.",
39
40
41
42
            None
        )),
        ('beta', (
            'float',
43
            "Beta. Possible values are:-1.00, -0.75, -0.50, -0.25, 0.00.",
44
45
46
47
            None
        )),
        ('gamma', (
            'float',
48
            "Gamma. Possible values are: 0.0, 2.0, 4.0, 6.0.",
49
50
51
52
            None
        )),
        ('opening_angle', (
            'float',
53
54
            "Opening angle of the dust torus. Possible values are: 20, 40, "
            "60.",
55
56
57
58
59
            None
        )),
        ('psy', (
            'float',
            "Angle between AGN axis and line of sight. Possible values are: "
60
61
            "0.001, 10.100, 20.100, 30.100, 40.100, 50.100, 60.100, 70.100, "
            "80.100, 89.990.",
62
63
64
65
            None
        )),
        ('fracAGN', (
            'float',
66
            "AGN fraction.",
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
            None
        ))
    ])

    out_parameter_list = OrderedDict([
        ('fracAGN', 'Contribution of the AGN'),
        ('L_AGN', 'Luminosity of the AGN contribution')
    ])

    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"]
        opening_angle = self.parameters["opening_angle"]
        psy = self.parameters["psy"]

        with Database() as base:
            self.fritz2006 = base.get_fritz2006(r_ratio, tau, beta, gamma,
87
                                                opening_angle, psy)
88
89
90
91
92
93
94
95
96
97
98
99

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

        Parameters
        ----------
        sed  : pcigale.sed.SED object
        parameters : dictionary containing the parameters

        """

        if 'dust.luminosity' not in sed.info.keys():
100
            sed.add_info('dust.luminosity', 1., True)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
        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
        L_AGN = fracAGN * (luminosity + 1)
116
117
118
119
120
121
122

        sed.add_contribution('agn_fritz2006_therm', self.fritz2006.wave,
                             L_AGN * self.fritz2006.lumin_therm)
        sed.add_contribution('agn_fritz2006_scatt', self.fritz2006.wave,
                             L_AGN * self.fritz2006.lumin_scatt)
        sed.add_contribution('agn_fritz2006_agn', self.fritz2006.wave,
                             L_AGN * self.fritz2006.lumin_agn)
123
124
125

# CreationModule to be returned by get_module
Module = Fritz2006