Skip to content
/ cup1d Public

Cosmology using P1D - small scale clustering of the Lyman alpha forest

Notifications You must be signed in to change notification settings

igmhub/cup1d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cup1d

Cosmology using P1D - small-scale clustering of the Lyman alpha forest

This repository contains some tools to perform the last steps of a cosmological analysis of the 1D power spectrum (P1D) of the Lyman alpha forest.

It uses the LaCE emulator (https://github.com/igmhub/LaCE), and some extra tools to run MCMC analyses on cosmological and IGM parameters for a mock P1D measurement.

If you would like to collaborate, please email Andreu Font-Ribera ([email protected]) or Jonas Chaves-Montero ([email protected]).

Installation

  • Download and install Conda. You can find the instructions here https://docs.anaconda.com/miniconda/miniconda-install/

  • Create a new conda environment. It is usually better to follow python version one or two behind. In January 2024, the latest is 3.12, so we recommend 3.11.

conda create -n cup1d -c conda-forge python=3.11 camb mpich mpi4py fdasrsf pip=24.0
conda activate cup1d
  • Install LaCE (do so within the environment created above):

Follow the instructions from https://github.com/igmhub/lace (see also below)

git clone https://github.com/igmhub/LaCE.git
cd LacE
pip install -e .
  • Clone the cup1d repo and perform an editable installation:
git clone https://github.com/igmhub/cup1d.git
cd cup1d
pip install -e .

NERSC users:

  • You need to compile mpi4py package on NERSC (see here).
MPICC="cc -shared" pip install --force-reinstall --no-cache-dir --no-binary=mpi4py mpi4py

Nyx users:

  • You may need to add the Nyx path as an enviroment variable in your notebook kernel. The first is done writting in the kernel.json file:
 "env": {
  "NYX_PATH":"path_to_Nyx"
 }

For convenience, you could also add the Nyx path as an environment variable. The Nyx data is located at NERSC in

NYX_PATH="/global/cfs/cdirs/desi/science/lya/y1-p1d/likelihood_files/nyx_files/"

Notebooks / tutorials

  • All notebooks in the repository are in .py format. To generate the .ipynb version, run:
jupytext --to ipynb notebooks/*/*.py
  • If you want to use notebooks via JupyterHub, you'll also need to download ipykernel:
pip install ipykernel
python -m ipykernel install --user --name cup1d --display-name cup1d

You can find the main tutorial to run your analyses in notebooks/tutorials/sample_sim.py

You can also plot many P1D measurements stored in the repo, by looking at notebooks/p1d_measurements

You can also redo old neutrino mass constraints by importance sampling WMAP and Planck chains, following notebooks/planck

You can also play with the LaCE emulator with the notebooks in notebooks/emulator

Forecasting script

You can use the script scripts/sam_sim.py to run your own analyses. It is fully parallelized using MPI.

About

Cosmology using P1D - small scale clustering of the Lyman alpha forest

Resources

Stars

Watchers

Forks

Packages

No packages published