Skip to content

Commit

Permalink
reversing a change
Browse files Browse the repository at this point in the history
  • Loading branch information
karllark committed Sep 30, 2024
1 parent 8088e77 commit 5ad8d2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
30 changes: 10 additions & 20 deletions beast/physicsmodel/creategrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from beast.physicsmodel.stars import stellib
from beast.physicsmodel.grid import SpectralGrid, SEDGrid
from beast.physicsmodel.priormodel import PriorDustModel
from beast.physicsmodel.grid_and_prior_weights import compute_av_rv_fA_prior_weights

from beast.physicsmodel.grid_weights import compute_grid_weights

Expand Down Expand Up @@ -427,25 +427,15 @@ def make_extinguished_grid(
cols["Rv"][N0 * count : N0 * (count + 1)] = Rv

# compute the dust weights
# moved here in 2023 to support distance based dust priors
dists = g0.grid["distance"].data
if av_prior_model["name"] == "step":
av_prior_weights = av_prior(np.full((len(dists)), Av), y=dists)
else:
av_prior_weights = av_prior(Av)
if rv_prior_model["name"] == "step":
rv_prior_weights = rv_prior(np.full((len(dists)), Rv), y=dists)
else:
rv_prior_weights = rv_prior(Rv)
if fA_prior_model["name"] == "step":
f_A_prior_weights = fA_prior(np.full((len(dists)), f_A), y=dists)
else:
if with_fA:
f_A_prior_weights = fA_prior(f_A)
else:
f_A_prior_weights = 1.0

dust_prior_weight = av_prior_weights * rv_prior_weights * f_A_prior_weights
dust_prior_weight = compute_av_rv_fA_prior_weights(
Av,
Rv,
f_A,
g0.grid["distance"].data,
av_prior_model=av_prior_model,
rv_prior_model=rv_prior_model,
fA_prior_model=fA_prior_model,
)

# get new attributes if exist
for key in list(temp_results.grid.keys()):
Expand Down
2 changes: 1 addition & 1 deletion docs/physicsmodel_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ to be independent of the grid spacing.

.. automodapi:: beast.physicsmodel.priormodel

.. automodapi:: beast.physicsmodel.grid_weights_stars
.. automodapi:: beast.physicsmodel.grid_weights

.. automodapi:: beast.physicsmodel.grid_and_prior_weights

Expand Down

0 comments on commit 5ad8d2d

Please sign in to comment.