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

Implementation of the lensing power spectrum computation with CCL #166

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

raphkou
Copy link
Contributor

@raphkou raphkou commented Nov 22, 2023

This PR implements the lensing power spectrum computation with CCL. A flag is added to choose whether to use CAMB or CCL to compute this power spectrum.

… flag to choose whether to use CAMB or CCL to compute this power spectrum.
@itrharrison itrharrison self-requested a review November 23, 2023 10:50
Copy link
Collaborator

@itrharrison itrharrison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thank you! One extra which would be good is the inclusion of a test which checks that the CCL result is comparable to the CAMB one.

e.g.

def test_lensing_ccllimber(request):

    from cobaya.install import install
    install({"likelihood": {"soliket.lensing.LensingLikelihood": None}},
            path=packages_path, skip_global=False, force=True, debug=True)

    from soliket.lensing import LensingLikelihood

    info["likelihood"] = {"LensingLikelihood": {"external": LensingLikelihood}}
    model = get_model(info)
    model.loglikes({})
    cl_ccl = model.likelihood['LensingLikelihood']._get_theory()

    info['likelihood']['LensingLikelihood']['pp_ccl'] = False
    model = get_model(info)
    model.loglikes({})
    cl_camb = model.likelihood['LensingLikelihood']._get_theory()

    assert np.any(np.not_equal(cl_ccl,cl_camb))
    assert np.allclose(cl_ccl, cl_camb)

zstar = self.provider.get_param("zstar")
cmbk = ccl.CMBLensingTracer(cosmo, z_source=zstar)
Clkk_theo = ccl.angular_cl(cosmo, cmbk, cmbk, self.ls)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove whitespace on this blank line, as requested by the codestyle test. You can check this passes locally by running tox -e codestyle.

@raphkou
Copy link
Contributor Author

raphkou commented Nov 27, 2023

As you advised, I added a test to check that the predictions from CAMB and CCL agree (at least in the case where the mass of neutrinos is 0). I also fixed the codestyle.

Copy link
Collaborator

@itrharrison itrharrison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now. Thank you @raphkou !

@itrharrison itrharrison merged commit 1b7c793 into simonsobs:master Dec 1, 2023
itrharrison added a commit that referenced this pull request Jun 7, 2024
* pyccl optional (#153)

* pyccl optional

* oops

* Add simple halo model (#150)

* remove depracated likelihood.theory calls

* codestyle

* sphinx compatability update

* sphinx compatability update 2204

* add build tools

* move rtd python ver

* rtd try different pyver

* rtd try different order

* conda on rtd

* update rtd mock import

* add rtd theme

* add rtd theme correctly

* add rtd theme in setup.cfg

* Testing yaml instead of yml.

* added docs conda env

* add full requirements in docs

* pin tensorflow dep

* started basic halo model

* started basic pyhm implementation and tests

* pkmm computation with z loop

* remove empty functions

* test against precomputed value

* codestyle and fix test

* add missing default files

* added docs

* line length

* remove refernce to bias model in docs

* improve docs

---------

Co-authored-by: Hidde Jense <JenseH@cardiff.ac.uk>

* Deprecations update (#155)

* pyccl optional

* oops

* remove pkg_resources

* str path

* pudate latest

* fix

* py311

* py311

* py311

* typo

* Update docs/soliket-docs.yml

* Update soliket-tests.yml

---------

Co-authored-by: Ian Harrison <itrharrison@gmail.com>

* Pycharm tidies (#161)

* pyccl optional

* oops

* remove pkg_resources

* str path

* added new warnings, fails

* pudate latest

* changes for new reqs

* fix

* py311

* py311

* py311

* update halomodel codestyle

* Mist tidy

* typo

* brackets

---------

Co-authored-by: Ian Harrison <itrharrison@gmail.com>

* Run tests only on PR open, review requests (#159)

* run tests only on PR open, review requests

* added some extra instructions in docs

* reorder on setting

* line break

* reset what is written in docs

* Add more flake8 requirements (#157)

* added new warnings, fails

* changes for new reqs

* update halomodel codestyle

* whitespace warnings

* added zstar to crosscorrelation (#165)

* Implementation of the lensing power spectrum computation with CCL (#166)

* Implementing the lensing power spectrum computation with CCL. Added a flag to choose whether to use CAMB or CCL to compute this power spectrum.

* Adding test to check CCL and CAMB agree to predict the CMB lensing power spectrum

---------

Co-authored-by: Raphaël Kou <raphael.kou@apc.in2p3.fr>

* solving bug in mflike (#170)

* Fix readme (#173)

* stricter indentation

* Update README.rst

* Dev check ell range mflike (#171)

* change to lmax requirements

* removing comments in modified files

* solving style issues

* solving issues in test mflike

* solving codestyle issues

* switched from hard-coded to l_bpws-depndt multipole

* fixed codestyle

---------

Co-authored-by: Martina Gerbino <bradamante@martina.local>
Co-authored-by: Ian Harrison <itrharrison@gmail.com>

* Resolving packages path with cobaya tools (#169)

* Fix extra letter in calibration params

* Use cobaya tools to resolve packages path

* flake

* Revert "flake"

This reverts commit 526acde.

* Update yaml files with correct paramnames and paths

For the `test_multi.py`, I switched from `MFLike` to `TestMFLike`, coherently with `test_mflike.py`

* Update paths in test_multi

* Enable multi and mflike in test_runs

* bug fix

* Avoid overwrite global packages_path

* flake

* Change pathfinding to data with packages path

* Revert to request forcing rootdir

* Point to `tox.ini` directory

---------

Co-authored-by: mgerbino <marti.gerbino@gmail.com>
Co-authored-by: Ian Harrison <itrharrison@gmail.com>

---------

Co-authored-by: Antony Lewis <cmbant@users.noreply.github.com>
Co-authored-by: Hidde Jense <JenseH@cardiff.ac.uk>
Co-authored-by: raphkou <61792335+raphkou@users.noreply.github.com>
Co-authored-by: Raphaël Kou <raphael.kou@apc.in2p3.fr>
Co-authored-by: Serena Giardiello <67148348+sgiardie@users.noreply.github.com>
Co-authored-by: mgerbino <marti.gerbino@gmail.com>
Co-authored-by: Martina Gerbino <bradamante@martina.local>
Co-authored-by: Giacomo Galloni <giacomo.galloni@unife.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants