carronj / plancklens

Planck 2018 lensing pipeline
Other
21 stars 17 forks source link
cosmic-microwave-background cosmology gravitational-lensing python-package

plancklens

alt textBuild Status

plancklens is is a python code for cosmology containing most of Planck 2018 CMB lensing pipeline, by Julien Carron on behalf of the Planck collaboration (publication here.) Some numerical parts are written in Fortran. Portions of it (structure and code) have been directly adapted from pre-existing work by Duncan Hanson.

This package may be used for:

Installation

After cloning the repository, build an editable installation with

pip install -e . [--user]

The –-user is required only if you don’t have write permission to your main python installation. A fortran compiler is required for a successful installation.

Alternatively, you can use the Dockerfile to install the code in a separate container (see below).

Docker installation (credits Louis Legrand)

The Dockerfile allows you to install plancklens and lenspyx in a Docker container and to run Jupyter. This image is based on the jupyter/scipy-notebook image. After installing docker on your machine, go in the plancklens repository and build the image with

docker build -t plancklens .

You can then start the container with

docker run -it -p 8888:8888 plancklens

Visiting http://<hostname>:8888/?token=<token> in a browser loads JupyterLab, where:

`hostname` is the name of the computer running Docker

`token` is the secret token printed in the console.

If you only wish to run a terminal within the container type

docker run -it plancklens /bin/sh

Contents

This code contains most of the Planck 2018 lensing pipeline. In particular it is possible to reproduce the published map and band-powers basically exactly. Some more detailed parts of the pipeline have been left out or are not yet translated to python 3. This is the case notably of the band-powers likelihood code.

The code used to produce lensed CMB skies is the stand-alone pip package lenspyx (with big speed improvement expected soon)

Examples

Generally, in plancklens a QE is often described by a short string.

For example 'ptt' stands for lensing (or lensing gradient mode) from temperature x temperature.

Anisotropy source keys are a one-letter string including

'p' (lensing gradient)

'x' (lensing curl)

's' (point sources)

'f' (modulation field)

'a' (polarization rotation)

Typical keys include then:

'ptt', 'xtt', 'stt', 'ftt' for the corresponding QEs from temperature only

'p_p', 'x_p', 'f_p', 'a_p' for the corresponding QEs from polarization only (combining EE EB and BB if relevant)

'p', 'x', 'f', 'a', 'f' ... for the MV (or GMV) combination

'p_eb', ... for the EB estimator (this is the symmetrized version  ('peb' + 'pbe') / 2  so that E and B appear each once on the gradient and inverse-variance filtered leg)