Skip to content

Simulation-based Inference of the BOSS survey

License

Notifications You must be signed in to change notification settings

gitter-badger/boss_sbi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BOSS SBI

MIT License

Simulation-based Inference of the BOSS survey

Details and resources on the original BOSS analysis: https://sites.google.com/view/learningouruniverse/boss-analysis?authuser=0

Installation

First set up a new anaconda environment to avoid any package conflicts.

Activate the conda environment and then install the boss_sbi package

# first clone the repo
git clone https://github.com/changhoonhahn/boss_sbi.git

# go to the repo
cd boss_sbi

# install the package 
pip install -e . 

You will also need to set the $QUIJOTE_DIR environment variable. To do this, add the following line

export QUIJOTE_DIR="/projects/QUIJOTE/"

to your ~/.bashrc file. If you don't know how to do this then just copy paste the following:

echo 'export QUIJOTE_DIR="/projects/QUIJOTE/"' >> ~/.bashrc

Once you've added the line, don't forget to run

source ~/.bashrc

Setting Up a Conda Environment

On tiger

If you're on Princeton's tiger cluster, you don't have to install anaconda. You can load it using

module load anaconda 

Afterwards you can create a new conda environment using

conda create -n ENV_NAME_HERE python=3.7 ipython 

and following the instructions.

To activate the conda environment you created

conda activate ENV_NAME_HERE 

Later, if you want to exist the conda environemtn

conda deactivate 

Dependencies

The boss_sbi package requires the following python pacakges:

tl;dr Run the following lines after activating the conda environment

conda install -c bccp nbodykit
pip install pymangle

Generating an HOD catalog for HR Quijote LHC

import numpy as np 
from boss_sbi.halos import Quijote_LHC_HR
from boss_sbi import galaxies as Galaxies

# read in halo catalog 
halos = Quijote_LHC_HR(1, z=0.5)

# get LOWZ HOD parameters
theta_hod = Galaxies.thetahod_lowz_ngc()

# apply HOD 
gals = Galaxies.hodGalaxies(halos, theta_hod, seed=0) 
print(np.array(gals['Position']))

About

Simulation-based Inference of the BOSS survey

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%