hmpdf
One- and two-point PDFs within the halo model.
hmpdf_configs.h File Reference

Typedefs

typedef double(* hmpdf_ell_filter_f) (double, void *)
 
typedef double(* hmpdf_k_filter_f) (double, double, void *)
 
typedef double(* hmpdf_massfunc_corr_f) (double, double, void *)
 
typedef double(* hmpdf_mass_resc_f) (double, double, void *)
 
typedef double(* hmpdf_conc_resc_f) (double, double, void *)
 
typedef double(* hmpdf_mass_cuts_f) (double, void *)
 
typedef double(* hmpdf_noise_pwr_f) (double, void *)
 
typedef double(* hmpdf_bias_resc_f) (double, double, void *)
 
typedef double(* hmpdf_dndz_f) (double, void *)
 

Enumerations

enum  hmpdf_mdef_e { hmpdf_mdef_c, hmpdf_mdef_v, hmpdf_mdef_m }
 
enum  hmpdf_signaltype_e { hmpdf_kappa, hmpdf_tsz }
 
enum  hmpdf_integr_mode_e {
  hmpdf_legendre, hmpdf_chebyshev, hmpdf_gegenbauer, hmpdf_jacobi,
  hmpdf_laguerre, hmpdf_hermite, hmpdf_exponential, hmpdf_rational,
  hmpdf_chebyshev2
}
 
enum  hmpdf_Arico20_params_e {
  hmpdf_Arico20_M_c, hmpdf_Arico20_M_1_z0_cen, hmpdf_Arico20_eta, hmpdf_Arico20_beta,
  hmpdf_Arico20_Nparams
}
 
enum  hmpdf_configs_e {
  hmpdf_N_threads, hmpdf_verbosity, hmpdf_warn_is_err, hmpdf_class_pre,
  hmpdf_N_z, hmpdf_z_min, hmpdf_z_max, hmpdf_dndz,
  hmpdf_dndz_params, hmpdf_N_M, hmpdf_M_min, hmpdf_M_max,
  hmpdf_N_signal, hmpdf_signal_min, hmpdf_signal_max, hmpdf_N_theta,
  hmpdf_rout_scale, hmpdf_rout_rdef, hmpdf_pixel_side, hmpdf_tophat_radius,
  hmpdf_gaussian_fwhm, hmpdf_custom_ell_filter, hmpdf_custom_ell_filter_params, hmpdf_custom_k_filter,
  hmpdf_custom_k_filter_params, hmpdf_massfunc_corr, hmpdf_massfunc_corr_params, hmpdf_mass_resc,
  hmpdf_mass_resc_params, hmpdf_conc_resc, hmpdf_conc_resc_params, hmpdf_mass_cuts,
  hmpdf_mass_cuts_params, hmpdf_bias_resc, hmpdf_bias_resc_params, hmpdf_Arico20_Nz,
  hmpdf_Arico20_z, hmpdf_Arico20_params, hmpdf_profiles_N, hmpdf_profiles_fnames ,
  hmpdf_profiles_Nr, hmpdf_profiles_r, hmpdf_DM_conc_params, hmpdf_bar_conc_params,
  hmpdf_N_phi, hmpdf_phi_max, hmpdf_pixelexact_max, hmpdf_phi_jitter,
  hmpdf_phi_pwr, hmpdf_zintegr_type, hmpdf_zintegr_alpha, hmpdf_zintegr_beta,
  hmpdf_Mintegr_type, hmpdf_Mintegr_alpha, hmpdf_Mintegr_beta, hmpdf_Duffy08_conc_params,
  hmpdf_Tinker10_hmf_params, hmpdf_Battaglia12_tsz_params, hmpdf_noise_pwr, hmpdf_noise_pwr_params,
  hmpdf_map_fsky, hmpdf_map_pixelgrid, hmpdf_map_poisson , hmpdf_end_configs
}
 

Typedef Documentation

◆ hmpdf_ell_filter_f

typedef double(* hmpdf_ell_filter_f) (double, void *)

Function pointer typedef for user-defined ell-space filter. Passed to hmpdf_init() as hmpdf_custom_ell_filter.

Parameters
ellangular wavenumber
ppointer that allows user to pass other parameters. Passed to hmpdf_init() as hmpdf_custom_ell_filter_params.
Returns
W(ell) window function at ell

◆ hmpdf_k_filter_f

typedef double(* hmpdf_k_filter_f) (double, double, void *)

