Author: Azadeh Moradinezhad Dizgah
with contributions from Alberto Vallinotto and Farnik Nikakhtar
Welcom to limHaloPT, a peer-reviewed open source numerical package for computing the clustering and shot-noise contributions to the power spectrum of line intensity/temperature fluctuations within halo-model framework. The current version of the code, is limited to real-space, and redshift-space distortions will be included in the next release.
The extended halo model of line intensity power spectrum implemented in limHaloPT, combines the predictions of EFTofLSS for halo power spectrum with the standard halo model to account for the nonlinear evolution of matter fluctuations and the nonlinear biasing relation between line intensity fluctuations and the underlying dark matter distribution in 2-halo term. Furthermore, the model includes the effect of large bulk velocities (Infrared Resummation) in the 2-halo term. The deviations from Poisson shot noise on large scales are also computed within the halo model.
This package is released together with the following publication, JCAP02(2022)026, where the predictions of the model are tested against a new suite of simulated intensity (brightness temperature) maps of CO and [CII] lines. The mesheded fields from MithraLIMSims will be publically avilable on MithraLIMSims. The code to analyse the simulated maps is an extension of the toolkit used in analysing Hidden-Valley simulations, and is publically avilable on LIM Analysis. As discussed in the manuscript above, the packages to compute the theory predictions and creating the simulated intensity maps can be straightforwardly extended to compute the power spectrum signal of other emission lines (emitted from star-froming galaxies), beside CO and [CII].
The full documentation of the code can be found on Documentation. The peer-reviewed JOSS software publication can be accessed at JOSS_limHaloPT.
The limHaloPT package calls various functions from CLASS Boltzman solver, including the matter power spectrum and transfer functions, growth factor etc. Therefore, you need to first download and compile CLASS code, and place the "libclass.a" in Class/lib folder. Furtehrmore, the loop calculations are performed with direct numerical integration, using routines of CUBA library. Lastly, the code heavily uses functions of GSL scientific library. Therfore, make sure that the two libraries are correctly linked to limHaloPT by making necassary modifcations to the makefile (placed in the main directory) of limHaloPT package.
Note that in order to compute the luminosities of spectral lines, a model of star formation rate as a function of halo mass and redshift, SFR(M_h,z), should be assumed. Currently, the implemented model uses SFR(M_h,z) from Behroozi et al. (2013). The necassary input file, "sfr_release.dat", is included in "Input/release-sfh_z0_z8_052913/sfr/" subdirectory.
limHaloPT consists of 10 main modules, which include the following categories of functions:
The entire limHaloPT package was developed, compiled, and tested on Mac OS X, using gcc version 7.5.0 compiler.
Currently, the main output of limHaloPT are the mean brightness temprature, linear and quadratic biases, clustering and shot noise contributions of 7 emission spectral lines, depending on the switch that you set in the ini file. The computation of these functions are performed within main.c module. An example of the ini file is provided (LCDM.ini). If you want to call any of the functions of limHaloPT, apart from those called by defacult, you neeed to add the function call to main.c, recompile the code by first cleaning the previous build using "make clean" and building the package again with "make".
Example: Lets say you want to compute the mean brightness temprature, linear and quadratic biases for one or multiple emission lines, as a function of wavenumber at several redshifts. In the .ini file, you should set the switch "switch_Tbar" to be equal to "Tbar", and the switches of shot and power spectra blank, i.e. "switch_HMshot = " and "switch_HMshot = ". The relavent functions that are called within main.c are PS_line_HM() and line_bias(). For this function call, first two arrays for values of redshifts and wavenumbers for which the power spectrum is computed are created. the computed values for the three quantities is saved by default in an output file saved in "Output" directory. The number of emission lines to be included in the computation is set with "nlines" variable in the LCDM.ini file, while the name of the line is passed with line1, line2, ... variables. T The first argument of PS_line_HM, is the cosmology structure needed for performing any calculation in the code. See cosmology.c module for more details. The LCDM.ini file contains description of parmaeters that should be set in the .ini file.
So here is how PS_line_HM() function is called within main():
int nz_mean = gb.mean_nz;
double *z_mean = init_1Darray(nz_mean,0.0,gb.mean_zmax);
double lbias_arr[2];
double b1 = 0.;
double b2 = 0.;
double Tbar = 0.;
FILE *fp1;
char filename1[FILENAME_MAX];
for(int i=0;i<nlines;i++){
sprintf(filename1,"%s/Tbar_J%d.txt", gb.output_dir, JJ[i]);
fp1 = fopen(filename1, "ab");
fprintf(fp1,"%s %s %s %s %s \n","#", "z", "b1", "b2", "Tbar");
for(int j=0;j<nz_mean;j++){
Tbar = Tbar_line(&Cx_ref, i, z_mean[j]);
line_bias(Cx_ref.Lines[i],z_mean[j],lbias_arr);
b1 = lbias_arr[0];
b2 = lbias_arr[1];
fprintf(fp1,"%12.6e %12.6e %12.6e %12.6e \n",z_mean[j], b1, b2, Tbar);
}
fclose(fp1);
}
free(z_mean);
By default, in additionn to having the output in main() function for mean brightness temprature, biases, shot and clustering components of power spectrum, when computing the clustering and shot powers, individual loop contributions (in the former) and individual beyond-Possion contribution to the shot (in the latter), are also saved to output files which are stored in "Output" directory.
In addition to using limHaloPT through "main.c" module which calls three specific functions, limHalpPT can be exported as an external library to any other C code. For example if you would like to call the function that computes the halo mass function for a given theoretical model, once the liblimHaloPT.a library is linked to, the relevent function can be accessed from an external C code.
"Test" directory includes an automated test for the three main functions of limHaloPT, which are called within main.c module. These tests are designed to test functionality of the code. Therefore, by default the parameters of the .ini file are set to values that allow to run the code fast. Note that these values should not be used when running the analysis, since the output would not have the precisioon needed for cosmological analysis.
Having compiled limHaloPT package, and created the "liblimHaloPT.a" library, to run the test, switch to "Test" subdirectory. You have to first do "make", and then you can run the code by typying "./test test_LCDM.ini. Upon completion, the output files are stored in "Test/Output" directory.
Note that the test.c also can surve as an example of how you can link your code to liblimHaloPT.a library.
You can use this package freely, provided that in your publication you cite the following two papers;
Furthermore, since limHaloPT relies on CLASS Boltzman code, you should also cite at least this paper JCAP07(2011)034 as required by CLASS developers.
To contribute, create a fork on github, make changes and commits, and submit a pull request on github. If you found any issues with the code, please get in touch by posting an issue on this github repository.
Copyright 2021 Azadeh Moradinezhad Dizgah.
limHaloPT is free software made available under the MIT License. For details see the LICENSE file.