Skip to content

Commit

Permalink
Add test to profiles on squeezed shapes and fix Hernquist _fourier_an…
Browse files Browse the repository at this point in the history
…alytic (#966)

* Add tests on squeezed shape

* Fix Herquist _fourier_analytic squeezed shape

* flake8

* Add tests for fftlog_wrap
  • Loading branch information
hsinfan1996 committed Aug 3, 2022
1 parent 0ae1a0b commit d99b2cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pyccl/halos/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,8 +1080,8 @@ def _fourier_analytic(self, cosmo, k, M, a, mass_def):

x = k_use[None, :] * R_s[:, None]
Si2, Ci2 = sici(x)
c_Mp1 = c_M + 1
P1 = M / ((c_M / c_Mp1)**2 / 2)
P1 = M / ((c_M / (c_M + 1))**2 / 2)
c_Mp1 = c_M[:, None] + 1
if self.truncated:
Si1, Ci1 = sici(c_Mp1 * x)
P2 = x * np.sin(x) * (Ci1 - Ci2) - x * np.cos(x) * (Si1 - Si2)
Expand Down
8 changes: 7 additions & 1 deletion pyccl/tests/test_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@ def test_empirical_smoke(prof_class):
p = prof_class(c,
cumul2d_analytic=True,
truncated=True)
p = prof_class(c)
smoke_assert_prof_real(p, method='_fourier_analytic')
smoke_assert_prof_real(p, method='_projected_analytic')
smoke_assert_prof_real(p, method='_cumul2d_analytic')

p = prof_class(c)
smoke_assert_prof_real(p)
smoke_assert_prof_real(p, method='real')
smoke_assert_prof_real(p, method='projected')
smoke_assert_prof_real(p, method='fourier')


def test_cib_smoke():
Expand Down

0 comments on commit d99b2cf

Please sign in to comment.