# halo abundance matching code¶

This class handles a light cone and assigns galaxies to the halos

Library of function to create halo catalogs matched to a density.

class HaloSelection.MultiDarkMock(hdu, area, mockOutput_dir, mockName, zmin, zmax, nGal_Deg2)[source]
Parameters: hdu – hdu of the lightcone area – area in deg2 mockOutput_dir – directory where to output mocks mockName – name of the file where to save the mock zmin – minimum redshift array defining the bins zmax – maximum redshift array defining the bins nGal_Deg2 – number of galaxies per square degrees
compare_clustering_data_mock(w_data, xi_data, theta_min_chi2=-2.3, theta_max_chi2=-1.5, w_bins=15, s_min_chi2=0.5, s_max_chi2=1.2, s_bins=10)[source]

Compares the clustering of the mock catalog and the clustering of the data. :param w_data: angular clustering from the data [x, y, yErr]. :param xi_data: monopole clustering from the data [x, y, yErr].

compute_clustering()[source]

Runs the CUTE code to estimate clustering using the LS estimator.

create_random_catalog(factor=5.0, dz=0.025)[source]

Writes a random catalog

get_distrib_QTY(colN, z1, z2)[source]

Computes the cumulative histogram of a column for halos in the range z1, z2. :param colN: name of the column you want to take the histogram. :param z1: minimum redshift :param z2: maximum redshift

get_distrib_QTY_cen(colN, z1, z2)[source]

Computes the cumulative histogram of a column for central halos in the range z1, z2. :param colN: name of the column you want to take the histogram. :param z1: minimum redshift :param z2: maximum redshift

get_distrib_QTY_sat(colN, z1, z2)[source]

Computes the cumulative histogram of a column for satellite halos in the range z1, z2. :param colN: name of the column you want to take the histogram. :param z1: minimum redshift :param z2: maximum redshift

initialize()[source]

Initializes the procedure by putting into memroy arrays of central and satellites.

make_GaussianFsat_catalog(colN, means, scatters, fsats)[source]

Creates lists of ids of centrals and satellite galaxies corresponding to the density given in the n(z). :param colN: name of the column you construct the catalog with :param means: means of the Gaussians, array the same length of the redshift bin :param scatters: scatters of the Gaussians, array the same length of the redshift bin :param fsats: fractions of satellite, array the same length of the redshift bin

make_Gaussian_catalog(colN, means, scatters)[source]

Creates lists of ids of centrals and satellite galaxies corresponding to the density given in the n(z). :param colN: name of the column you construct the catalog with :param means: means of the Gaussians, array the same length of the redshift bin :param scatters: scatters of the Gaussians, array the same length of the redshift bin

make_LogNorm_catalog(colN, means, scatters)[source]

Creates lists of ids of centrals and satellite galaxies corresponding to the density given in the n(z). :param colN: name of the column you construct the catalog with :param means: means of the Gaussians, array the same length of the redshift bin :param scatters: scatters of the Gaussians, array the same length of the redshift bin

make_shamIncomplete_catalog(colN, incompletenessFactor)[source]

Creates lists of ids of halos corresponding to the density given in the n(z). For every bin of redshift, it gets the distribution o fthe column of interest and matches to the density of galaxies in the NZ given. Then provides a column of ids extracted from teh lightcone. :param colN: name of the column you wish to work on for the sham.

make_shamMAX_catalog(colN, maxQTY)[source]

Creates lists of ids of centrals and satellite galaxies corresponding to the density given in the n(z). For every bin of redshift, it gets the distribution o fthe column of interest and matches to the density of galaxies in the NZ given. Then provides a column of ids extracted from teh lightcone. :param colN: name of the column you wish to work on for the sham.

make_sham_catalog(colN='mvir')[source]

Creates lists of ids of halos corresponding to the density given in the n(z). For every bin of redshift, it gets the distribution o fthe column of interest and matches to the density of galaxies in the NZ given. Then provides a column of ids extracted from teh lightcone. :param colN: name of the column you wish to work on for the sham.

