Generating random galaxy catalogs for correlation functions The galaxy correlation function, when computed directly from a galaxy catalog, relies on computing a randomly generated counterpart catalog.

When dealing with a simulated galaxy mock-catalog, where the sample of galaxies is roughly uniform over a large box (e.g. the galaxy mocks created from Millennium/Millennium II), the random catalog can be just be a uniform distribution of points in the same volume as the real data.

However, real-world galaxy catalogs are not homogenous boxes, and have very irregular shapes and observationally induced redshift and angular distributions. Even some mock-catalogs are endowed with these properties to better represent real data. In these cases, how is a random catalog best produced? With some sort of probability distribution in coordinates which attempts to mimic the "non-physical" (i.e. not due to observational constraints) part of the distribution? Or a simple binary mask which filters out empty regions, but otherwise leaves the random catalog uniform.

If the answer is that some nonuniform distribution should be used, is there a usual method for doing so? The literature I have found (e.g. for the SDSS published data, and for galaxy mocks mimicking SDSS's constraints) does not discuss this in any way. Note, if this is a highly involved process beyond a brief summary and a source or two, I do not expect a full answer here. Rather, I am trying to determine if there is an existing set of standard methods which are documented but have eluded me thus far.
Generating random galaxy catalogs for correlation functions
... the random catalog can be just be a uniform distribution of points in the same volume as the real data.
However, real-world galaxy catalogs are not homogenous boxes, and have very irregular shapes and observationally induced redshift and angular distributions. Even some mock-catalogs are endowed with these properties to better represent real data. In these cases, how is a random catalog best produced? ...
If the answer is that some nonuniform distribution should be used, is there a usual method for doing so? The literature I have found (e.g. for the SDSS published data, and for galaxy mocks mimicking SDSS's constraints) does not discuss this in any way. Note, if this is a highly involved process beyond a brief summary and a source or two, I do not expect a full answer here. Rather, I am trying to determine if there is an existing set of standard methods which are documented but have eluded me thus far.

For SDSS see:

&quot;Large scale correlations in galaxy clustering from the two degree field galaxy redshift survey&quot; (2006), by N. L. Vasilyev, Yu. V. Baryshev and F. Sylos Labini.

&quot;The SDSS Galaxy Angular Two-Point Correlation Function&quot; (12 Mar 2013), by Y. Wang, R. J. Brunner, J. C. Dolence. The include their SQL query to the SDSS catalog archive server:



1 INTRODUCTION
One of the most powerful and simplest probes of the galaxy distribution is the two-point angular correlation function, which quantifies the excess probability above a random distribution of finding one galaxy within a specified angle of another galaxy. For the case of a Gaussian random field, the two-point angular correlation function and its Legendre transform pair provide a complete statistical characterization of the galaxy clustering (see, e.g., Peebles 1980). Even for the case of non-Gaussianity, the two-point angular correlation function provides a simple and important statistical test of galaxy formation models (Tegmark et al. 2004). The two-point angular correlation function has been studied at bright magnitudes from the data releases from the Sloan Digital Sky Survey (SDSS) such as the Early Data Release (EDR; Connolly et al. 2002).
...
To accurately calculate the galaxy two-point angular correlation function, we must first minimize potential systematic effects in the galaxy catalog used to measure the correlation function. The systematics of the SDSS EDR were thoroughly studied by Scranton et al. (2002). To minimize the systematic effects of seeing and Galactic extinction, they determined that the SDSS EDR galaxy sample had to be masked to exclude regions with seeing greater than 1.&quot;75 and reddening &gt; 0.2 magnitudes. Given the importance of minimizing the impact of systematic effects on the galaxy two-point angular correlation function and the significant changes that were made in the SDSS data processing pipeline between the SDSS EDR and the SDSS DR7, we have repeated many of the tests presented in Scranton et al. (2002) by using the SDSS DR7 data. In this paper we present the methods used to contain these systematic effects, the results of these systematic tests, the actual galaxy two-point angular correlation function for the SDSS DR7, and our massively parallel implementation that rapidly calculates correlation functions for large data sets.

Also: &quot;The galaxy correlation function and power spectrum&quot; (.PDF).
Wikipedia's &quot;Correlation function (astronomy)&quot;.
CalTech: &quot;Measurements of Clustering&quot; (Use [Next] or [Contents] buttons to view all the pages).
There are fixups applied to the raw data to correct for redshift and angular diameter distance.

For example catalogs and a description of the procedures see Shaun Cole's website: &quot;Mock Galaxy Redshift Catalogues&quot; where software and full details of the N-body simulations and the contruction and properties of the mock catalogues is provided for both 2dF Galaxy Redshift Survey (2dFGRS)  and SDSS galaxy redshift surveys.
Halo bias relation to dark matter and N-body simulations are discussed in &quot;BAM: Bias Assignment Method to generate mock catalogs&quot; (15 June 2018), by A. Balaguera-Antolínez, Francisco-Shu Kitaura, Marcos Pellerejo-Ibañez, Cheng Zhao, and Tom Abel.
Also check out the (under construction, and too busy working and writing papers) website: &quot;The Carnegie-Irvine Galaxy Survey (CGS)&quot; - with missing papers available on arXix:
&quot;The Carnegie-Irvine Galaxy Survey. I. Overview and Atlas of Optical Images&quot;
&quot;The Carnegie-Irvine Galaxy Survey. II. Isophotal Analysis&quot;
&quot;The Carnegie-Irvine Galaxy Survey. III. The Three-Component Structure of Nearby Elliptical Galaxies&quot;
&quot;The Carnegie-Irvine Galaxy Survey. IV. A Method to Determine the Average Mass Ratio of Mergers That Built Massive Elliptical Galaxies&quot;
&quot;The Carnegie-Irvine Galaxy Survey. V. Statistical study of bars and buckled bars&quot;
&quot;The Carnegie-Irvine Galaxy Survey. VI. Quantifying Spiral Structure&quot;
&quot;The Carnegie-Irvine Galaxy Survey. VII. Constraints on the Origin of S0 Galaxies from Their Photometric Structure&quot;