Skip to content

Commit

Permalink
Merge pull request lenstronomy#375 from sibirrer/sersic_index
Browse files Browse the repository at this point in the history
added a Sersic bn test function
  • Loading branch information
sibirrer authored Oct 13, 2022
2 parents a539ae5 + 82d1a6b commit 3383d4a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_LensModel/test_Profiles/test_sersic_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import numpy as np
from lenstronomy.LensModel.Profiles.sersic_utils import SersicUtil
import numpy.testing as npt


def test_bn():
n_array = np.linspace(start=0.2, stop=8, num=30)
for n in n_array:
bn_approx = 1.9992 * n - 0.3271
bn = SersicUtil.b_n(n)
npt.assert_almost_equal(bn, bn_approx, decimal=3)

0 comments on commit 3383d4a

Please sign in to comment.