Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
CIGALE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cigale
CIGALE
Commits
5a86f3b0
Commit
5a86f3b0
authored
Sep 17, 2013
by
Yannick Roehlly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compute age, SFR and average SFR when setting the SFH of the galaxy
parent
c7072d8b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
34 deletions
+14
-34
pcigale/sed/__init__.py
pcigale/sed/__init__.py
+14
-0
pcigale/sed/modules/bc03.py
pcigale/sed/modules/bc03.py
+0
-15
pcigale/sed/modules/m2005.py
pcigale/sed/modules/m2005.py
+0
-17
pcigale/sed/modules/sfh2exp.py
pcigale/sed/modules/sfh2exp.py
+0
-1
pcigale/sed/modules/sfhfromfile.py
pcigale/sed/modules/sfhfromfile.py
+0
-1
No files found.
pcigale/sed/__init__.py
View file @
5a86f3b0
...
...
@@ -41,6 +41,11 @@ from . import utils
from
scipy.constants
import
c
from
scipy.interpolate
import
interp1d
# Time lapse used to compute the average star formation rate. We use a
# constant to keep it easily changeable for advanced user while limiting the
# number of parameters. The value is in Myr.
AV_LAPSE
=
100
class
SED
(
object
):
"""Spectral Energy Distribution with associated information
...
...
@@ -79,6 +84,15 @@ class SED(object):
def
sfh
(
self
,
value
):
self
.
_sfh
=
value
if
value
:
sfh_time
,
sfh_sfr
=
value
sfh_age
=
np
.
max
(
sfh_time
)
-
sfh_time
self
.
_sfh
=
value
self
.
add_info
(
"sfr"
,
sfh_sfr
[
-
1
],
True
,
True
)
self
.
add_info
(
"average_sfr"
,
np
.
mean
(
sfh_sfr
[
sfh_age
<=
AV_LAPSE
]),
True
,
True
)
self
.
add_info
(
"age"
,
np
.
max
(
sfh_time
),
True
,
True
)
@
property
def
wavelength_grid
(
self
):
""" Return a copy of the wavelength grid
...
...
pcigale/sed/modules/bc03.py
View file @
5a86f3b0
...
...
@@ -9,12 +9,6 @@ from . import common
from
...data
import
Database
# Time lapse used to compute the average star formation rate. We use a
# constant to keep it easily changeable for advanced user while limiting the
# number of parameters. The value is in Myr.
AV_LAPSE
=
100
class
Module
(
common
.
SEDCreationModule
):
"""Module computing the Star Formation History contribution bases on the
Bruzual and Charlot (2003) models.
...
...
@@ -95,12 +89,6 @@ class Module(common.SEDCreationModule):
old_sfh
[
sfh_age
<=
separation_age
]
=
0
old_wave
,
old_lumin
,
old_info
=
ssp
.
convolve
(
sfh_time
,
old_sfh
)
# SFR of the galaxy
sfr
=
sfh_sfr
[
len
(
sfh_sfr
)
-
1
]
# Average SFR on the last AV_LAPSE Myr of its history
average_sfr
=
np
.
mean
(
sfh_sfr
[
sfh_age
<=
AV_LAPSE
])
sed
.
add_module
(
self
.
name
,
self
.
parameters
)
sed
.
add_info
(
"ssp_imf"
+
self
.
postfix
,
imf
)
...
...
@@ -108,9 +96,6 @@ class Module(common.SEDCreationModule):
sed
.
add_info
(
"ssp_old_young_separation_age"
+
self
.
postfix
,
separation_age
)
sed
.
add_info
(
"sfr"
+
self
.
postfix
,
sfr
,
True
)
sed
.
add_info
(
"average_sfr"
+
self
.
postfix
,
average_sfr
,
True
)
sed
.
add_info
(
"ssp_m_star_young"
+
self
.
postfix
,
young_info
[
"m_star"
],
True
)
sed
.
add_info
(
"ssp_m_gas_young"
+
self
.
postfix
,
...
...
pcigale/sed/modules/m2005.py
View file @
5a86f3b0
...
...
@@ -8,11 +8,6 @@ from collections import OrderedDict
from
.
import
common
from
...data
import
Database
# Time lapse used to compute the average star formation rate. We use a
# constant to keep it easily changeable for advanced user while limiting the
# number of parameters. The value is in Myr.
AV_LAPSE
=
100
class
Module
(
common
.
SEDCreationModule
):
"""Module computing the Star Formation History contribution based on the
...
...
@@ -23,9 +18,6 @@ class Module(common.SEDCreationModule):
Information added to the SED:
- imf, metallicity, galaxy_age
- sfr: star formation rate normalised to 1 solar mass formed at the
age of the galaxy.
- average_sfr: SFR averaged on the last 100 Myr of the galaxy history
- mass_total, mass_alive, mass_white_dwarf,mass_neutrino,
mass_black_hole, mass_turn_off : stellar masses in solar mass.
- age: age of the oldest stars in the galaxy.
...
...
@@ -139,12 +131,6 @@ class Module(common.SEDCreationModule):
old_sfh
[
sfh_age
<=
separation_age
]
=
0
old_masses
,
old_spectrum
=
ssp
.
convolve
(
sfh_time
,
old_sfh
)
# SFR of the galaxy
sfr
=
sfh_sfr
[
len
(
sfh_sfr
)
-
1
]
# Average SFR on the last AV_LAPSE Myr of its history
average_sfr
=
np
.
mean
(
sfh_sfr
[
sfh_age
<=
AV_LAPSE
])
sed
.
add_module
(
self
.
name
,
self
.
parameters
)
sed
.
add_info
(
'ssp_imf'
+
self
.
postfix
,
imf
)
...
...
@@ -152,9 +138,6 @@ class Module(common.SEDCreationModule):
sed
.
add_info
(
'ssp_old_young_separation_age'
+
self
.
postfix
,
separation_age
)
sed
.
add_info
(
'sfr'
+
self
.
postfix
,
sfr
,
True
)
sed
.
add_info
(
'average_sfr'
+
self
.
postfix
,
average_sfr
,
True
)
sed
.
add_info
(
'ssp_mass_total_old'
+
self
.
postfix
,
old_masses
[
0
],
True
)
sed
.
add_info
(
'ssp_mass_alive_old'
+
self
.
postfix
,
old_masses
[
1
],
True
)
sed
.
add_info
(
'ssp_mass_white_dwarf_old'
+
self
.
postfix
,
old_masses
[
2
],
...
...
pcigale/sed/modules/sfh2exp.py
View file @
5a86f3b0
...
...
@@ -106,5 +106,4 @@ class Module(common.SEDCreationModule):
sed
.
add_info
(
"sfh_tau_main"
+
self
.
postfix
,
tau_main
)
sed
.
add_info
(
"sfh_tau_burst"
+
self
.
postfix
,
tau_burst
)
sed
.
add_info
(
"sfh_f_burst"
+
self
.
postfix
,
f_burst
)
sed
.
add_info
(
"sfh_age"
+
self
.
postfix
,
age
)
sed
.
add_info
(
"sfh_burst_age"
+
self
.
postfix
,
burst_age
)
pcigale/sed/modules/sfhfromfile.py
View file @
5a86f3b0
...
...
@@ -72,5 +72,4 @@ class Module(common.SEDCreationModule):
sed
.
add_module
(
self
.
name
,
self
.
parameters
)
sed
.
sfh
=
(
time_grid
,
sfr
)
sed
.
add_info
(
"age"
,
age
)
sed
.
add_info
(
"sfh_id"
+
self
.
postfix
,
sfr_column_name
)
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