Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
cigale
CIGALE
Commits
0e229b7c
Commit
0e229b7c
authored
Mar 02, 2015
by
Laure Ciesla
Committed by
Yannick Roehlly
Mar 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compute the AGN luminosities
parent
f96170f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
10 deletions
+31
-10
database_builder/__init__.py
database_builder/__init__.py
+6
-3
pcigale/creation_modules/fritz2006.py
pcigale/creation_modules/fritz2006.py
+16
-5
pcigale/data/__init__.py
pcigale/data/__init__.py
+5
-0
pcigale/data/fritz2006.py
pcigale/data/fritz2006.py
+4
-2
No files found.
database_builder/__init__.py
View file @
0e229b7c
...
...
@@ -547,10 +547,13 @@ def build_fritz2006(base):
lumin_therm
=
lumin_therm
/
norm
lumin_scatt
=
lumin_scatt
/
norm
lumin_agn
=
lumin_agn
/
norm
norm_scatt
=
np
.
trapz
(
lumin_scatt
,
x
=
wave
)
norm_agn
=
np
.
trapz
(
lumin_agn
,
x
=
wave
)
base
.
add_fritz2006
(
Fritz2006
(
params
[
4
],
params
[
3
],
params
[
2
],
params
[
1
],
params
[
0
],
psy
[
n
],
wave
,
lumin_therm
,
lumin_scatt
,
lumin_agn
))
params
[
1
],
params
[
0
],
psy
[
n
],
norm_scatt
,
norm_agn
,
wave
,
lumin_therm
,
lumin_scatt
,
lumin_agn
))
def
build_nebular
(
base
):
...
...
pcigale/creation_modules/fritz2006.py
View file @
0e229b7c
...
...
@@ -84,7 +84,10 @@ class Fritz2006(CreationModule):
out_parameter_list
=
OrderedDict
([
(
'fracAGN'
,
'Contribution of the AGN'
),
(
'L_AGN'
,
'Luminosity of the AGN contribution'
)
(
'L_AGN_therm'
,
'Luminosity of the AGN contribution due to the dust torus'
),
(
'L_AGN_scatt'
,
'Luminosity of the AGN contribution due to the photon scattering'
),
(
'L_AGN_agn'
,
'Luminosity of the AGN contribution due to the central source'
),
(
'L_AGN_tot'
,
'Total luminosity of the AGN contribution'
)
])
def
_init_code
(
self
):
...
...
@@ -127,17 +130,25 @@ class Fritz2006(CreationModule):
# Compute the AGN luminosity
if
fracAGN
<
1.
:
L_AGN
=
luminosity
*
(
1.
/
(
1.
-
fracAGN
)
-
1.
)
L_AGN_therm
=
luminosity
*
(
1.
/
(
1.
-
fracAGN
)
-
1.
)
L_AGN_scatt
=
self
.
fritz2006
.
norm_scatt
*
L_AGN_therm
L_AGN_agn
=
self
.
fritz2006
.
norm_agn
*
L_AGN_therm
L_AGN_total
=
L_AGN_therm
+
L_AGN_scatt
+
L_AGN_agn
else
:
raise
Exception
(
"AGN fraction is exactly 1. Behaviour "
"undefined."
)
sed
.
add_info
(
'L_AGN_therm'
,
L_AGN_therm
)
sed
.
add_info
(
'L_AGN_scatt'
,
L_AGN_scatt
)
sed
.
add_info
(
'L_AGN_agn'
,
L_AGN_agn
)
sed
.
add_info
(
'L_AGN_total'
,
L_AGN_total
)
sed
.
add_contribution
(
'agn_fritz2006_therm'
,
self
.
fritz2006
.
wave
,
L_AGN
*
self
.
fritz2006
.
lumin_therm
)
L_AGN
_therm
*
self
.
fritz2006
.
lumin_therm
)
sed
.
add_contribution
(
'agn_fritz2006_scatt'
,
self
.
fritz2006
.
wave
,
L_AGN
*
self
.
fritz2006
.
lumin_scatt
)
L_AGN
_therm
*
self
.
fritz2006
.
lumin_scatt
)
sed
.
add_contribution
(
'agn_fritz2006_agn'
,
self
.
fritz2006
.
wave
,
L_AGN
*
self
.
fritz2006
.
lumin_agn
)
L_AGN
_therm
*
self
.
fritz2006
.
lumin_agn
)
# CreationModule to be returned by get_module
Module
=
Fritz2006
pcigale/data/__init__.py
View file @
0e229b7c
...
...
@@ -185,6 +185,8 @@ class _Fritz2006(BASE):
gamma
=
Column
(
Float
,
primary_key
=
True
)
opening_angle
=
Column
(
Float
,
primary_key
=
True
)
psy
=
Column
(
Float
,
primary_key
=
True
)
norm_scatt
=
Column
(
PickleType
)
norm_agn
=
Column
(
PickleType
)
wave
=
Column
(
PickleType
)
lumin_therm
=
Column
(
PickleType
)
lumin_scatt
=
Column
(
PickleType
)
...
...
@@ -197,6 +199,8 @@ class _Fritz2006(BASE):
self
.
gamma
=
agn
.
gamma
self
.
opening_angle
=
agn
.
opening_angle
self
.
psy
=
agn
.
psy
self
.
norm_scatt
=
agn
.
norm_scatt
self
.
norm_agn
=
agn
.
norm_agn
self
.
wave
=
agn
.
wave
self
.
lumin_therm
=
agn
.
lumin_therm
self
.
lumin_scatt
=
agn
.
lumin_scatt
...
...
@@ -680,6 +684,7 @@ class Database(object):
if
result
:
return
Fritz2006
(
result
.
r_ratio
,
result
.
tau
,
result
.
beta
,
result
.
gamma
,
result
.
opening_angle
,
result
.
psy
,
result
.
norm_scatt
,
result
.
norm_agn
,
result
.
wave
,
result
.
lumin_therm
,
result
.
lumin_scatt
,
result
.
lumin_agn
)
else
:
...
...
pcigale/data/fritz2006.py
View file @
0e229b7c
...
...
@@ -12,8 +12,8 @@ class Fritz2006(object):
"""
def
__init__
(
self
,
r_ratio
,
tau
,
beta
,
gamma
,
opening_angle
,
psy
,
wave
,
lumin_therm
,
lumin_scatt
,
lumin_agn
):
def
__init__
(
self
,
r_ratio
,
tau
,
beta
,
gamma
,
opening_angle
,
psy
,
norm_scatt
,
norm_agn
,
wave
,
lumin_therm
,
lumin_scatt
,
lumin_agn
):
"""Create a new AGN model
Parameters
...
...
@@ -38,6 +38,8 @@ class Fritz2006(object):
self
.
gamma
=
gamma
self
.
opening_angle
=
opening_angle
self
.
psy
=
psy
self
.
norm_scatt
self
.
norm_agn
self
.
wave
=
wave
self
.
lumin_therm
=
lumin_therm
self
.
lumin_scatt
=
lumin_scatt
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment