Skip to content

Commit

Permalink
Merge pull request #245 from karllark/fix_spline
Browse files Browse the repository at this point in the history
Update spline interpolation
  • Loading branch information
karllark authored Nov 15, 2024
2 parents f4cc6cd + 376796a commit 9b47a49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions dust_extinction/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ def _curve_F99_method(

spline_x = np.concatenate([x_splineval_optir, x_splineval_uv])
spline_y = np.concatenate([y_splineval_optir, y_splineval_uv])
spline_rep = interpolate.splrep(spline_x, spline_y)
axav[indxs_opir] = interpolate.splev(x[indxs_opir], spline_rep, der=0)
axav[indxs_opir] = interpolate.CubicSpline(spline_x, spline_y, bc_type='natural')(x[indxs_opir])

# return A(x)/A(V)
return axav
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 @@ -57,7 +57,7 @@
"Rv": 3.1,
"x_values": [0.377, 0.820, 1.667, 1.828, 2.141, 2.433, 3.704, 3.846],
"y_values": np.array([0.185, 0.772, 2.688, 3.055, 3.805, 4.315, 6.456, 6.781]) / 3.1,
"atol": 1e-3,
"atol": 4e-3,
# from Fitzpatrick (1999) Table 3
# keep optical from Fitzpatrick (1999),
# replce NIR with Fitzpatrick (2004) function for Rv=3.1:
Expand Down

0 comments on commit 9b47a49

Please sign in to comment.