Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding option for FM90_B3 to FM99_method #246

Merged
merged 2 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions dust_extinction/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
Rv,
C1,
C2,
C3,
bump_param,
C4,
xo,
gamma,
optnir_axav_x,
optnir_axav_y,
fm90_version="C3",
):
"""
Function to return extinction using F99 method
Expand All @@ -44,8 +45,9 @@
C2: float
slope of liner term: FM90 parameter

C3: float
amplitude of "2175 A" bump: FM90 parameter
bump_param: float
C3 for fm90_version = "C3"
B3 for fm90_version = "B3"

C4: float
amplitude of FUV rise: FM90 parameter
Expand All @@ -62,6 +64,9 @@
optnir_axav_y: float array
vector of y values for optical/NIR A(x)/A(V) curve

fm90_version: str
"C3" for standard FM90, "B3" for FM90_B3 for true bump amplitude version

Returns
-------
axav: np array (float)
Expand Down Expand Up @@ -91,7 +96,10 @@
xuv = x_splineval_uv

# FM90 model and values
fm90_model = FM90(C1=C1, C2=C2, C3=C3, C4=C4, xo=xo, gamma=gamma)
if fm90_version == "B3":
fm90_model = FM90_B3(C1=C1, C2=C2, B3=bump_param, C4=C4, xo=xo, gamma=gamma)

Check warning on line 100 in dust_extinction/shapes.py

View check run for this annotation

Codecov / codecov/patch

dust_extinction/shapes.py#L100

Added line #L100 was not covered by tests
else:
fm90_model = FM90(C1=C1, C2=C2, C3=bump_param, C4=C4, xo=xo, gamma=gamma)
# evaluate model and get results in A(x)/A(V)
axav_fm90 = fm90_model(xuv / u.micron) / Rv + 1.0

Expand Down
2 changes: 1 addition & 1 deletion dust_extinction/tests/test_corvals.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"atol": 4e-3,
# from Fitzpatrick (1999) Table 3
# keep optical from Fitzpatrick (1999),
# replce NIR with Fitzpatrick (2004) function for Rv=3.1:
# replace NIR with Fitzpatrick (2004) function for Rv=3.1:
# (0.63*3.1 - 0.84)*x**1.84
},
M14: {
Expand Down
Loading