select_Gaussian(meanQTY, scatterQTY, nGal_perbin, IDhz, QTY)[source]

Creates lists of ids of centrals and satellite galaxies corresponding to the density given in the n(z) and to a gaussian distribution . For every bin of redshift, it gets the distribution o fthe column of interest and matches to the density of galaxies in the NZ given. Then provides a column of ids extracted from teh lightcone. :param colN: name of the column you wish to work on for the sham. :param meanQTY: mean of the distribution :param scatterQTY: scatter of the distribution :param nGal_perbin: total number of galaxies in this bins to mock :param IDhz: IDs of the halos in this bin :param QTY: array of the column to do the match on, mass, velocity, ...

select_GaussianFsat(meanQTY, scatterQTY, fsat, nGal_perbin, IDhz_c, QTY_c, IDhz_s, QTY_s)[source]

Extracts the ids of halos to create a mock with a Gaussian distribution. :param colN: name of the column you wish to work on for the sham. :param meanQTY: mean of the distribution :param scatterQTY: scatter of the distribution :param fsat: fraction of satellite in this bin :param nGal_perbin: total number of galaxies in this bins to mock :param IDhz_c: IDs of the central halos in this bin :param QTY_c: column to do the match on, mass, velocity, ... for the central halos :param IDhz_s: IDs of the satellite halos in this bin :param QTY_s: column to do the match on, mass, velocity, ... for the satellite halos

select_LogNorm(meanQTY, scatterQTY, nGal_perbin, IDhz, QTY, nn, bb)[source]

Creates lists of ids of centrals and satellite galaxies corresponding to the density given in the n(z) and to a gaussian distribution . For every bin of redshift, it gets the distribution o fthe column of interest and matches to the density of galaxies in the NZ given. Then provides a column of ids extracted from teh lightcone. :param colN: name of the column you wish to work on for the sham. :param meanQTY: mean of the distribution :param scatterQTY: scatter of the distribution :param nGal_perbin: total number of galaxies in this bins to mock :param IDhz: IDs of the halos in this bin :param QTY: array of the column to do the match on, mass, velocity, ...

select_sham(nGal_perbin, IDhz, QTY, nn, bb)[source]

Returns the ids corresponding to a given density. :param nGal_perbin: number of galaxies to be selected :param IDhz: parent ID distribution :param QTY: quantity to select halos on :param nn: cumulative distribution o QTY :param bb: bins of the cumulative distribution

select_shamIncomplete(incompFactor, nGal_perbin, IDhz, QTY, nn, bb)[source]

Returns the ids corresponding to a given density and an incompleteness factor. :param nGal_perbin: number of galaxies to be selected :param IDhz: parent ID distribution :param QTY: quantity to select halos on :param nn: cumulative distribution o QTY :param bb: bins of the cumulative distribution :param incompFactor: incompleteness factor compared to the max of QTY : max(QTY)/incompFactor will be set as the max of the extracted distribution.

select_shamMAX(QTY_max, nGal_perbin, IDhz, QTY, nn, bb)[source]

Returns the ids corresponding to a given density with a maximum in the QTY. :param nGal_perbin: number of galaxies to be selected :param IDhz: parent ID distribution :param QTY: quantity to select halos on :param nn: cumulative distribution o QTY :param bb: bins of the cumulative distribution :param QTY_max: the max of QTY is set to QTY_max.

writeClusteringParamFile(type, decade='')[source]

Writes the clustering commands that command the CUTE code, see Alonso et al. 2012 https://arxiv.org/abs/1210.1833 :param type: monopole or angular or ... :param decade: string suffix that is appended if you study different scales (decades) _d1, _d2, _d3 are used for the angular clustering.

write_catalog_ascii()[source]

Writes the obtained mock catalog for clustering estimation: just ra, dec and redshift.

write_full_catalog_fits()[source]

Writes the obtained with all the columns from the parent lightcone catalog.