Estimate one point functions in MultiDark

This class supports measuring one point functions

lib_functions_1pt.b_BH(sigma, a, p, q)

M200c ftT08 = f_T08(sigma, 0.186, 1.47, 2.57, 1.19) ftSk14 = f_T08(sigma, 0.18587, 1.46690, 2.57110, 1.19396) ftK16 = f_T08(sigma, 0.224, 1.67, 1.80, 1.48) ftA12 = f_T08 (sigma, 0.201, 1.7, 2.08, 1.172) ftW13 = f_T08 (sigma, 0.282, 2.163, 1.406, 1.21) ftST01 = f_ST(sigma, 0.3222, 0.707, 0.3) #ftD16 = f_dsp(sigma, 0.287, 0.903, 0.322 ) ftC16 = f_T08(sigma, 0.12, 1.19, 3.98, 1.35) ftC16st = f_dsp(sigma, 0.2906, 0.8962, 0.1935 )

lib_functions_1pt.convert_pkl_mass(fileC, fileS, binFile, qty='mvir', delta_wrt='mean')[source]

Creates a fits file with each measurements made. It linksglobal parameters to the HMF values. :param qty: one point function variable.Default: mvir. :param fileC: file with the central halo statistics :param fileS: file with the satelitte halo statistics :param binFile: file with the bins :return: a fits table containing the one point function histograms

lib_functions_1pt.convert_pkl_massFunction_covarianceMatrix(fileC, binFile, qty='mvir', delta_wrt='mean')[source]

Return a mass function covariance matrix :param qty: one point function variable.Default: mvir. :param file: file with the central halo statistics :param binFile: file with the bins :return: a fits table containing the one point function histograms

lib_functions_1pt.convert_pkl_velocity(fileC, fileS, binFile, qty='vmax')[source]
Parameters:
  • qty – one point function variable. Default vmax.
  • fileC – file with the central halo statistics
  • fileS – file with the satelitte halo statistics
  • binFile – file with the bins
  • zList_files – list of file with linking snapshot number and redshift
Returns:

a fits table containing the one point function histograms

lib_functions_1pt.fit_mvir_function_z0(data, x_data, y_data, y_err, p0, tolerance=0.03, cos='cen', dir='/home/comparat/data/MultiDark')[source]

Fits a function to the mvir data :param data: data table of the selected points for the fit :param x_data: x coordinate :param y_data: y coordinate :param y_err: error :param p0: first guess :param tolerance: percentage error tolerance to compute how many points are outside of the fit :param cos: central or satelitte :param mode: fitting mode, “curve_fit” or “minimize” :param dir: working dir :param qty: mvir here :return: result of the fit: best parameter array and covariance matrix produces a plot of the residuals

lib_functions_1pt.fit_mvir_function_zTrend(data, x_data, y_data, z_data, y_err, ps0=[0.0, 0.0, 0.0], tolerance=0.03, cos='cen', mode='curve_fit', dir='/home/comparat/data/MultiDark', zmin=0, zmax=2.5)[source]

Fits a function to the mvir data :param data: data table of the selected points for the fit :param x_data: x coordinate :param y_data: y coordinate :param z_data: redshift coordinate :param y_err: error :param ps0: first guess :param tolerance: percentage error tolerance to compute how many points are outside of the fit :param cos: central or satelitte :param mode: fitting mode, “curve_fit” or “minimize” :param dir: working dir :param qty: mvir here :return: result of the fit: best parameter array and covariance matrix produces a plot of the residuals

lib_functions_1pt.fit_vmax_function_z0(data, x_data, y_data, y_err, p0, tolerance=0.03, cos='cen', mode='curve_fit', dir='/home/comparat/data/MultiDark', suffix='0')[source]

