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
b9c1bd89
Commit
b9c1bd89
authored
Aug 21, 2014
by
Médéric Boquien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small optimisation for the redshifting module. In particular, only correct λ and Fλ if z>0.
parent
bd709c70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
pcigale/creation_modules/redshifting.py
pcigale/creation_modules/redshifting.py
+11
-8
No files found.
pcigale/creation_modules/redshifting.py
View file @
b9c1bd89
...
...
@@ -176,6 +176,8 @@ class Redshifting(CreationModule):
sed: pcigale.sed.SED object
"""
redshift
=
self
.
redshift
# If the SED is already redshifted, raise an error.
if
'redshift'
in
sed
.
info
.
keys
()
and
sed
.
info
[
'redshift'
]
>
0.
:
raise
Exception
(
"The SED is already redshifted <z={}>."
...
...
@@ -183,22 +185,23 @@ class Redshifting(CreationModule):
# Raise an error when applying a negative redshift. This module is
# not for blue-shifting.
if
self
.
redshift
<
0
:
if
redshift
<
0
:
raise
Exception
(
"The redshift provided is negative <{}>."
.
format
(
self
.
redshift
))
.
format
(
redshift
))
# We redshift directly the SED wavelength grid
sed
.
wavelength_grid
*=
1.
+
self
.
redshift
if
redshift
>
0.
:
# We redshift directly the SED wavelength grid
sed
.
wavelength_grid
*=
1.
+
redshift
# We modify each luminosity contribution to keep energy constant
sed
.
luminosities
/=
1.
+
self
.
redshift
# We modify each luminosity contribution to keep energy constant
sed
.
luminosities
/=
1.
+
redshift
sed
.
add_info
(
"redshift"
,
self
.
redshift
)
sed
.
add_info
(
"redshift"
,
redshift
)
sed
.
add_info
(
"universe.luminosity_distance"
,
self
.
luminosity_distance
)
sed
.
add_info
(
"universe.age"
,
self
.
universe_age
)
if
self
.
igm_attenuation
is
None
:
self
.
igm_attenuation
=
igm_transmission
(
sed
.
wavelength_grid
,
self
.
redshift
)
-
1.
redshift
)
-
1.
sed
.
add_contribution
(
'igm'
,
sed
.
wavelength_grid
,
self
.
igm_attenuation
*
sed
.
luminosity
)
sed
.
add_module
(
self
.
name
,
self
.
parameters
)
...
...
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