Skip to content

Commit

Permalink
addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
karllark committed Mar 30, 2022
1 parent ceaaa0d commit 4a6c7b5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/dust_extinction/choose_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Way, the usual average used is R(V) = 3.1.
+--------------+-------------+------------------+--------------+
| G21_MWAvg | 0.3125 - 1 | 1 - 32 | MW |
+--------------+-------------+------------------+--------------+
| D22_MWAvg | 0.2 - 1.25 | 0.8 - 5 | MW |
| D22_MWAvg | 0.2 - 1.25 | 0.8 - 4 | MW |
+--------------+-------------+------------------+--------------+
| CT06_MWLoc | 0.037 - 0.8 | 1.24 - 27.0 | MW (Local) |
+--------------+-------------+------------------+--------------+
Expand Down
6 changes: 2 additions & 4 deletions dust_extinction/averages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1431,8 +1431,6 @@ class D22_MWAvg(BaseExtModel):
from dust_extinction.averages import D22_MWAvg
mod = D22_MWAvg()
fig, ax = plt.subplots()
# generate the curves and plot them
Expand Down Expand Up @@ -1471,7 +1469,7 @@ def __init__(self, **kwargs):
# get the tabulated information
data_path = pkg_resources.resource_filename("dust_extinction", "data/")

# GCC09 sigma clipped average of 13 diffuse sightlines
# D22 sigma clipped average of 13 diffuse sightlines
a = Table.read(data_path + "D22.dat", format="ascii.commented_header")

# Spex data
Expand Down Expand Up @@ -1515,5 +1513,5 @@ def evaluate(self, in_x):
d22_fit = PowerLaw1D(alpha=1.71, amplitude=0.386, x_0=1.0)

# return A(x)/A(V)
# Note that model in D22 was done versus waelength in microns
# Note that model in D22 was done versus wavelength in microns
return d22_fit(1.0 / x)
8 changes: 4 additions & 4 deletions dust_extinction/parameter_averages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ class D22(BaseExtRvModel):
Decleir, Gordon, et al. (2022, ApJ, submitted) model.
Based on a sample of stars observed spectroscopically in the
optical with IRTF/SpeX.
NIR with IRTF/SpeX.
Parameters
----------
Expand Down Expand Up @@ -1284,7 +1284,7 @@ class D22(BaseExtRvModel):
"""

Rv_range = [2.5, 5.5]
x_range = [1 / 4.0, 1 / 0.85]
x_range = [1 / 4.0, 1 / 0.80]

def __init__(self, Rv=3.1, **kwargs):

Expand Down Expand Up @@ -1338,8 +1338,8 @@ def evaluate(self, in_x, Rv):
a = mod_a(1.0 / x)

# slopes
# from spline interpolation - need ot get this info
# from spline interpolation
b = interpolate.splev(1.0 / x, self.spline_rep, der=0)

# return A(x)/A(55)
# return A(x)/A(V)
return a + b * (1.0 / Rv - 1 / 3.1)
1 change: 0 additions & 1 deletion dust_extinction/tests/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def test_invalid_Rv_input(model, Rv_invalid):
with pytest.raises(InputParameterError) as exc:
model(Rv=Rv_invalid)
assert "parameter Rv must be between" in exc.value.args[0]
# assert exc.value.args[0] == "parameter Rv must be between 2.0 and 6.0"


@pytest.mark.parametrize("RvA_invalid", [-1.0, 0.0, 1.9, 6.1, 10.0])
Expand Down

0 comments on commit 4a6c7b5

Please sign in to comment.