Fits a function to the vmax data :param data: data table of the selected points for the fit :param x_data: x coordinate :param y_data: y coordinate :param y_err: error :param p0: first guess :param tolerance: percentage error tolerance to compute how many points are outside of the fit :param cos: central or satelitte :param mode: fitting mode, “curve_fit” or “minimize” :param dir: working dir :param qty: vmax here :return: result of the fit: best parameter array and covariance matrix produces a plot of the residuals

lib_functions_1pt.getStat(file, volume, unitVolume)[source]

From the pickle file output by the Multidark class, we output the number counts (differential and cumulative) per unit volume per mass bin. :param file: filename :param volume: total volume of the box :param unitVolume: sub volume used in the jackknife :return: Number counts, cumulative number counts, count density, cumulative count density, jackknife mean, jackknife std, cumulative jackknife mean, cumulative jackknife std

lib_functions_1pt.get_basic_info(fileC, boxZN, delta_wrt='mean')[source]

For a HMF measurement, this function returns all the basic information about the simulation used: - a HMF model with the corrected sigma8 value: hf, - size of the box: boxLength, boxLengthComoving - name of the simulation used later when writing results boxName - the redshiftof the measured HMF: boxRedshift, 7 - the logmass of one particle: logmp, - correction to the mass measured due to force resolution: massCorrection

lib_functions_1pt.get_hf(sigma_val=0.8228, boxRedshift=0.0, delta_wrt='mean')[source]

Halo mass function model for the MultiDark simulation.

lib_functions_1pt.get_hf_ds(sigma_val=0.8355, boxRedshift=0.0, delta_wrt='mean')[source]

Halo mass function model for the Darkskies simulation.

lib_functions_1pt.plot_jackknife_poisson_error(x, y, MD04, MD10, MD25, MD25NW, MD40, MD40NW, DS80, cos='cen', dir='/home/comparat/data/MultiDark')[source]
Parameters:
  • x – x coordinates
  • y – y coordinates
  • cos – centra or satelitte. Default: “cen”
  • dir – working directory. :param qty: quantity studied. Default: ‘vmax’
lib_functions_1pt.plot_mvir_function_data(log_mvir, logsigM1, logNu, log_MF, log_MF_c, redshift, zmin, zmax, cos='cen', figName='', dir='/home/comparat/data/MultiDark')[source]
Parameters:
  • log_mvir – x coordinates
  • log_VF – y coordinates
  • redshift – color coordinate
  • zmin – minimum redshift
  • zmax – maximum redshift
  • cos – centra or satelitte. Default: “cen”
  • figName – string to be added to the figure name. Default:=”“
  • dir – working directory. :param qty: quantity studied. Default: ‘mvir’
lib_functions_1pt.plot_mvir_function_data_error(log_mvir, error, redshift, label, zmin, zmax, cos='cen', figName='mvir-cen-data04-uncertainty.png', dir='/home/comparat/data/MultiDark')[source]
Parameters:
  • log_mvir – x coordinates
  • error – y coordinates
  • redshift – color coordinate
  • label – label in the caption
  • zmin – minimum redshift
  • zmax – maximum redshift
  • cos – centra or satelitte. Default: “cen”
  • figName – string to be added to the figure name. Default:=”“
  • dir – working directory. :param qty: quantity studied. Default: ‘mvir’
lib_functions_1pt.plot_mvir_function_data_perBox(log_mvir, log_VF, MD04, MD10, MD25, MD25NW, MD40, MD40NW, cos='cen', figName='', dir='/home/comparat/data/MultiDark')[source]
Parameters:
  • log_mvir – x coordinates
  • log_VF – y coordinates
  • cos – centra or satelitte. Default: “cen”
  • figName – string to be added to the figure name. Default:=”“
  • dir – working directory.
  • qty – quantity studied. Default: ‘mvir’
lib_functions_1pt.plot_mvir_function_jackknife_poisson_error(x, y, MD04, MD10, MD25, MD25NW, MD40, MD40NW, cos='cen', dir='/home/comparat/data/MultiDark')[source]
Parameters:
  • x – x coordinates
  • y – y coordinates
  • cos – centra or satelitte. Default: “cen”
  • dir – working directory.
  • qty – quantity studied. Default: ‘mvir’
