This repository collects examples for the usage of the LSST DESC Core Cosmology Library (CCL
) in python.
The material in this repository was developed within the LSST DESC using LSST DESC resources. DESC users should use it in accordance with the LSST DESC publication policy. External users are welcome to use the code outside DESC in accordance with the licensing information below.
Although each notebook in this directly can be explored independently of all the others, here is a suggested flow if you are just getting started with CCL
: The Distance Calculations Example will lead you through the basics of setting up a cosmology object in CCL
and using it from essential calculations based on the cosmological model, such as distances. At this level, you can also explore the Power spectrum example which shows you several options for modelling the matter power spectrum. (Variants of these predictions are provided in the PerturbationTheoryPk and the Halo-model-Pknotebooks).
CCL
uses power spectra and distances to obtain angular power spectra for LSST observbles and their corresponding correlation functions (see CellsCorrelations). That notebook gives you the essential LSST angular power spectra for lensing and clustering, but you might want to use CCL
for other types of correlations (see GeneralizedTracers). An MCMC noteboook illustrates how one can use CCL
with a likelihood sampler to get cosmological constraints given a set of data.
CCL
is also capable of giving cluster number counts predictions, as in Halo-mass-function-example. You might want to make predictions for other clusters observables. See the Halo-profiles notebook.
All of the above predictions work for wCDM models. For the beyond-wCDM cases, see the MG_mu_sigma_examples.
Finally, for some utilities, such as reading and writing CCL
cosmologies, see this notebook.
These notebooks can be run online using binder (kudos to Antony Lewis for this). Note that some notebooks featuring functionality that hasn't yet been formally released may not run.
It is possible to install and run these examples, or your own CCL code, from Google Colab. To install CCL on Colab, you can do the following (thanks to Jean-Eric Campagne):
!pip install -q condacolab
import condacolab
condacolab.install()
!conda install --no-pin pyccl
import pyccl
Further CCL documentation can be found in our Readthedocs page. More examples can be found in our benchmark comparison notebooks here and in deprecated (pre-CCL v2) notebooks here. The examples in this repository continue evolving to match developments in the CCL master branch, but you can find examples that are v2-compatible if you restrict to the first set of commits.
The CCL
code has been released by DESC and is accompanied by a journal paper that describes the development and validation of CCL v1.0.0
, which you can find on the arxiv:1812.05995. The latest version is CCL v2.0.1.
If you make use of the ideas or software here, please cite the CCL
paper and provide a link to this repository: https://github.com/LSSTDESC/CCL. You are welcome to re-use the code, including these examples, which is open source and available under terms consistent with our LICENSE, which is a BSD 3-Clause license.
For free use of the CLASS
library, the CLASS
developers require that the CLASS
paper be cited: CLASS II: Approximation schemes, D. Blas, J. Lesgourgues, T. Tram, arXiv:1104.2933, JCAP 1107 (2011) 034. The CLASS
repository can be found in http://class-code.net. Finally, CCL uses code from the FFTLog package. We have obtained permission from the FFTLog author to include modified versions of his source code.
If you have comments, questions, or feedback, please write us an issue. You can also contact the administrators.