Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
cigale
CIGALE
Commits
481d8953
Commit
481d8953
authored
Oct 09, 2015
by
Médéric Boquien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use np.full() to create an array with all elements set to the same value.
parent
e57cb6e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
pcigale/analysis_modules/__init__.py
pcigale/analysis_modules/__init__.py
+2
-3
pcigale/analysis_modules/pdf_analysis/workers.py
pcigale/analysis_modules/pdf_analysis/workers.py
+2
-2
pcigale/analysis_modules/savefluxes/workers.py
pcigale/analysis_modules/savefluxes/workers.py
+1
-1
No files found.
pcigale/analysis_modules/__init__.py
View file @
481d8953
...
...
@@ -264,12 +264,11 @@ def complete_obs_table(obs_table, used_columns, filter_list, tolerance,
if
name_err
not
in
obs_table
.
columns
:
obs_table
.
add_column
(
Column
(
name
=
name_err
,
data
=
np
.
ones
(
len
(
obs_table
),
dtype
=
float
))
*
-
9999.
,
data
=
np
.
full
(
len
(
obs_table
),
-
9999.
))
,
index
=
obs_table
.
colnames
.
index
(
name
)
+
1
)
else
:
obs_table
[
name_err
]
=
np
.
ones
(
len
(
obs_table
),
dtype
=
float
)
*-
9999.
obs_table
[
name_err
]
=
np
.
full
(
len
(
obs_table
),
-
9999.
)
obs_table
[
name_err
]
=
adjust_errors
(
obs_table
[
name
],
obs_table
[
name_err
],
...
...
pcigale/analysis_modules/pdf_analysis/workers.py
View file @
481d8953
...
...
@@ -171,8 +171,8 @@ def sed(idx):
gbl_params
.
from_index
(
idx
))
if
'sfh.age'
in
sed
.
info
and
sed
.
info
[
'sfh.age'
]
>
sed
.
info
[
'universe.age'
]:
model_fluxes
=
-
99.
*
np
.
ones
(
len
(
gbl_filters
))
model_variables
=
-
99.
*
np
.
ones
(
len
(
gbl_analysed_variables
))
model_fluxes
=
np
.
full
(
len
(
gbl_filters
)
,
-
99.
)
model_variables
=
np
.
full
(
len
(
gbl_analysed_variables
)
,
-
99.
)
else
:
model_fluxes
=
np
.
array
([
sed
.
compute_fnu
(
filter_
)
for
filter_
in
gbl_filters
])
...
...
pcigale/analysis_modules/savefluxes/workers.py
View file @
481d8953
...
...
@@ -83,7 +83,7 @@ def fluxes(idx):
sed
.
to_votable
(
OUT_DIR
+
"{}_best_model.xml"
.
format
(
idx
))
if
'sfh.age'
in
sed
.
info
and
sed
.
info
[
'sfh.age'
]
>
sed
.
info
[
'universe.age'
]:
model_fluxes
=
-
99.
*
np
.
ones
(
len
(
gbl_filters
))
model_fluxes
=
np
.
full
(
len
(
gbl_filters
)
,
-
99.
)
else
:
model_fluxes
=
np
.
array
([
sed
.
compute_fnu
(
filter_
)
for
filter_
in
gbl_filters
])
...
...
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