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
1ab7051a
Commit
1ab7051a
authored
Sep 20, 2015
by
Médéric Boquien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use in-place assignment to avoid an unnecessary copy of the array.
parent
1c774339
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
11 deletions
+9
-11
pcigale/creation_modules/dustatt_calzleit.py
pcigale/creation_modules/dustatt_calzleit.py
+2
-3
pcigale/creation_modules/dustatt_powerlaw.py
pcigale/creation_modules/dustatt_powerlaw.py
+1
-2
pcigale/creation_modules/sfh2exp.py
pcigale/creation_modules/sfh2exp.py
+1
-1
pcigale/creation_modules/sfh_buat08.py
pcigale/creation_modules/sfh_buat08.py
+1
-1
pcigale/creation_modules/sfh_quenching.py
pcigale/creation_modules/sfh_quenching.py
+1
-1
pcigale/creation_modules/sfhdelayed.py
pcigale/creation_modules/sfhdelayed.py
+1
-1
pcigale/creation_modules/sfhfromfile.py
pcigale/creation_modules/sfhfromfile.py
+1
-1
pcigale/creation_modules/sfhperiodic.py
pcigale/creation_modules/sfhperiodic.py
+1
-1
No files found.
pcigale/creation_modules/dustatt_calzleit.py
View file @
1ab7051a
...
...
@@ -162,10 +162,9 @@ def a_vs_ebv(wavelength, bump_wave, bump_width, bump_ampl, power_slope):
mask
=
(
attenuation
<
0
)
attenuation
[
mask
]
=
0
# Power law
attenuation
=
attenuation
*
power_law
(
wavelength
,
power_slope
)
attenuation
*
=
power_law
(
wavelength
,
power_slope
)
# UV bump
attenuation
=
attenuation
+
uv_bump
(
wavelength
,
bump_wave
,
bump_width
,
bump_ampl
)
attenuation
+=
uv_bump
(
wavelength
,
bump_wave
,
bump_width
,
bump_ampl
)
return
attenuation
...
...
pcigale/creation_modules/dustatt_powerlaw.py
View file @
1ab7051a
...
...
@@ -90,8 +90,7 @@ def alambda_av(wavelength, delta, bump_wave, bump_width, bump_ampl):
wave
=
np
.
array
(
wavelength
)
attenuation
=
power_law
(
wave
,
delta
)
attenuation
=
attenuation
+
uv_bump
(
wavelength
,
bump_wave
,
bump_width
,
bump_ampl
)
attenuation
+=
uv_bump
(
wavelength
,
bump_wave
,
bump_width
,
bump_ampl
)
return
attenuation
...
...
pcigale/creation_modules/sfh2exp.py
View file @
1ab7051a
...
...
@@ -110,7 +110,7 @@ class Sfh2Exp(CreationModule):
# produced if asked to.
galaxy_mass
=
np
.
trapz
(
sfr
,
time_grid
)
*
1e6
if
normalise
:
sfr
=
sfr
/
galaxy_mass
sfr
/
=
galaxy_mass
galaxy_mass
=
1.
else
:
sfr
*=
sfr_0
...
...
pcigale/creation_modules/sfh_buat08.py
View file @
1ab7051a
...
...
@@ -96,7 +96,7 @@ class SfhBuat08(CreationModule):
# produced if asked to.
galaxy_mass
=
np
.
trapz
(
sfr
,
time_grid
)
*
1e6
if
normalise
:
sfr
=
sfr
/
galaxy_mass
sfr
/
=
galaxy_mass
galaxy_mass
=
1.
sed
.
add_module
(
self
.
name
,
self
.
parameters
)
...
...
pcigale/creation_modules/sfh_quenching.py
View file @
1ab7051a
...
...
@@ -83,7 +83,7 @@ class SfhQuench(CreationModule):
# produced if asked to.
galaxy_mass
=
np
.
trapz
(
sfr
,
time
)
*
1e6
if
normalise
:
sfr
=
sfr
/
galaxy_mass
sfr
/
=
galaxy_mass
galaxy_mass
=
1.
sed
.
sfh
=
(
time
,
sfr
)
...
...
pcigale/creation_modules/sfhdelayed.py
View file @
1ab7051a
...
...
@@ -79,7 +79,7 @@ class SFHDelayed(CreationModule):
# produced if asked to.
galaxy_mass
=
np
.
trapz
(
sfr
,
time_grid
)
*
1e6
if
normalise
:
sfr
=
sfr
/
galaxy_mass
sfr
/
=
galaxy_mass
galaxy_mass
=
1.
else
:
sfr
*=
sfr_A
...
...
pcigale/creation_modules/sfhfromfile.py
View file @
1ab7051a
...
...
@@ -85,7 +85,7 @@ class SfhFromFile(CreationModule):
# produced if asked to.
galaxy_mass
=
np
.
trapz
(
sfr
,
time_grid
)
*
1e6
if
normalise
:
sfr
=
sfr
/
galaxy_mass
sfr
/
=
galaxy_mass
galaxy_mass
=
1.
sed
.
add_module
(
self
.
name
,
self
.
parameters
)
...
...
pcigale/creation_modules/sfhperiodic.py
View file @
1ab7051a
...
...
@@ -98,7 +98,7 @@ class SfhPeriodic(CreationModule):
# produced if asked to.
self
.
galaxy_mass
=
np
.
trapz
(
self
.
sfr
,
self
.
time_grid
)
*
1e6
if
normalise
:
self
.
sfr
=
self
.
sfr
/
self
.
galaxy_mass
self
.
sfr
/
=
self
.
galaxy_mass
self
.
galaxy_mass
=
1.
else
:
self
.
sfr
*=
sfr_A
...
...
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