This repository contains numerical and analytical calculations to compute 2 point correlations as Xi(r)=n(DD)/n(RR)-1 in the context of Dark Matter Halos and Large Scale Structure in the Universe.
- "BruteForce" directory contains a C++ code developed by me for computing 2PC on datasets with small number of points.
- "Comparison Plots" The Comparison code housed in this directory functions to plot multiple outputs of 2PC computations given their paths. Helpful in comparing Analytic and NUmerical computations. Recently modified to check ratios wrt a baseline file for better comparisons.
- "Data" directory contains the data input files used to calculate the 2 point correlations.
- "NFW Profile" directory holds code to compute the NFW Dark Matter Halo Profile as described in their paper, in Fourier space.
- "Normalize PS" directory code computes the proper normalization to the Linear Theory Power Spectrum at redshift=0, from an input of a Transfer Function. Theory is described in Scott Dodelson's Modern Cosmology - Chapter on Inhomogeinities. It outputs the normalised Power Spectrum in the same directory, for later computations of Mass Function, Bias and Halo Profile. Note that the two modes in which the code can output - 1. Finessed (interpolated at more values) 2. Same as k (no interpolations)
- "PKDTree" Computes 2PC considering Periodicity in the given dataset. This is brought about by wrapping the original dataset in its own images to make a bigger volume, while computing 2PC on the original volume(dataset) at the center.
- "Shadab" directory contains code developed by Shadab Alam to calculate 2 point correlations.
- "Tinker MF & Bias" houses code to compute the Mass Function and large scale Bias as described by Tinker et.al. in their Mass Function paper[2008] and their Bias paper[2010].
- "pickleMocks.py" helps to extract positions from the data files and pickle dump them as numpy arrays.
- C++ compiler
- Python (package sklearn should be installed)
- Jupyter Notebook
- Python3 compatible periodic_kdtree should be available (download: https://github.com/Vidhate/periodic_kdtree and setup)
To run for your own data sets please note the following things:
- Pickle your input data by running pickleMocks.py with the correct paths to input dataset
- All the codes have a variable path or paths that specifies where to derive the pickle dumps of input data. The path variable should point to the directory in which your input file is. The names or fileNames vector/list variable should have the name of the input files you will be using.
- To run the C++ code kindly do
>> g++ BruteForce.cpp
>> ./a.out - Rest of the codes can be run in the Jupyter Notebook.
The output of all the computations will be stored in the same directory which holds the code in the .txt format, with the same name as the input file name prefixed with an appropriate abbreviation of the technique.
The output of comparison plots is stored in the folder "Comparison Plots". The prefix "setX" can be changed in the code.