lib_functions_1pt.plot_vmax_function_data(log_vmax, log_VF, log_VF_c, redshift, zmin, zmax, cos='cen', figName='', dir='/home/comparat/data/MultiDark')[source]
Parameters:
  • log_vmax – x coordinates
  • log_VF – y coordinates
  • redshift – color coordinate
  • zmin – minimum redshift
  • zmax – maximum redshift
  • cos – centra or satelitte. Default: “cen”
  • figName – string to be added to the figure name. Default:=”“
  • dir – working directory. :param qty: quantity studied. Default: ‘vmax’
lib_functions_1pt.plot_vmax_function_data_error(log_vmax, error, redshift, label, zmin, zmax, cos='cen', figName='vmax-cen-data04-uncertainty.png', dir='/home/comparat/data/MultiDark')[source]
Parameters:
  • log_vmax – x coordinates
  • error – y coordinates
  • redshift – color coordinate
  • label – label in the caption
  • zmin – minimum redshift
  • zmax – maximum redshift
  • cos – centra or satelitte. Default: “cen”
  • figName – string to be added to the figure name. Default:=”“
  • dir – working directory. :param qty: quantity studied. Default: ‘vmax’
lib_functions_1pt.plot_vmax_function_data_perBox(log_vmax, log_VF, log_VF_c, MD04, MD10, MD25, MD25NW, MD40, MD40NW, cos='cen', figName='', dir='/home/comparat/data/MultiDark')[source]
Parameters:
  • log_vmax – x coordinates
  • log_VF – y coordinates
  • cos – centra or satelitte. Default: “cen”
  • figName – string to be added to the figure name. Default:=”“
  • dir – working directory. :param qty: quantity studied. Default: ‘vmax’
lib_functions_1pt.vf_ps(v, ps)

# sheth and tormen function fnu_ST = lambda nu, A, a, p: A * (2./n.pi)**(0.5) * (a*nu) * ( 1 + (a * nu) **(-2.*p) ) * n.e**( -( a * nu )**2. / 2.) log_fnu_ST = lambda logNu, Anorm, a, q : n.log10( fnu_ST(10.**logNu, Anorm, a, q) ) log_fnu_ST_ps = lambda logNu, ps : n.log10( fnu_ST(10.**logNu, ps[0], ps[1], ps[2]) )

p_ST_despali = [0.333, 0.794, 0.247] p_ST_sheth = [0.3222, 0.707, 0.3] p_T08_klypin = [0.224, 1.67, 1.80, 1.48] p_T08_RP = [0.144, 1.351, 3.113, 1.187]

# tinker function fsigma_T08 = lambda sigma, A, a, b, c : A *(1+ (b/sigma)**a) * n.e**(-c/sigma**2.) log_fsigma_T08 = lambda logsigma, A, a, b, c : n.log10(A *(1+ (b/(10**logsigma))**a) * n.e**(-c/(10**logsigma)**2.)) log_fsigma_T08_ps = lambda logsigma, ps : log_fsigma_T08(logsigma, ps[0], ps[1], ps[2], ps[3])

#fnu_SMT = lambda nu, Anorm, a, q : Anorm * (2./n.pi)**(0.5) * (a*nu) * ( 1 + (a*nu) **(-2*q) ) * n.e**( - (a*nu)**2. / 2.) # #fnu_SMT = lambda nu, Anorm, a, q : Anorm *a * (2.*n.pi)**(-0.5) * ( 1 + (a**2*nu) **(-q) ) * n.e**( - a**2*nu / 2.) #log_fnu_ST01 = lambda logNu, Anorm, a, q : n.log10( fnu_SMT(10.**logNu, Anorm, a, q) ) #log_fnu_ST01_ps = lambda logNu, ps : n.log10( fnu_SMT(10.**logNu, ps[0], ps[1], ps[2]) )