Function pointer typedef for user-defined k-space filter. Passed to hmpdf_init() as hmpdf_custom_k_filter.

Parameters
kcomoving wavenumber in 1/Mpc
zredshift
ppointer that allows user to pass other parameters. Passed to hmpdf_init() as hmpdf_custom_k_filter_params.
Returns
W(k,z) window function at k and z

◆ hmpdf_massfunc_corr_f

typedef double(* hmpdf_massfunc_corr_f) (double, double, void *)

Function pointer typedef for user-defined mass function rescaling. Passed to hmpdf_init() as hmpdf_massfunc_corr.

Parameters
zredshift
Mhalo mass (M200m, Msun/h)
ppointer for additional parameters
Returns
hmf_new / hmf_Tinker at z and M

◆ hmpdf_mass_resc_f

typedef double(* hmpdf_mass_resc_f) (double, double, void *)

Function pointer typedef for user-defined mass rescaling. Passed to hmpdf_init() as hmpdf_mass_resc.

Parameters
zredshift
Mhalo mass (M200m, Msun/h)
ppointer for additional parameters
Returns
M_new / M_old

◆ hmpdf_conc_resc_f

typedef double(* hmpdf_conc_resc_f) (double, double, void *)

Function pointer typedef for user-defined concentration rescaling. Passed to hmpdf_init() as hmpdf_conc_resc.

Parameters
zredshift
Mhalo mass (M200m, Msun/h)
ppointer for additional parameters
Returns
c_new / c_old

◆ hmpdf_mass_cuts_f

typedef double(* hmpdf_mass_cuts_f) (double, void *)

Function pointer typedef to pass redshift-dependent upper limit in mass. Passed to hmpdf_init() as hmpdf_mass_cuts.

Parameters
zredshift
ppointer for additional parameters
Returns
upper mass limit (M200m, Msun/h)

◆ hmpdf_noise_pwr_f

typedef double(* hmpdf_noise_pwr_f) (double, void *)

Function pointer typedef for user-defined noise power spectrum. Passed to hmpdf_init() as hmpdf_noise_pwr.

Parameters
ellangular wavenumber
ppointer that allows user to pass other parameters. Passed to hmpdf_init() as hmpdf_noise_pwr_params.
Returns
N(ell) noise power at ell.

◆ hmpdf_bias_resc_f

typedef double(* hmpdf_bias_resc_f) (double, double, void *)

Function pointer typedef for user-defined bias rescaling. Passed to hmpdf_init() as hmpdf_bias_resc.

Parameters
zredshift
Mhalo mass (M200m, Msun/h)
ppointer for additional parameters
Returns
rescaling of the halo bias

◆ hmpdf_dndz_f

typedef double(* hmpdf_dndz_f) (double, void *)

Function pointer typedef for user-defined source redshift distribution. Passed to hmpdf_iniit() as hmpdf_dndz.

Parameters
zredshift
ppointer for additional parameters
Returns
dn/dz, the source redshift distribution

Enumeration Type Documentation

◆ hmpdf_mdef_e

Halo mass definitions.

Presently only used to specify in terms of which definition the radial cut-off of the halo profiles is given.

Enumerator
hmpdf_mdef_c 

M200c (200x critial density)

hmpdf_mdef_v 

Mvir (virial mass according to Bryan+Norman 1998)

hmpdf_mdef_m 

M200m (200x mean matter density)

◆ hmpdf_signaltype_e

Signal types.

To specify which cosmological field the PDF should be computed for.

Enumerator
hmpdf_kappa 

weak lensing convergence

hmpdf_tsz 

tSZ effect (Compton-y)

◆ hmpdf_integr_mode_e

Fixed point integration modes.

The integrals over halo mass and redshift are performed using fixed point quadratures, with modes taken from this enum. See the GSL documentation for details.

Attention
Some of these integration modes are for infinite intervals and do not make sense for our application.
Enumerator
hmpdf_legendre 
hmpdf_chebyshev 
hmpdf_gegenbauer 
hmpdf_jacobi 
hmpdf_laguerre 
hmpdf_hermite 
hmpdf_exponential 
hmpdf_rational 
hmpdf_chebyshev2 

◆ hmpdf_Arico20_params_e

Ordering of the Arico+2020 parameters for the BCM

Enumerator
hmpdf_Arico20_M_c 
hmpdf_Arico20_M_1_z0_cen 
hmpdf_Arico20_eta 
hmpdf_Arico20_beta 
hmpdf_Arico20_Nparams 

