Documented line_ingredients module. More...
#include "header.h"
Functions | |
| struct Line * | Line_alloc_init (struct Cosmology *Cx, long line_type, size_t npoints_interp, double M_min, long mode_mf) |
| Allocate the memory and initialize the the line structure. More... | |
| int | Line_free (struct Line *Lx) |
| Free the line structure. More... | |
| int | Line_evaluate (struct Line *Lx, double *zz, double *res) |
| Allocate the memory and initialize the the line structure. More... | |
| double | mult_func (double sigma, long mode_mf) |
| Compute the multiplicity function needed to compute the halo mass function Three models are implemented: Press-Schechter, Sheth-Tormen and Tinker see Pillepich et al arxiv: 0811.4176 for the expressions. More... | |
| double | mass_func (struct Cosmology *Cx, double M, double z, long mode_mf) |
| Compute the halo mass function for Press-Schechter, Sheth-Tormen and Tinker models see Pillepich et al arxiv: 0811.4176 for the expressions. More... | |
| double | mass_func_sims (struct Cosmology *Cx, double M, double z, long mode_mf) |
| Read in the measured mass function of Hidden-valey sims and build an interpolator for HMF(M) for a fixed redshift. More... | |
| void | halo_bias (struct Cosmology *Cx, double M, double z, long mode_mf, double *bias_arr) |
| computes the halo biases for three mass functions, press-schecter, Sheth-Tormen, and Tinker mass functions More... | |
| void | logSFR_Behroozi_read (double *z_arr, double *logM_arr, double *log10SFR) |
| Read in the file for the star formation rate byy Behroozi et al 2013. More... | |
| int | logSFR_alloc_init () |
| Allocate memory and initialize the 2d interpolator for the star formation rate of Behroozi et al 2013 as a function of halo mass and redshift. More... | |
| int | SFR_Behroozi_free () |
| Free the memory allocated to the interpolators of star formation rate by Behroozi et al 2013. More... | |
| double | logSFR_Behroozi (double logM, double z) |
| Evaluate the SFR interpolator object for a given value of mass and redshift. More... | |
| double | luminosity (double M, double z, long mode_lum) |
| Compute the line specific luminosity in unit of solar luminosity For CO ladder, I am using the fits in Table 4 of Kamenetzky et al. More... | |
| int | mass_moment1_integ (unsigned nd, const double *x, void *p, unsigned fdim, double *fvalue) |
| The integrand function passed to hcubature integrator to compute the first moment of line luminosity. More... | |
| double | mass_moment1 (struct Cosmology *Cx, double z, double M_min, long mode_mf, long mode_lum) |
| Compute the first luminosity moment. More... | |
| int | mass_moment2_integ (unsigned nd, const double *x, void *p, unsigned fdim, double *fvalue) |
| The integrand function passed to hcubature integrator to compute the second moment of line luminosity. More... | |
| double | mass_moment2 (struct Cosmology *Cx, double z, double M_min, long mode_mf, long mode_lum) |
| Compute the second luminosity moment. More... | |
| int | bias_lum_weighted_integ (unsigned nd, const double *x, void *p, unsigned fdim, double *fvalue) |
| The integrand function passed to hcubature integrator to compute the un-normalized luminosity-weighted line bias. More... | |
| void | bias_lum_weighted (struct Cosmology *Cx, double z, double M_min, long mode_mf, long mode_lum, double *result) |
| Compute the luminosity-weighted linear and quadratic line biases. More... | |
| double | p_sig_shot_integrand (double x, void *par) |
| The integrand function passed to qags integrator to compute the scatter in shot ala Keating 2016. More... | |
| double | p_sig_shot (double scatter) |
| Compute the scatter in shot noise due to scatter in luminosity-halo mass relation, assume log-normal scatter ala Keating Note that we set f_duty =1 unlike other LIM paper (ex. More... | |
| double | p_sig_Tbar_integrand (double x, void *par) |
| The integrand function passed to qags integrator to compute the scatter in Tbar ala Keating 2016. More... | |
| double | p_sig_Tbar (double scatter) |
| Compute the scatter in Tbar due to scatter in luminosity-halo mass relation, assume log-normal scatter ala Keating Note that we set f_duty =1 unlike other LIM paper (ex. More... | |
| void | line_bias (struct Line *Lx, double z, double *result) |
| Compute the linear and quadratic line biases, accounting ffor the normalization w.r.t. More... | |
| double | mean_intens (struct Cosmology *Cx, size_t line_id, double z) |
| Compute the line mean intensity in unit of erg Mpc^-2 Sr^-1. More... | |
| double | Tbar_line (struct Cosmology *Cx, size_t line_id, double z) |
| Compute the mean brightness temprature of CO in unit of microK, compared with Pullen et al and Lidz et al 2011. More... | |
Documented line_ingredients module.
This module includes functions that are needed for computing the line clustering and shot contributions.
Azadeh Moradinezhad Dizgah, November 4th 2021
In summary, the following functions can be called from other modules:
| void bias_lum_weighted | ( | struct Cosmology * | Cx, |
| double | z, | ||
| double | M_min, | ||
| long | mode_mf, | ||
| long | mode_lum, | ||
| double * | result | ||
| ) |
Compute the luminosity-weighted linear and quadratic line biases.
The normalization of first mass moment is not included yet. The function bias_lum_weighted_integ() is the integrand and bias_lum_weighted() computes the bias
| Cx | Input: pointer to cosmology structure |
| z | Input: redshift |
| M_min | Input: minimum halo mass |
| mode_mf | Input: model of halo mass function to consider, PSC, ST, TR |
| mode_lum | Inpute: which luminosity model, basically which line considered |
| result | Input: an output array of linear and quadratic line biases |
In units of solar mass;
In units of solar mass


| int bias_lum_weighted_integ | ( | unsigned | nd, |
| const double * | x, | ||
| void * | p, | ||
| unsigned | fdim, | ||
| double * | fvalue | ||
| ) |
The integrand function passed to hcubature integrator to compute the un-normalized luminosity-weighted line bias.
| nd | Input: Dimensionality of the domain of integration |
| x | Input: integration variable |
| p | Input: integration parmaeters |
| fdim | Input: Dimensionality of the integrand function |
| fvalue | Input: Array of values of the integrand of dimension fdim return the error status |


| void halo_bias | ( | struct Cosmology * | Cx, |
| double | M, | ||
| double | z, | ||
| long | mode_mf, | ||
| double * | bias_arr | ||
| ) |
computes the halo biases for three mass functions, press-schecter, Sheth-Tormen, and Tinker mass functions
| Cx | Input: Cosmology structure |
| M | Input: halo mass |
| z | Input: redshift |
| mode_mf | Input: switch for setting the model of mass function, can be set to PSC, ST, TR |
| bias_arr | Output: the output array containning linear and quadratic local-in-matter halo biases, and quadratic and cubic tidal biases |
Note that for PSC and ST mass functions, same form of the biases can be assumed, with different coefficents. See astro-ph/0006319
Assuming spherical collapse


| struct Line * Line_alloc_init | ( | struct Cosmology * | Cx, |
| long | line_type, | ||
| size_t | npoints_interp, | ||
| double | M_min, | ||
| long | mode_mf | ||
| ) |
Allocate the memory and initialize the the line structure.
This structure contains interpolators for computing the luminosity-weighted mass moments and line biases For a given line defined with "line_type" variable, this function first computes the above four quantities for a wide range of redshifts. Next it iniialized 4 interpolators for these quantities, and store them in line structure.
| Cx | Input: Cosmology structure |
| line_type | Inpute: name of the line to compute. It can be set to CII, CO10, CO21, CO32, CO43, CO54, CO65 |
| npoints_interp | Input: number of interpolation points |
| M_min | Input: minimum halo mass for mass integrals |
| mode_mf | Inpute: theoretical model of halo mass function to use. It can be set to sheth-Tormen (ST), Tinker (TR) or Press-Schecter (PSC) |
CII


| void line_bias | ( | struct Line * | Lx, |
| double | z, | ||
| double * | result | ||
| ) |
Compute the linear and quadratic line biases, accounting ffor the normalization w.r.t.
the first mass moment
| Lx | Input: Pointer to line structure |
| z | Input: Redshift |
| result | Input: a pointer to an array containing the results of b1_line and b2_line |


| int Line_evaluate | ( | struct Line * | Lx, |
| double * | zz, | ||
| double * | res | ||
| ) |
Allocate the memory and initialize the the line structure.
This structure contains interpolators for computing the luminosity-weighted mass moments and line biases For a given line defined with "line_type" variable, this function first computes the above four quantities for a wide range of redshifts. Next it iniialized 4 interpolators for these quantities, and store them in line structure.
| Lx | Input: Pointer to the line structure |
| zz | Input: this is an array with 4 elements to determine which of the 4 interpolators should be evaluated.
|
| res | Output: an array containing the results. The number of elements of this array depends on how the zz array is set. |

| int Line_free | ( | struct Line * | Lx | ) |
Free the line structure.
| Lx | Input: Pointer to line structure |

| int logSFR_alloc_init | ( | ) |
Allocate memory and initialize the 2d interpolator for the star formation rate of Behroozi et al 2013 as a function of halo mass and redshift.


| double logSFR_Behroozi | ( | double | logM, |
| double | z | ||
| ) |
Evaluate the SFR interpolator object for a given value of mass and redshift.
| logM | Input: log10 of halo mass |
| z | Input: redshift |

| void logSFR_Behroozi_read | ( | double * | z_arr, |
| double * | logM_arr, | ||
| double * | log10SFR | ||
| ) |
Read in the file for the star formation rate byy Behroozi et al 2013.
| z_arr | Output: pointer to an array of redshifts read from the file |
| logM_arr | Output: pointer to an array of halo masses read from the file |
| log10SFR | Output: pointer to an array of SFR read from the file |


| double luminosity | ( | double | M, |
| double | z, | ||
| long | mode_lum | ||
| ) |
Compute the line specific luminosity in unit of solar luminosity For CO ladder, I am using the fits in Table 4 of Kamenetzky et al.
arXiv:1508.05102, while for CII we use Silva et al arXiv:1410.4808
| M | Input: halo mass |
| z | Input: redshift |
| mode_lum | Inpute: which luminosity model, basically which line considered |
a = 1.37 Charilli
b = -1.74
in unit of K km/s pc^2
in unit of L_sun


| double mass_func | ( | struct Cosmology * | Cx, |
| double | M, | ||
| double | z, | ||
| long | mode_mf | ||
| ) |
Compute the halo mass function for Press-Schechter, Sheth-Tormen and Tinker models see Pillepich et al arxiv: 0811.4176 for the expressions.
| Cx | Input: Cosmology structure |
| M | Input: Halo mass function |
| z | Input: redshift |
| mode_mf | Input: switch for setting the model of mass function, can be set to PSC, ST, TR |


| double mass_func_sims | ( | struct Cosmology * | Cx, |
| double | M, | ||
| double | z, | ||
| long | mode_mf | ||
| ) |
Read in the measured mass function of Hidden-valey sims and build an interpolator for HMF(M) for a fixed redshift.
| Cx | Input: Cosmology structure |
| M | Input: halo mass |
| z | Input: redshift |
| mode_mf | Input: switch for setting the model of mass function, can be set to PSC, ST, TR |
not to be used at z other than 2. This function is for testing purposes only. We test the theoretical predictions at z=2 if ST MF or measured MF are used.

| double mass_moment1 | ( | struct Cosmology * | Cx, |
| double | z, | ||
| double | M_min, | ||
| long | mode_mf, | ||
| long | mode_lum | ||
| ) |
Compute the first luminosity moment.
| Cx | Input: pointer to cosmology structure |
| z | Input: redshift |
| M_min | Input: minimum halo mass |
| mode_mf | Input: model of halo mass function to consider, PSC, ST, TR |
| mode_lum | Inpute: which luminosity model, basically which line considered |
In units of solar mass;
In units of solar mass


| int mass_moment1_integ | ( | unsigned | nd, |
| const double * | x, | ||
| void * | p, | ||
| unsigned | fdim, | ||
| double * | fvalue | ||
| ) |
The integrand function passed to hcubature integrator to compute the first moment of line luminosity.
| nd | Input: Dimensionality of the domain of integration |
| x | Input: integration variable |
| p | Input: integration parmaeters |
| fdim | Input: Dimensionality of the integrand function |
| fvalue | Input: Array of values of the integrand of dimension fdim return the error status |


| double mass_moment2 | ( | struct Cosmology * | Cx, |
| double | z, | ||
| double | M_min, | ||
| long | mode_mf, | ||
| long | mode_lum | ||
| ) |
Compute the second luminosity moment.
| Cx | Input: pointer to cosmology structure |
| z | Input: redshift |
| M_min | Input: minimum halo mass |
| mode_mf | Input: model of halo mass function to consider, PSC, ST, TR |
| mode_lum | Inpute: which luminosity model, basically which line considered |
In units of solar mass;
In units of solar mass


| int mass_moment2_integ | ( | unsigned | nd, |
| const double * | x, | ||
| void * | p, | ||
| unsigned | fdim, | ||
| double * | fvalue | ||
| ) |
The integrand function passed to hcubature integrator to compute the second moment of line luminosity.
| nd | Input: Dimensionality of the domain of integration |
| x | Input: integration variable |
| p | Input: integration parmaeters |
| fdim | Input: Dimensionality of the integrand function |
| fvalue | Input: Array of values of the integrand of dimension fdim return the error status |


| double mean_intens | ( | struct Cosmology * | Cx, |
| size_t | line_id, | ||
| double | z | ||
| ) |
Compute the line mean intensity in unit of erg Mpc^-2 Sr^-1.
| Cx | Input: Pointer to cosmology structure |
| line_id | Inpute: id of line of interest, an integer value |
| z | Input: Redshift |
Note: nu_J is the rest-frame emission frequency related to the observed frequency as nu_obs = nu_J/(1+z_J) For a CO transition from J-> J-1, the rest-frame frequency is nu_J = J nu_CO where nu_Co = 115 GHz.
in unit of erg/s


| double mult_func | ( | double | sigma, |
| long | mode_mf | ||
| ) |
Compute the multiplicity function needed to compute the halo mass function Three models are implemented: Press-Schechter, Sheth-Tormen and Tinker see Pillepich et al arxiv: 0811.4176 for the expressions.
| sigma | Input: variance of matter fluctuations |
| mode_mf | Input: switch for setting the model of mass function, can be set to PSC, ST, TR |
In Barkana & Loeb Rev a = 0.75

| double p_sig_shot | ( | double | scatter | ) |
Compute the scatter in shot noise due to scatter in luminosity-halo mass relation, assume log-normal scatter ala Keating Note that we set f_duty =1 unlike other LIM paper (ex.
Lidz et al 2011).
| scatter | Input: variance of the log-scatter |


| double p_sig_shot_integrand | ( | double | x, |
| void * | par | ||
| ) |
The integrand function passed to qags integrator to compute the scatter in shot ala Keating 2016.
| x | Input: integration variable |
| par | Input: integration parmaeters |

| double p_sig_Tbar | ( | double | scatter | ) |
Compute the scatter in Tbar due to scatter in luminosity-halo mass relation, assume log-normal scatter ala Keating Note that we set f_duty =1 unlike other LIM paper (ex.
Lidz et al 2011).
| scatter | Input: variance of the log-scatter |


| double p_sig_Tbar_integrand | ( | double | x, |
| void * | par | ||
| ) |
The integrand function passed to qags integrator to compute the scatter in Tbar ala Keating 2016.
| x | Input: integration variable |
| par | Input: integration parmaeters |

| int SFR_Behroozi_free | ( | ) |
Free the memory allocated to the interpolators of star formation rate by Behroozi et al 2013.

| double Tbar_line | ( | struct Cosmology * | Cx, |
| size_t | line_id, | ||
| double | z | ||
| ) |
Compute the mean brightness temprature of CO in unit of microK, compared with Pullen et al and Lidz et al 2011.
| Cx | Input: Pointer to cosmology structure |
| line_id | Inpute: id of line of interest, an integer value |
| z | Input: Redshift |
Boltzmann constant in unit of erg K^-1
factor of 10^6 is the conversion factor from K to microK

