Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cigale
CIGALE
Commits
2d097ed7
Commit
2d097ed7
authored
Mar 30, 2018
by
Médéric Boquien
Browse files
Build the chi2 array in a slightly easier way to understand.
parent
c7f03584
Changes
1
Show whitespace changes
Inline
Side-by-side
pcigale/analysis_modules/pdf_analysis/utils.py
View file @
2d097ed7
...
...
@@ -208,8 +208,10 @@ def compute_chi2(model_fluxes, model_props, model_propsmass, obs,
args
=
(
obs_values
,
obs_values_err
,
model_values
[:,
imod
])).
x
# χ² of the comparison of each model to each observation.
chi2
=
np
.
zeros_like
(
scaling
)
# Computation of the χ² from fluxes
chi2
=
np
.
zeros
(
model_fluxes
.
shape
[
1
])
for
i
in
range
(
obs
.
fluxes
.
size
):
if
np
.
isfinite
(
obs
.
fluxes
[
i
])
and
obs
.
fluxes_err
[
i
]
>
0.
:
chi2
+=
np
.
square
((
obs
.
fluxes
[
i
]
-
model_fluxes
[
i
,
:]
*
scaling
)
*
...
...
Write
Preview
Supports
Markdown
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