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
30ce18c0
Commit
30ce18c0
authored
Feb 11, 2016
by
Médéric Boquien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the variables are properly scoped.
parent
29907e7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
pcigale/sed_modules/sfh_buat08.py
pcigale/sed_modules/sfh_buat08.py
+9
-9
No files found.
pcigale/sed_modules/sfh_buat08.py
View file @
30ce18c0
...
...
@@ -60,10 +60,10 @@ class SfhBuat08(SedModule):
def
_init_code
(
self
):
self
.
velocity
=
float
(
self
.
parameters
[
"velocity"
])
self
.
age
=
int
(
self
.
parameters
[
"age"
])
self
.
normalise
=
bool
(
self
.
parameters
[
"normalise"
])
normalise
=
bool
(
self
.
parameters
[
"normalise"
])
# Time grid and age. If needed, the age is rounded to the inferior Myr
time_grid
=
np
.
arange
(
1
,
self
.
age
+
1
)
self
.
time_grid
=
np
.
arange
(
1
,
self
.
age
+
1
)
# Values from Buat et al. (2008) table 2
paper_velocities
=
np
.
array
([
80.
,
150.
,
220.
,
290.
,
360.
])
...
...
@@ -77,15 +77,15 @@ class SfhBuat08(SedModule):
c
=
np
.
interp
(
self
.
velocity
,
paper_velocities
,
paper_cs
)
# Main SFR
t
=
time_grid
/
1000
# The time is in Gyr in the formulae
sfr
=
10.
**
(
a
+
b
*
np
.
log10
(
t
)
+
c
*
t
**
.
5
)
/
1.e9
t
=
(
self
.
time_grid
+
1
)
/
1000
# The time is in Gyr in the formulae
s
elf
.
s
fr
=
10.
**
(
a
+
b
*
np
.
log10
(
t
)
+
c
*
t
**
.
5
)
/
1.e9
# Compute the galaxy mass and normalise the SFH to 1 solar mass
# produced if asked to.
s
fr_integrated
=
np
.
sum
(
sfr
)
*
1e6
if
self
.
normalise
:
s
fr
/=
sfr_integrated
sfr_integrated
=
1.
s
elf
.
sfr_integrated
=
np
.
sum
(
self
.
sfr
)
*
1e6
if
normalise
:
s
elf
.
sfr
/=
self
.
sfr_integrated
s
elf
.
s
fr_integrated
=
1.
def
process
(
self
,
sed
):
"""
...
...
@@ -97,7 +97,7 @@ class SfhBuat08(SedModule):
sed
.
add_module
(
self
.
name
,
self
.
parameters
)
# Add the sfh and the output parameters to the SED.
sed
.
sfh
=
(
time_grid
,
sfr
)
sed
.
sfh
=
(
self
.
time_grid
,
self
.
sfr
)
sed
.
add_info
(
"sfh.integrated"
,
self
.
sfr_integrated
,
True
)
sed
.
add_info
(
"sfh.velocity"
,
self
.
velocity
)
...
...
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