From 82d1a6b877a18103fc1c0be3ac1ad516ffe81d88 Mon Sep 17 00:00:00 2001 From: sibirrer Date: Thu, 13 Oct 2022 15:21:54 -0700 Subject: [PATCH] added a Sersic bn test function --- .../test_LensModel/test_Profiles/test_sersic_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/test_LensModel/test_Profiles/test_sersic_utils.py diff --git a/test/test_LensModel/test_Profiles/test_sersic_utils.py b/test/test_LensModel/test_Profiles/test_sersic_utils.py new file mode 100644 index 000000000..a23fead01 --- /dev/null +++ b/test/test_LensModel/test_Profiles/test_sersic_utils.py @@ -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)