. Internal use only.

◆ hmpdf_configs_e

Options to hmpdf_init().

The variadic argument list in hmpdf_init() can be used to pass non-default options. [syntax is explained in the documentation for hmpdf_init()].

There is a large number of options, many of which the typical user will not need to use. Here is a brief synopsis:

Frequently used options:

Less frequently used options:

Integration grids:

Covariance matrix calculation:

Enumerator
hmpdf_N_threads 

number of threads to use in multithreaded parts of the code.

Type: int. Default: 1.
Remarks
only applicable if code compiled with OpenMP.
this does not control the multithreading behaviour of CLASS
hmpdf_verbosity 

larger values yield more detailed print output. If 0 (default), only error messages are printed.

Type: int. Default: 0.
hmpdf_warn_is_err 

Controls the behaviour when a warning is encountered. Positive values will treat warnings as error and return, zero value will continue execution but print a message to stderr, and negative values will ignore the warning.

Type: int. Default: 1.
hmpdf_class_pre 

optional CLASS precision file.

Type: char *. Default: None (use CLASS's default precision settings).
hmpdf_N_z 

number of sample points in redshift integration.

Type: int. Default: 65.
Remarks
the default value is conservative. By playing with the hmpdf_zintegr_type (as well as hmpdf_zintegr_alpha and hmpdf_zintegr_beta) you can gain some speed here.
hmpdf_z_min 

minimum redshift.

Type: double. Default: 0.
Remarks
non-zero values do not make much sense
hmpdf_z_max 

maximum redshift.

Type: double. Default: 6 for tSZ, source redshift for weak lensing.
hmpdf_dndz 

source redshift distribution for hmpdf_kappa. If set to null (default), a delta distribution is assumed at source redshift. Otherwise, source redshift should be chosen such that the source distribution is essentially zero for larger redshifts.

Type: hmpdf_dndz_f. Default: None.
Remarks
it is not assumed that the distribution is normalized, the code will do this automatically.
hmpdf_dndz_params 

additional parameters to pass to hmpdf_dndz.

Type: void *. Default: None.
hmpdf_N_M 

number of sample points in halo mass integration.

Type: int. Default: 65.
Remarks
the default value is conservative. By playing with the hmpdf_Mintegr_type (as well as hmpdf_Mintegr_alpha and hmpdf_Mintegr_beta) you can gain some speed here.
hmpdf_M_min 

minimum halo mass, in M200m definition and Msun units.

Type: double. Default: 1e11.
hmpdf_M_max 

maximum halo mass, in M200m definition and Msun units.

Type: double. Default: 1e16.
hmpdf_N_signal 

number of points on which the one-point PDF is sampled internally

Type: long. Default: 1024.
Remarks
two-point PDF will be sampled on the square of this.
Should be chosen as a power of 2 for optimal speed.
Warning
Setting this to large values can trigger numerical instability in small-phi two-point PDF, and covariance matrix computations.
Attention
This is the only instance of an expected long.
hmpdf_signal_min 

minimum signal value at which PDF is sampled internally.

Type: double. Default: 0.
Remarks
The PDF should be well converged to zero for smaller signal values.
If your signal is only positive (this is quite often true, as long as you are not applying any special ell- or k-space filters) you should set this to zero.
Note
This is in the internal units, in which negative WL convergence regions do not exist. Read the paper for a discussion.
hmpdf_signal_max 

maximum signal value at which PDF is sampled internally.

Type: double. Default: 2e-4 (tSZ), 1 (weak lensing).
Remarks
Should be chosen such that PDF is well converged to zero to avoid ringing.
Should be at least 2x larger than maximum signal value you are interested in.
For weak lensing, you should change this option depending on source redshift.
Note
This is in the internal units, in which negative WL convergence regions do not exist. Read the paper for a discussion.
hmpdf_N_theta 

number of points on which the signal profiles are sampled.

Type: int. Default: 500.
Remarks
reasonable precision can be reached with as few as 100 sample points. Runtime of hmpdf_init() is in many cases quite dominated by this setting.
hmpdf_rout_scale 

radial cut-off.

Type: double. Default: 2.
hmpdf_rout_rdef 

mass/radius definition in terms of which the radial cut-off is specified.

Type: hmpdf_mdef_e. Default: hmpdf_mdef_v (virial radius).
hmpdf_pixel_side 

pixel sidelength, in arcmin.

Type: double. Default: None.
Remarks
required setting for covariance matrix calculation.
negative values have no effect (but will not trigger a warning).
Warning
PDFs computed with more than 5 arcmin in this setting should be treated with caution.
hmpdf_tophat_radius 

includes the effect of smoothing the map with a tophat of given radius (in arcmin).

Type: double. Default: None.
Remarks
negative values have no effect (but will not trigger a warning).
Warning
PDFs computed with more than 5 arcmin in this setting should be treated with caution.
hmpdf_gaussian_fwhm 

includes the effect of smoothing the map with a Gaussian of given FWHM (in arcmin).

Type: double. Default: None.
Remarks
negative values have no effect (but will not trigger a warning).
Warning
PDFs computed with more than 5 arcmin in this setting should be treated with caution.
hmpdf_custom_ell_filter 

pass a user-defined ell-space filter (for example, to include effect of a Wiener filter). Signature of this function pointer has to conform to the typedef hmpdf_ell_filter_f.

Type: hmpdf_ell_filter_f. Default: None.
hmpdf_custom_ell_filter_params 

pass parameters to the ell-space filter (as its last argument).

Type: void *. Default: None.
Attention
not supported in the python wrapper.
hmpdf_custom_k_filter 

pass a user-defined k-space filter, with possible redshift-dependence (for example, to emulate small-scale simulation resolution issues). Signature of this function pointer has to conform to the typedef hmpdf_k_filter_f.

Type: hmpdf_k_filter_f. Default: None.
hmpdf_custom_k_filter_params 

pass parameters to the k-space filter (as its last argument).

Type: void *. Default: None.
Attention
not supported in the python wrapper.
hmpdf_massfunc_corr 

Correction prefactor for the Tinker mass function.

Type: hmpdf_massfunc_corr_f. Default: None.
hmpdf_massfunc_corr_params 

Additional parameters to pass to the above function.

Type: void *. Default: None.
hmpdf_mass_resc 

Rescaling function for halo masses going into the profiles (masses going into mass function and bias are not affected).

Type: hmpdf_mass_resc_f. Default: None.
hmpdf_mass_resc_params 

Additional parameters to pass to the above function.

Type: void *. Default: None.
hmpdf_conc_resc 

Rescaling function for concentration.

Type: hmpdf_conc_resc_f. Default: None.
hmpdf_conc_resc_params 

Additional parameters to pass to the above function.

Type: void *. Default: None.
hmpdf_mass_cuts 

Redshift-dependent upper mass limits.

Type: hmpdf_mass_cuts_f. Default: None.
hmpdf_mass_cuts_params 

Additional parameters to pass to the above function.

Type: void *. Default: None.
hmpdf_bias_resc 

Rescaling function for bias.

Type: hmpdf_bias_resc_f. Default: None.
hmpdf_bias_resc_params 

Additional parameters to pass to the above function.

Type: void *. Default: None.
hmpdf_Arico20_Nz 

The number of parameter samples (in redshift) for the BCM. The code interpolates in redshift between the ones that are given.

Type: int. Default: 1.
hmpdf_Arico20_z 

The redshifts where the parameter values are given. Must be in increasing order. Does not need to be passed if Nz==1.

Type: double *. Default: None.
hmpdf_Arico20_params 

The parameters for the Arico+2020 BCM. If passed, the convergence profiles will be computed using the BCM. Only applicable if computing the kappa PDF. The ordering is specified by hmpdf_Arico20_params_e. Each redshift corresponds to a contiguous block in the array.

Type: double *. Default: None.
hmpdf_profiles_N 

Number of profiles to write to file. This is a hack for that only works with the BCM. Will print the component density profiles to disk.

Type: int. Default: 0.
hmpdf_profiles_fnames 

The file names the profiles should be printed to.

Type: char **. Default: None.
hmpdf_profiles_Nr 

The redshifts and masses for which to evaluate profiles. In the order [z0, M0, z1, M1, z2, M2, ... ] Masses in units of M200m, Msun/h.

Type: double *. Default: None.
hmpdf_profiles_r 

Number of radii where to evaluate profiles.

Type: int. Default: 0.
hmpdf_DM_conc_params 

The radii for which to evaluate profiles. In units of R200c.

Type: double *. Default: None.
hmpdf_bar_conc_params 

The concentration parameters for the DM component. If passed, also those for the baryonic component must be given. Same format as hmpdf_Duffy08_conc_params. The parameterization is in terms of the hydro mass.

Type: double *. Default: None.
hmpdf_N_phi 

The concentration parameters for the baryonic component. If passed, also those for the DM component must be given. Same format as hmpdf_Duffy08_conc_params. The parameterization is in terms of the hydro mass.

Type: double *. Default: None. Number of pixel-separation sample points in covariance matrix calculation.
Type: int. Default: 1000.
Remarks
as long as no numerical instability at small pixel separations is encountered, the default value is conservative. In that case, if you want to decrease run-time, it is recommended you decrease this value to a few hundred, and decrease hmpdf_pixelexact_max as well.
if, however, numerical instability is encountered, results can get more accurate by increasing this value.
hmpdf_phi_max 

maximum pixel separation in covariance matrix calculation (in arcmin).

Type: double. Default: 150.
Remarks
should be set to approximately the largest halo radius on the sky.
hmpdf_pixelexact_max 

up to which pixel separation (in units of pixel sidelength) the summation is performed exactly (integration afterwards).

Type: int. Default: 20.
Remarks
the default value is conservative, can be decreased to 10 without losing much accuracy.
hmpdf_phi_jitter 

technical (for covariance matrix). For numerical stability, at small pixel separations an average is used, around the desired pixel separation. This option sets how wide (in phi) the averaging is done.

Type: double. Default: 0.02.
hmpdf_phi_pwr 

technical (for covariance matrix). Increasing this number increases the sample points at small pixel separation.

Type: double. Default: 2.
Remarks
If you encounter numerical instability (e.g., wild covariance matrix entries), increasing this number can potentially be helpful.
hmpdf_zintegr_type 

Fixed point integration mode for redshift integration.

Type: hmpdf_integr_mode_e. Default: hmpdf_legendre.
hmpdf_zintegr_alpha 

Fixed point integration alpha for redshift integration

Type: double. Default: 0.
hmpdf_zintegr_beta 

Fixed point integration beta for redshift integration.

Type: double. Default: 0.
hmpdf_Mintegr_type 

Fixed point integration mode for halo mass integration.

Type: hmpdf_integr_mode_e. Default: hmpdf_legendre.
hmpdf_Mintegr_alpha 

Fixed point integration alpha for halo mass integration.

Type: double. Default: 0.
hmpdf_Mintegr_beta 

Fixed point integration beta for halo mass integration.

Type: double. Default: 0.
hmpdf_Duffy08_conc_params 

Fit parameters in the Duffy+2008 concentration model. Still relevant even if hmpdf_DM_conc_params and hmpdf_bar_conc_params are passed (then it is used for mass conversions).

Type: double *. Default: see src/configs.c.
Remarks
in the python wrapper, pass a 1d numpy array
hmpdf_Tinker10_hmf_params 

Fit parameters in the Tinker+2010 halo mass function.

Type: double[10]. Default: see src/configs.c.
Remarks
in the python wrapper, pass a 1d numpy array
hmpdf_Battaglia12_tsz_params 

Fit parameters in the Battaglia+2012 pressure profile model.

Type: double[15]. Default: see src/configs.c.
Remarks
in the python wrapper, pass a 1d numpy array
hmpdf_noise_pwr 

Option to add pixel-wise Gaussian noise with this power spectrum.

Type: hmpdf_noise_pwr_f. Default: None.
hmpdf_noise_pwr_params 

To pass custom parameters to the function hmpdf_noise_pwr.

Type: void *. Default: None.
hmpdf_map_fsky 

If you want to use the stochastic map-mapmaking algorithm (simplified simulations), this is a required setting. It is the sky fraction spanned by the map.

Type: double. Default: None.
hmpdf_map_pixelgrid 

Increasing this value yields a more accurate averaging of the signal profiles in each pixel.

Type: int. Default: 3.
hmpdf_map_poisson 

If set to zero, the number of halos will not be drawn from the Poisson distribution but rather from a much more concentrated one. In that case, the mean (i.e. the averaged one-point PDF) is correctly and much faster approached, while the scatter of individual histograms will not be correct.

Type: int. Default: 1.
hmpdf_end_configs 

If this option is set, the resulting simplified simulations (maps) will have this random seed. This means that, given equal map dimensions, the maps will have all halos in identical positions.

Type: int. Default: None. required last argument in hmpdf_init_fct(), the convenience macro hmpdf_init() takes care of that.