Skip to content

Commit

Permalink
fixing another bug in the likelihood
Browse files Browse the repository at this point in the history
  • Loading branch information
karllark committed Sep 10, 2024
1 parent 8051807 commit d2117ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions measure_extinction/utils/fit_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def lnlike(self, params, obsdata, modeldata):
fits the model.
Parameters
``
----------
params : floats
parameters of the model
Expand Down Expand Up @@ -99,10 +100,12 @@ def lnlike(self, params, obsdata, modeldata):
gvals = (self.weights[cspec] > 0) & (np.isfinite(hi_ext_modsed[cspec]))
chiarr = np.square(
(
obsdata.data[cspec].fluxes[gvals].value
- (hi_ext_modsed[cspec][gvals] * (norm_data / norm_model))
(
obsdata.data[cspec].fluxes[gvals].value
- (hi_ext_modsed[cspec][gvals] * (norm_data / norm_model))
)
* self.weights[cspec][gvals]
)
* self.weights[cspec][gvals]
)
lnl += -0.5 * np.sum(chiarr)

Expand Down
2 changes: 1 addition & 1 deletion measure_extinction/utils/make_all_tlusty_obsdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def decode_params_wd(filename):
model_params["Z"] = 1.0 # ratio to solar

Check warning on line 80 in measure_extinction/utils/make_all_tlusty_obsdata.py

View check run for this annotation

Codecov / codecov/patch

measure_extinction/utils/make_all_tlusty_obsdata.py#L77-L80

Added lines #L77 - L80 were not covered by tests

if model_params["Teff"] < 10000.0:
model_params["Teff"] *= 1000.0
model_params["Teff"] *= 100.0

Check warning on line 83 in measure_extinction/utils/make_all_tlusty_obsdata.py

View check run for this annotation

Codecov / codecov/patch

measure_extinction/utils/make_all_tlusty_obsdata.py#L82-L83

Added lines #L82 - L83 were not covered by tests

return model_params

Check warning on line 85 in measure_extinction/utils/make_all_tlusty_obsdata.py

View check run for this annotation

Codecov / codecov/patch

measure_extinction/utils/make_all_tlusty_obsdata.py#L85

Added line #L85 was not covered by tests

Expand Down

0 comments on commit d2117ef

Please sign in to comment.