---
abstract: 'We present a modified adaptive matched filter algorithm designed to identify clusters of galaxies in wide-field imaging surveys such as the Sloan Digital Sky Survey. The cluster-finding technique is fully adaptive to imaging surveys with spectroscopic coverage, multicolor photometric redshifts, no redshift information at all, and any combination of these within one survey. It works with high efficiency in multi-band imaging surveys where photometric redshifts can be estimated with well-understood error distributions. Tests of the algorithm on realistic mock SDSS catalogs suggest that the detected sample is $\sim 85\%$ complete and over $90\%$ pure for clusters with masses above $1.0\times10^{14} h^{-1}$ M$_\odot$ and redshifts up to $z=0.45$. The errors of estimated cluster redshifts from maximum likelihood method are shown to be small (typically less that 0.01) over the whole redshift range with photometric redshift errors typical of those found in the Sloan survey. Inside the spherical radius corresponding to a galaxy overdensity of $\Delta=200$, we find the derived cluster richness $\Lambda_{200}$ a roughly linear indicator of its virial mass $M_{200}$, which well recovers the relation between total luminosity and cluster mass of the input simulation.'
author:
- 'Feng Dong , Elena Pierpaoli , James E. Gunn , Risa H. Wechsler'
bibliography:
- 'ms.bib'
title: 'Optical Cluster-Finding with An Adaptive Matched-Filter Technique: Algorithm and Comparison with Simulations '
---

Introduction {#sec:Introduction}
============

Clusters of galaxies are the most massive virialized systems in the Universe and have been extensively used to study galaxy population and evolution [@Dre84; @Dre92], to trace the large-scale structure of the universe [@Bah88; @Pos92], and to constrain cosmology [@Evr89; @Bah99; @Hen00; @Pierpa01; @Pierpa03]. Given the important roles clusters of galaxies play in the studies of both astrophysics and cosmology, tremendous efforts have been made during the past several decades to search for these systems. The first large samples of clusters were identified by looking for projected galaxy overdensities through visual inspection of photographic plates [@Abe58; @Abe89; @Zwi68]. These catalogs made pioneering contributions to our understanding of the extragalactic universe and since their generation have opened many new frontiers in the studies of galaxy clusters. However, the compilation of a relatively complete and pure sample of galaxy clusters has remained far from trivial. To date the Abell catalog, which contains about 4000 rich clusters to a redshift of $z\sim0.2$, is still the most widely used cluster catalog in the field, though it was realized early that visually-constructed catalogs suffer from projection effects, subjectivity, and large uncertainties in estimated properties [@Sut88]. It is difficult to apply these catalogs for statistical studies in cosmology because of these uncertainties, in addition to the fact that the selection function and false positive rates of such cluster samples are hard to quantify.

To relieve some of these concerns, other approaches for identifying clusters have also been designed and implemented, such as reconstructing the full 3-D structures in complete redshift surveys [@Huc82; @Gel83; @Ram97], detecting clusters in X-ray surveys [@Gio90; @Edg90; @Ebe98; @Ros98; @Rom00; @Sch00; @Boh01; @Mul03; @Boh04], and utilizing the Sunyaev-Zeldovich effect [@Car00; @Moh02; @Pierpa05] and weak gravitational lensing [@Sch96; @Wit01] in search for clusters. Moreover, the realization of large and deep galaxy surveys in recent years has revived optical cluster-finding endeavors and prompted the development of more automated and rigorous algorithms to select clusters from imaging surveys. Using multi-color photometric data from which photometric redshifts can be estimated, it is now possible to mitigate the problems of projection effects, and quantitative analysis of the selection bias is also now possible. Automated peak-finding techniques in optical cluster searches were attempted by @She85 and later used in the Edinburgh/Durham survey [ED @Lum92] as well as the Automatic Plate Measurement Facility survey [APM @Dal94; @Dal97]. In the construction of the cluster catalog from the Palomar Distant Cluster Survey [@Pos96], a matched filter algorithm was developed to select clusters from a photometric galaxy sample. It was widely used in subsequent surveys and several variants have been put forward [@Kaw98; @Sch98; @Kep99; @Kim02; @Whi02]. Meanwhile with the knowledge of the existence of the “E/S0 ridgeline” of cluster galaxies in color-magnitude space and the aid of multi-color CCD photometry, several color-based cluster-finding techniques were also investigated [@Gla00; @Got02; @Gla05; @Mil05]. Some of these have already been successfully applied to select clusters from the Sloan Digital Sky Survey (SDSS) data [@Got02; @Ann02; @Bah03; @Mil05; @Koe07].

The Sloan Digital Sky Survey [@Yor00] is a five-band CCD imaging survey of about 10$^4$ deg$^{2}$ in the high latitude North Galactic Cap and a smaller deeper region in the South, followed by an extensive multi-fiber spectroscopic survey. The imaging survey is carried out in drift-scan mode in five SDSS filters ($u$, $g$, $r$, $i$, $z$) to a limiting magnitude of $r\sim22.5$ [@Fuk96; @Gun98; @Lup01; @Smi02]. The spectroscopic survey targets $\sim$10$^{6}$ galaxies to $r\sim17.7$, with a median redshift of $z\sim0.1$ [@Str02], and a smaller deeper sample of $\sim$10$^{5}$ Luminous Red Galaxies out to $z\sim0.5$ [@Eis01]. In this paper we discuss a modified adaptive matched filter technique incorporating several new features over previous algorithms and designed to detect clusters using both the SDSS imaging and spectroscopic data; it could readily be adapted to other similar multi-band, large-area galaxy surveys for construction of optically-selected cluster samples. It is the first of a series of papers that will explore the application of the technique to select clusters from the Sloan Digital Sky Survey.

The general idea of the matched filter method relies on the fact that clusters show on average a typical density profile, now widely assumed to be the “NFW” form suggested first by Navarro, Frenk and White [@Nav96]. Assuming that galaxies trace the dark matter, we expect galaxies within clusters to be distributed according to such profile. The algorithm selects regions in the sky where the distribution of galaxies corresponds to the projection of average cluster density profile. In addition, it is possible to specify the galaxy redshift information inside clusters, and to use prior knowledge on the galaxy luminosity function. The combination of these matched subfilters thus enables us to extract a quantitative signal corresponding to the existence of a cluster at a given location in the surveyed sky area.

The modified matched filter technique presented in this paper can fully adapt to imaging surveys with spectroscopic measurements, multicolor photometric redshifts, no redshift information at all, and any combination of these within one survey. In the Sloan Digital Sky Survey where photometric redshifts can be estimated with well-understood error distributions from the five-band ($u$,$g$,$r$,$i$,$z$) multi-color photometry, the matched filter technique described here utilizes not only the spectroscopic coverage for the bright main sample galaxies and Luminous Red Galaxies (LRGs) but also the photometric redshift information for most of the galaxies detected in the imaging survey. This greatly expands the input galaxy sample to feed into the cluster-finding algorithm compared to pure spectroscopic methods [e.g. @Mil05]. The obtained composite cluster catalog can also go much deeper in redshift ($z\sim0.4-0.5$ in this case) than the typical $z\sim0.2$ limit for spectroscopic samples due to the lack of availability of spectroscopic measurements for faint, deep galaxies.

Since the matched filter technique does not explicitly use the information about the red sequence to select clusters as is done in some color-based cluster-finding methods [@Ann02; @Mil05; @Koe07], it can theoretically detect clusters of any type in color, and is not restricted only to old, red E/S0 galaxies. Such clusters likely dominate the cluster population, but may not constitute all of it especially as one probes systems of lower richness and at higher redshifts. The use of both spectroscopic and photometric redshift information largely eliminates the projection effects and removes most of the phantom clusters. The matched filter also generates accurate quantitative estimates of derived cluster properties, such as redshift, scale, richness, and concentration, and produces quantitative detection likelihoods, indicative of the combined information for both red and blue galaxies identified as cluster members. These facilitate further studies of detected systems and makes easier the comparison to clusters selected by other methods. One major concern for the matched filter technique is the fact that determination of these parameters depends on the specific cluster model we put in to build the relevant filters. However, these effects can be minimized by careful assumptions about the shape and evolution of luminosity function, and by the fact that our density filter is self-adaptive to different cluster scales and concentration. The clusters selected by the algorithm will provide us the necessary sample on which we then apply an iterative procedure aimed at refining the constraints on clusters’ properties. More details will be discussed in section §\[sec:Algorithm\] and subsequent work following this paper.

The new algorithm presented here differs from previous matched filter implementations [@Kep99; @Kim02] in several ways. We use a uniform Poisson likelihood analysis, which is only the second step in the approach by @Kep99 following a first pass using Gaussian statistics for pre-selection of clusters. This avoids the common problem for high-redshift clusters of having too few galaxies in any cell of interest for Gaussian statistics to apply, and the adopted approach yields correct likelihoods even at the detection stage. In addition, both the core radius and virial radius of the matched filter are adaptive over the typical observed dynamical range for clusters, in contrast to most previous cluster-finding techniques that set the cluster core radius or search radius to be fixed. For each individual cluster, a best-fit core radius is found to maximize the likelihood match, as well as an outer radius inside which the galaxy overdensity reaches $\Delta$=200. The cluster richness is then normalized to be the light contained within this virial radius, which we find correlates better with the mass of gravitational systems whose extent is defined by density contrast as is widely adopted in theoretical studies. The new features of our modified algorithm will be further discussed in §\[sec:Algorithm\].

In order to understand the biases and the selection functions of our algorithm, we test it on a mock SDSS catalog which has been constructed from the Hubble Volume Simulation [@Evr02] by assigning luminosities and colors to the dark matter particles in a manner which reproduces many characteristics of the galaxy population from SDSS observations. The “observations” of the simulations have then been further modified so that the redshift scatter of those galaxies which have photometric but no spectroscopic redshifts correspond to that of the photometric redshift errors in actual SDSS data. The comparison of the detected cluster sample with halos in the simulation provides the only rigorous way to assess how the observed cluster properties relate to the real masses, and how the cluster sample can be used to derive cosmological constraints.

In section §\[sec:Algorithm\] we describe the modified adaptive matched filter technique and how it is used to extract the cluster sample. Section §\[sec:Simulation\] presents the basic features of the simulated catalog we adopted for the testing purpose. In section §\[sec:Results\] we show results on the completeness and purity of our cluster sample, and the expected scaling relations inferred from runs on the simulations. We conclude in section §\[sec:Conclusion\].

A flat $\Lambda$CDM model with $\Omega_m=0.3$ and $\Omega_{\Lambda}=0.7$ is used throughout this work, and we assume a Hubble constant of $H_0=100 h$ km s$^{-1}$ Mpc$^{-1}$ if not specified otherwise.

The Cluster-Finding Algorithm {#sec:Algorithm}
=============================

The matched filter technique introduced here is a likelihood method which identifies clusters by convolving the optical galaxy survey with a set of filters based on a modeling of the cluster and field galaxy distributions. A cluster radial surface density profile, a galaxy luminosity function, and redshift information (when available) are used to construct filters in position, magnitude, and redshift space, from which a cluster likelihood map is generated. The peaks in the map thus correspond to candidate cluster centers where the matches between the survey data and the cluster filters are optimized. The algorithm automatically provides the probability for the detection, best-fit estimates of cluster properties including redshift, radius and richness, as well as membership assessment for each galaxy. The modified algorithm can be fully adaptive to current and future galaxy surveys in 2-D (imaging), 2$\half$-D (where multi-color photometric redshifts and their errors can be estimated), and 3-D (with full spectroscopic redshift measurements). Usage of the apparent magnitudes and, where applicable, the redshift estimates instead of simply searching for projected galaxy overdensities effectively suppresses the foreground-background contamination, and the technique has proven to be an efficient way of selecting clusters of galaxies from large multi-band optical surveys.

In what follows, we first provide a general introduction on how the likelihood function is constructed and how we detect clusters with the matched filter method. This gives us an overview about how the cluster catalog is derived. Then we discuss in more detail the density models and subfilters used to construct the likelihood. More specifically, we assume an NFW density profile, a general Schechter luminosity function and a Gaussian model for BCGs to model clusters, and use the spectroscopic measurements and obtained error distributions of galaxy photometric redshifts from the Sloan Digital Sky Survey to incorporate redshift uncertainties. In the end we describe how to determine the set of best-fit parameters on cluster properties that maximize the likelihood at a given position over a range of redshift, scale, concentration, and richness.

Likelihood Function {#sec:Likelihood}
-------------------

The likelihood function used here is based on the assumption that the probability of finding galaxies in an infinitesimal bin in angular position, apparent magnitude and redshift space is given by a Poisson distribution. Under this assumption, the total likelihood of many of such bins, which we take to be centered in the location of the galaxies in the survey, is (see appendix C2 in @Kep99 for a full derivation):

$$ln {\cal L} = -N_f -\sum_{k=1}^{N_c}N_k +\sum_{i=1}^{N_g}\ln[P(i)],$$

where $N_f$ is the total number of field galaxies expected within the searching area, $N_g$ is the total number of galaxies and $\sum_{k=1}^{N_c}N_k$ is normalized to be the number of galaxies brighter than $L^*$ as members of the $N_c$ clusters assumed in the model. $P(i)$ represents the predicted probability density of galaxies in a given bin, which includes both probabilities of field galaxies ($P_f$) and of cluster members ($P_c$),

$$P(i) = P_f(i) + \sum_{k=1}^{N_c} P_{c}(i,k).$$

These probabilities are the expected number densities for a given location and magnitude.

The cluster catalog is constructed with an iterative procedure similar to the one used in @Koc03. We start our process from a density model of a smooth background with no clusters. For each galaxy position, we then evaluate the likelihood increment we would obtain by assuming that there is in fact a cluster centered on that galaxy. The likelihood is then optimized by varying the cluster galaxy number $N_k$, the redshift and cluster scale length. At each iteration, we retain the cluster candidate which resulted in the greatest likelihood increase. We incorporate it in our density model and restart the procedure. The function for finding the $k^{th}$ cluster in the whole surveyed area therefore is

$$\begin{array}{ll}
  \Delta\ln{\cal L}(k) = -N_k + \sum_{i=1}^{N_g}\ln[{P_f(i)+\sum_{j=1}^{k}P_c(i,j) \over 
      P_f(i)+\sum_{j=1}^{k-1}P_c(i,j)}].
\end{array}$$

A list of cluster candidates then becomes available in decreasing order of detection likelihoods. For each candidate one has derived properties, including best-fit position, scale, richness, and estimated redshift. The initial cluster catalog allows us to further inspect each individual candidate for exploration of substructure and better constraints on previously fitted quantities.

Density Model {#sec:Density}
-------------

As both field and cluster galaxies are found in the survey, the probability of finding a galaxy in a given bin depends on the density of both these populations (see eq.(2)).

For galaxy $i$ with angular position $\vec{\theta}_i$, $r$-band apparent magnitude $m^r_i$ and redshift $z_i$ (when available), the background number density $P_f(i)$ can be directly extracted from the global number counts of the galaxy survey,

$$P_f(i) = { d N \over dm~ dz }(m^r_i, z_i),$$

and it has to be modified to account for the effects of galaxy redshift uncertainties if photometric redshift estimates are used.

For cluster $k$ located at $\vec{\theta}_k$ with proper scale length $r_{ck}$, redshift $z_k$ and galaxy number $N_k$, the probability of galaxy $i$ being a member of it, $P_c(i,k)$, is just the product of a surface density profile $\Sigma_c$ and a luminosity function $\phi_c$ at the cluster’s redshift, times a distribution function $f(z_i- z_k)$ that expresses redshift uncertainties:

$$P_c(i,k) = N_{k}\ \Sigma_c\left[D_A(z_k)\theta_{ik}\right]\ \phi_c\left[m^r_i-{\cal D}(z_k);
    \right]\ f(z_i-z_k),$$

where ${\cal D}(z_k)$ is defined through

$$M^r_i = m^r_i - 5 \log (D_L(z_k)/10\mbox{pc}) - k(z_k) = m^r_i - {\cal D}(z_k),$$

and where $D_A(z_k)$ and $D_L(z_k)$ are the angular diameter and luminosity distance at the cluster’s redshift $z_k$, and $k(z_k)$ is the $k$-correction. The conversion of units in luminosity and distance is conducted by performing proper $k$-corrections for galaxies of different spectral types and choosing the proper cosmology (see §\[sec:Introduction\]).

Subfilters {#sec:Subfilters}
----------

Based on current observational studies as well as findings from dark matter halos, and for convenient comparisons to theoretical models widely used in analytical studies and N-body simulations, we assume the density profile of galaxies within a cluster follows the form of a NFW profile [@Nav96], which in three dimensions is given by

$$\rho_c(r) = {1 \over 4\pi r_c^3 F(c)}{1 \over {r \over r_c}(1+{r \over r_c})^2},$$

where $c$ is the concentration parameter and $F(c)$ is the typical normalization factor for galaxies inside the virial radius of the cluster, $r_v=cr_c$. The 3-D profile is then integrated along the line of sight to derive a projected surface density profile $\Sigma_c(r)$ which is expressible as a much more complicated analytical form (see @Bar96). The profile is normalized so that $\int_0^{cr_c} 2\pi r \Sigma_c(r) dr = 1$.

The search radius for galaxies belonging to the cluster is set to be the virial radius of the cluster, or more specifically here, the radius inside which the mass overdensity is 200 times the critical density, i.e., 200$\Omega_M^{-1}$ times the average background [@Evr02]. Since it is hard to directly measure the cluster mass overdensity in observations, we instead determine the virial radius inside which the space density of cluster galaxies is 200$\Omega_M^{-1}$ times the mean field, assuming that the galaxy distribution in a halo traces the overall dark matter distribution (see discussions in @Han05), which has been suggested by recent observations and simulations [@Lin04a; @Nag05; @Lin07a], and is supported by weak lensing measurements [@She04]. For simplicity, we use $r_{200}$ throughout this work to denote the cluster virial radius determined by galaxy overdensities. The cluster richness is then defined to be the total luminosity in units of $L^*$ inside $r_{200}$.

As has been discussed before in matched-filter studies [@Pos96; @Kim02] and also shown by our own numerical experiments, the efficiency of the filter is usually much more sensitive to the overall filter cutoff radius than to the details of its shape. Therefore the determination of appropriate values for the scale length in the cluster model is of particular importance, as it may have significant impact on the detection efficiency of the cluster-finding algorithm. Most of the previous matched filter methods have used a carefully chosen fixed value for the model cluster cutoff radii, and they compute the galaxy number or the richness of clusters within such a fixed radius in physical units. @Pos96 concludes that a fixed search radius of 1 Mpc $h^{-1}$ is a near-optimal choice in their radial filter, and this value has been also adopted by @Kep99 [@Kim02] in their method which assumes a modified Plummer law model for the surface density profile. In @Whi02 and @Koc03, the authors set a fixed core radius of $r_c=200$ kpc $h^{-1}$ and concentration parameter of $c=4$ for the NFW profile in the cluster detection and mass estimates. Although we find from observations and simulations that these choices are reasonable values for typical rich clusters, a single fixed scale length for all clusters over a wide range of masses and concentrations will certainly degrade the signal-to-noise ratio, bias detection probabilities, and be responsible for at least part of the large scatter observed in previous cluster mass-richness scaling relations. In our modified adaptive matched filter algorithm, we optimize the core radius for each individual cluster over the dynamical range for typical galaxy clusters. For the core radius value that maximizes the likelihood, we then compute the normalized cluster richness according to the NFW profile with best-fit parameters within a cluster virial radius $r_{200}$ determined from galaxy overdensities. We believe this procedure is more similar to and comparable with the virial mass defined by density contrast in most theoretical studies and analyses of simulations.

For the magnitude filter, we adopt a luminosity profile described by a central galaxy plus a standard Schechter luminosity function [@Sch76]

$$\phi(M) = {dn \over dM} = 0.4 \ln10\ n^* \left({L \over L^*} \right)^{1+\alpha} \exp(-L/L^*);$$

the integrated luminosity function is

$$\Phi(M) = \int_{-\infty}^M \phi(M) dM = n^* \Gamma[1+\alpha, L/L^*].$$

Parameters for the global luminosity function are obtained from the SDSS spectroscopic sample at the redshift of $z=0.1$ [@Bla03]. To account for the evolutionary effects at higher redshifts, we allow a passive evolution of $L^*$ which brightens about 0.8 magnitudes from $z=0$ to $z=0.5$ [@Lov92; @Lil95b; @Nag01; @Bla03; @Lov04; @Bal05; @Ilb05]. We assume that $L^*$ does not vary as a function of cluster richness, which is supported by the results of @Han05. Because the matched filter algorithm uses both a cluster galaxy luminosity function and a field galaxy luminosity function, which are expected to be different due to the morphology-density relation [@Dre80] and the observed dependence of luminosity function on galaxy over-densities [@Chr00; @Mo04; @Cro05], it would be desirable to model these separately. It would also be desirable to further model the luminosity distributions according to galaxy spectral types [@Fol99; @Lin99; @Hog03]. At this stage, however, only a single function is adopted since the work on precise luminosity functions for cluster galaxies of different types has just been started. We hope to investigate this further on the basis of the first catalog we produce. Once a cluster catalog is available for galaxies in all redshift ranges, we can go back and examine the impact of our assumptions about the galaxy luminosity functions as well as their evolution for different environments and spectral types. In order to use the same range in the luminosity function at all distances and therefore avoid bias associated with errors in the assumed form of the luminosity function, we cut off the luminosity function at one magnitude below $L^*$. We can still calculate total luminosities by integrating the assumed form, and we use this in our richness calculation, described below.

The existence of Brightest Cluster Galaxies (BCGs) near the cluster centers is incorporated into our cluster galaxy luminosity model as a separate component from the main Schechter function for satellites, as this distinction has been clearly seen in clusters over a range of richness [@RT77; @Han05]. We assume a Gaussian distribution for the luminosities of these objects and adopt the results from @Lin04b for correlations between the BCG luminosity and host cluster properties. More specifically, the BCG luminosity is assumed to follow a single power law with the cluster richness, $L_{BCG} \sim \Lambda_{200}^{1\over4}$, and we take the width of the Gaussian to be $\sim0.5$ mag [@Lin04b; @Zhe05; @Han05]. The luminosity of BCGs is assumed to evolve in the same way as $L^*$ does, [*i.e. *]{} the luminosity at the mean of the gaussian has a constant ratio to $L^*$. This is almost certainly incorrect in detail, but will be explored in follow-up work once the catalog is constructed. This modification of the general Schechter function enhances the detectability of typical clusters with BCGs, especially those at higher redshifts with only few galaxies other than the BCG to be included in the apparent magnitude-limited galaxy sample.

Thanks to the accurate five-band ($u$,$g$,$r$,$i$,$z$) multi-color photometry in the SDSS [@Yor00], as well as the associated redshift survey for the bright main sample galaxies [@Str02] and Luminous Red Galaxies (LRGs, @Eis01), it is now also possible to retrieve redshift information for most of the galaxies that we are going to use in construction of the SDSS cluster catalog, either photometrically or spectroscopically. For real SDSS data currently available from DR5, we find that galaxies with valid photometric redshift estimates make up more than $96\%$ of the whole sample in the imaging data, within which about $1\%$, mostly bright, red galaxies, have matched spectroscopic measurements from redshift surveys. Not surprisingly, the inclusion of galaxy redshift estimates greatly improves the accuracy of the cluster redshift determinations and significantly mitigates projection effects, thus allowing the detection of much poorer systems than possible in previous work with no redshift measurements.

The uncertainties of galaxy redshifts are assumed to follow Gaussian distributions in the 2$\half$-D and 3-D cases, where in terms of the $f(z)$ function in equation (5) we have

$$f(z_k) = {\exp\left[-(z_i-z_k)^2/2\sigma_{z_i}^2\right] \over \sqrt{2\pi}\sigma_{z_i}}.$$

For galaxies with computed photometric redshifts (described below), we add to the cluster galaxy density model a third subfilter based on the distribution of derived redshift uncertainties in the form of a combination of multiple Gaussian modes. These error estimates are obtained by calibrating photometric redshifts with the real redshifts in the SDSS spectroscopic galaxy sample and redshifts for other fainter (but smaller) overlapping surveys. The analysis is done for red and blue galaxies separately using the color separator by @Strv01, and it is found that a model using Gaussian modes with proper weights assigned generally provides a good description of the bias and scatter in the photometric redshifts for galaxies of both spectral types and in different apparent magnitude bins. Some of the results are shown in §\[sec:Simulation\].

In the 3-D case where spectroscopic redshifts of galaxies are measured, we smooth them in Gaussians with assigned cluster velocity dispersions that vary in the range from $400$ km s$^{-1}$ (proper) for poorer clusters to $1200$ km s$^{-1}$ (proper) for the richest systems in the selected cluster sample, according to several discrete estimated richness classes. The same procedure as outlined in the previous paragraph for photometric redshifts is applied to include this redshift filter in the galaxy density model.

In addition, there are galaxies we find that either have invalid photometric redshifts computed or fall into the redshift and magnitude range where no good calibrations are available. Such galaxies, which are currently about $3\%$-$5\%$ of the whole sample, are assumed to have no redshift estimates and therefore no constraining filter. Hence we set up for each galaxy the appropriate scenario that adapts the matched filter algorithm to galaxy redshift estimates with varied accuracy.

Finally, of course, we fit an overall amplitude, which represents the cluster richness. Since its size, shape and redshift are all determined at this point, we can express the amplitude however we like in physical terms. We have chosen to use the total luminosity within $r_{200}$ expressed as a multiple of $L^*$ (evolved to the relevant redshift using 1.6 mags of luminosity evolution per unit redshift), which we denote as $\Lambda_{200}$.

Implementation {#sec:Implementation}
--------------

Implementation of the matched filter algorithm starts with reading the galaxy catalog. For each galaxy $i$ in the sample, we read in the positions $\alpha_i$, $\delta_i$, the extinction-corrected five-band apparent magnitudes and their errors, and the redshift $z_i$ if it has a matched spectrum. Using the flux and color information, we compute a photometric redshift estimate using a neural network technique by [@Lin07] as well as $k$-corrections and estimated rest-frame colors for each galaxy, which we add as input to the cluster-finding algorithm.

The next step is to define the cluster model we adopt for the filters, including the surface density profile $\Sigma_c(r)$, the luminosity function $\phi(M)$, and the assumed Gaussian modes of photometric redshift uncertainties. The field density model $P_f(m,z)$ is constructed from global number counts of the surveyed background galaxy distributions as a function of magnitude and redshift, as shown in equation (4). We then incorporate these models into the Poisson likelihood functions as discussed above.

To map the likelihood distributions of the surveyed area, we grid the sky using the Healpix package of [@Gor05] which provides a useful hierarchical pixelization scheme of equal-area pixels. In @Kep99, the authors choose galaxy positions on an adaptive grid in calculating the likelihoods instead of the uniform grids used in the previous matched filter codes [@Pos96], so that sufficient resolution in the high density regions is ensured while saving computational time and memory for less dense regions. We follow this procedure and evaluate the likelihood functions at every galaxy position to locate the peaks in the map as possible cluster centers. The cluster richness is optimized over the whole redshift range of our search at intervals that finally adapt to $\delta z=0.001$, and for a set of trial cluster scale radii ($r_c$) at $10$ kpc $h^{-1}$ steps. The derived quantities for best fit cluster richness, redshift and scale length thus correspond to the parameters that maximize the likelihood function at the grid position or candidate cluster center.

This algorithm possesses several new features. First, the cluster algorithm is fully adaptive to 2-D, 2$\half$-D and 3-D case in the optical surveys, and can deal with data with these different attributes simultaneously. It can easily accommodate the galaxy redshifts with uncertainties in any forms and distributions, from purely single-band imaging data to a complete spectroscopic redshift survey, and works well for the intermediate case where photometric redshifts are estimated from multi-band color information. Projection effects from foreground–background contamination, which have been a long-standing problem for optically-selected clusters, are largely suppressed. This allows the detection of even poorer systems at high redshift, and shows great potential for current and future large, deeper surveys in the optical band. Second, the current adaptive matched filter used a single Poisson statistics in the likelihood analysis, compared to the two-step approach in @Kep99, which uses a “coarse” filter based on Gaussian likelihood for pre-selection of clusters. We write our code in Fortran-90 and by careful arrangement in computations and setting up the quick link search, the optimization of the Poisson likelihood through the whole process is now affordable in the sense of execution time and memory. For a survey field of $\sim300$ deg$^2$, which is comparable to a typical SDSS stripe [@Yor00], the modified adaptive matched filter algorithm requires around 900 megabytes of memory and takes about 30 hours for a single run using one dual-processor node in a Linux Beowulf cluster with 3.06 GHz clock speed each. With no assumption necessary about sufficiently many galaxies inside each virtual bin as is necessary in the Gaussian case, the Poisson statistics remains robust in the common situation where there are too few galaxies in each cell for Gaussian statistics to apply. Third, as discussed in @Whi02 and @Koc03, the current density model explicitly includes the effect of previously found clusters on the global likelihood function. The procedure automatically separates overlapping clusters and avoids multiple detections of the same system in the overdensity regions, somewhat similar to the CLEAN method used in radio astronomy to produce maps [@Hog74; @Sch78]. We do not need to do extra cluster de-blending work afterwards. Finally, as discussed earlier, our approach to maximizing the likelihood differs from most previous cluster-finding techniques that choose a fixed cluster scale or search radius. We optimize the core radius for each individual cluster, and the cluster richness is computed within a virial radius which is determined from galaxy overdensities. This provides insights about the virial mass of such gravitational systems defined by density contrast and better corresponds to what is done in theoretical treatments.

Tests on Mock Galaxy Catalogs {#sec:Simulation}
=============================

To evaluate the completeness and purity (false positive rate) of our cluster sample, as well as to assess the how well our measured cluster properties correspond to the properties of the underlying dark matter halos, we have run the matched-filter algorithm on a mock galaxy catalog generated from a realistic cosmological N-body simulation. Because of the large redshift range we are trying to probe, it is important to do this with as large a simulation volume as possible. In addition, because we seek here to test the behavior of our algorithm using a combination of spectroscopic and photometric redshifts, it is useful to have a realistic galaxy population in both clusters and the field, with luminosities, colors, and the relation between these quantities and environment that are a good match to SDSS data. Here we have used a mock catalog based on a method namely ADDGALS (Adding Density-Determined Galaxies to Lightcone Simulations) (@Wec04 and in preparation, 2007), which is designed to model relatively bright galaxies in large volume simulations.

The underlying dark matter simulation used here tracks $10^9$ particles of mass $2.25\times10^{12} h^{-1} M_\odot$ in a periodic cubic volume with side length of $3 h^{-1}$ Gpc, using a flat $\Lambda$CDM cosmology with $\Omega_m=0.3$, $\sigma_8=0.9$, and $h=0.7$ [the Hubble Volume simulation; @Evr02]. Halos are identified for masses above $2.7\times10^{13} h^{-1} M_\odot$. Data are collected on the past light cone of an observer at the center of the volume. The size of the simulation enables the creation of a full-sky survey out to redshift of $z=0.58$, and is thus suited to testing our cluster-finding algorithm out to high redshifts using the SDSS imaging data.

Galaxies are connected to individual dark matter particles on this simulated light-cone, subject to several empirical constraints. The resolution of the simulation allows the mock catalog to include galaxies brighter than about 0.4$L^*$; the number of galaxies of a given brightness placed within the simulation is determined by drawing galaxies from the SDSS galaxy luminosity function [@Bla03], with 1.6 mags of luminosity evolution assumed per unit redshift (the same assumption is made by our cluster finding algorithm). The choice of which particle these galaxies are assigned to is determined by relating the particle overdensities (on a mass scale of $\sim 1e13 M_{\odot}$) to the two-point correlation function of the particles; these particles are then chosen to reproduce the luminosity-dependent correlation function as measured in the SDSS by @Zeh04.

Finally, colors are assigned to each galaxy by measuring their local galaxy density (here, the fifth nearest neighbor within a redshift slice), and assigning to them the colors of a real SDSS galaxy with similar luminosity and local density. The local density measure for SDSS galaxies is taken from a volume-limited sample of the CMU-Pitt DR4 Value Added Catalog. This method produces mock galaxy catalogs that reproduces the luminosity and color correlation function of the real sky. The created mock galaxy sample therefore provides a unique tool to assess the performance of the SDSS cluster-finding algorithms in terms of completeness and purity, as well as how the observables of the detected clusters correspond to dark matter halos assuming galaxy clusters do trace the underlying halo population in the universe.

Since precise spectroscopic redshift measurements are only available for the SDSS main sample galaxies [@Str02] and LRGs [@Eis01], we must use photometric redshift estimates for most of the galaxies. In order to accurately reproduce this scenario in the simulations, we scatter the given redshifts of mock galaxies according to the error distributions of photometric redshift estimates, which are obtained by calibrating a sample of $\sim$140,000 SDSS photometric redshifts to their known corresponding spectroscopic measurements coming from the SDSS spectroscopic survey and various other sources such as CNOC2 [@Yee00], CFRS [@Lil95a], DEEP [@Wei05], and 2SLAQ LRG [@Pad05]. The photometric redshifts were computed using a neural network technique by [@Lin07] and in preparation; see also the short discussion in the SDSS DR5 data release paper, [@AMc07]. The comparison between calculated photometric redshifts and measured spectroscopic redshifts is shown in Figure 1 for both the red and blue galaxy samples. The distributions of sampled redshift uncertainties are derived for different magnitude and redshift bins, and found to be well described by a combination of multiple Gaussian fits as shown in Figure 2 for examples. The resulted fitting parameters are used for the scattering of mock galaxy redshifts in the simulation. In the case of applying the cluster-finding technique to the real SDSS data, however, instead of deriving “empirical” error estimates collectively, we would use the photo-z errors that are computed based on the Nearest Neighbor Error estimate method (NNE) [@Lin07], which makes it possible to get an estimate of the error for each individual object. This would better constrain the photometric redshift uncertainty, especially for galaxy samples with photo-z errors depending strongly on magnitudes and the actual redshifts. We find the computed errors correspond reasonably well with the empirical ones derived from statistics, with exceptions only for the catastrophic objects. More details would be discussed in a subsequent paper on the application of the modified adaptive matched-filter technique with SDSS data.

To summarize, the implementation of simulating the observed galaxy redshifts in the mock sample proceeds as follows: for galaxies that satisfy the SDSS spectroscopic target selection criteria we take the given galaxy redshifts as spectroscopic measurements, while for the rest of the sample we use the scattered redshifts to mimic the photometric redshift estimates. As discussed above in §\[sec:Algorithm\], there are a few percent of such galaxies that fall into the redshift and magnitude ranges where we find no good calibrations are available. For these galaxies we just treat them as if there is no redshift information at all to put into the algorithm. We also impose to the mock galaxy catalog an apparent magnitude cut ($r<21$) as we intend to adopt in the SDSS imaging sample. The procedure described above thus provides the a mock catalog with the most similar characteristics to the SDSS survey and it will allow us to explore the performance of the cluster-finding algorithm on real SDSS data.

The modified matched filter algorithm is then run on the mock galaxy catalog, and the detected clusters are compared with matched known halos given in the simulation. We find that the matches are generally robust against details of the matching techniques, as pointed out by @Mil05 [although see also the discussion of various matching algorithms in @Roz07]. Here we adopt a matching criterion of projected separation between the detection and the candidate halo within the virial radius $r_{200}$ and redshift difference $\Delta z<0.05$. To evaluate completeness of the cluster sample, we match each dark halo to the nearest detected cluster within the projected cluster $r_{200}$ and $\Delta z$ of 0.05, while in measurement of purity, we match clusters to their corresponding halos applying the same criteria. In the case of multiple matches which are possible for above matching algorithms, we simply assign the most massive halo within the searching space as the real match. Other methods have also been tried in efforts to refine the matching process, but no significant changes are found in the final results.

Results and Discussions {#sec:Results}
=======================

In this section we present the results of running the modified adaptive matched-filter algorithm on the simulation-based mock catalogs. These include the completeness and purity check of the detected cluster sample, the derived cluster properties such as estimated redshift and richness, and the expected scaling relations that would link the observed clusters to true halo distributions.

Completeness and Purity Check {#sec:Completeness}
-----------------------------

We define the completeness $C$ of the selected cluster sample as a cumulative function of $M_{200}$, the mass within the virial radius inside which the overdensity is 200 times the critical density:

$$C(M_{200}) = {N_{found} \over 
    N_{total} }$$

where $N_{found}$ is the number of halos with mass greater than $M_{200}$ matched to clusters and $N_{total} $ is the total number of halos above that mass.

Figure 3 shows the completeness of the detected cluster sample as a function of redshift and the virial mass of matched dark matter halos, respectively. The cluster sample, which has a richness cut at $\Lambda_{200} > 20$, is over $95\%$ complete for objects with $M_{200} > 2.0\times10^{14} h^{-1} M_\odot$ and $\sim85\%$ complete for objects with masses above $1.0\times10^{14} h^{-1} M_\odot$ in the redshift range of $0.05<z<0.45$. As we will find in the subsequent discussion of cluster scaling relations, the richness cut we impose on the cluster sample contributes to some of the incompleteness for less massive objects because of the large scatter in the cluster richness-mass relation; many of the matched clusters at $\sim 1.0\times10^{14} h^{-1} M_\odot$ are simply scattered below the richness cut and thus not counted to compute the completeness. This can be for sure relieved by lowering the richness cut of the cluster sample, although we choose to stick to this cut for the purity considerations below.

Also from Figure 3a, the completeness level of the cluster sample remains almost flat out to $z\sim0.45$, beyond which it suffers a significant decline. This is at least partly due to the volume limit of the mock catalog which only extends to $z=0.58$. When we scatter the given galaxy redshifts with photometric redshift errors, which become large around $z\sim0.5$, many of the galaxies near the far edge of the light cone are scattered away while fewer galaxies would be shifted into that range, since they are absent from the simulation. The apparent magnitude cut we have applied to the mock galaxy sample may also contribute to incompleteness at high redshift. Taking into consideration the necessary $k$-corrections, the galaxy sample is no longer complete down to the luminosity of $0.4 L^*$, which is the limit assumed throughout the simulation tests. The matched filter therefore loses some power in detecting less rich systems at redshifts of $z\sim0.5$ and beyond since many fewer galaxies would be bright enough to be observable at that distance in the current survey. We have not investigated these effects in detail, though the onset of clear incompleteness corresponds well to the distance at which they become important.

We similarly define the purity P of the selected cluster sample as a cumulative function of cluster richness $\Lambda_{200}$ which is the total cluster luminosity in units of $L^*$ inside its virial radius $r_{200}$

$$P(\Lambda_{200}) = { N_{match} \over 
    N_{tot,\Lambda}},$$

where $ N_{match} $ is the number of clusters with richness greater than $\Lambda_{200}$ matched to halos and $N_{tot,\Lambda}$ is the total number of clusters with richness above $\Lambda_{200}$.

The results of the purity check for the obtained cluster catalog are shown in Figure 4. The sample is over $95\%$ pure for clusters with $\Lambda_{200} > 30$ and around $90\%$ pure for clusters with $\Lambda_{200} > 20$ over the whole redshift range out to $z\sim0.45$. As will be shown in the richness-mass relationship below, these two thresholds in richness correspond to $M_{200} \sim 6.0\times10^{13} h^{-1} M_\odot$ and $M_{200} \sim 4.0\times10^{13} h^{-1} 
M_\odot$, respectively. It is worth to be noted that the lower purity for $\Lambda_{200} > 20$ is clearly going to be affected by halo incompleteness in the simulation, since some of the matched halos for this richness will fall below the mass resolution of the halo catalog, which means the purity we have derived above is in fact probably a lower limit, in similar logic to the completeness arguments.

To ensure a reasonably high purity of selected clusters, we therefore apply a $\Lambda_{200} > 20$ cut for the cluster catalog, which is used for analysis of completeness as well as cluster derived properties and scaling relations. The purity measurement shows a slight but notable uptrend in the last redshift bin of $z\sim0.45-0.5$, which could be similarly explained by the arguments above in the completeness discussions. This reflects a shift in the richness-mass scaling relation at high redshift end where clusters with the same richness measurements may correspond to actually richer and more massive systems because of the under-representation of galaxies that are observable in that redshift range. It is therefore wise to limit the current cluster catalog to a redshift of $z=0.45$ in order to extract a uniform sample for statistical use, though the catalog using real SDSS data may well go deeper reliably.

Derived Cluster Properties and Scaling Relations {#sec:Scaling}
------------------------------------------------

As is discussed in §\[sec:Algorithm\], for each selected cluster a redshift estimate is found for the system by the matched filter that optimizes the detection likelihood at the given galaxy position as cluster center. This measurement is then taken as the estimated redshift for the cluster. Since all the halos have known redshifts in the simulation, by matching the detected clusters to halos following the procedure described in §\[sec:Simulation\] we can compare the derived cluster redshifts with the true redshifts of associated halos.

Figure 5 illustrates the comparison between estimated cluster redshifts and known halo redshifts. For clusters with redshifts below $z=0.25$ where spectroscopic redshift measurements are often available for member galaxies, the derived cluster redshift estimates precisely reproduce the true redshifts of corresponding dark halos. The inclusion of spectroscopic information of input galaxies markedly sharpens the cluster detection likelihood in the line-of-sight dimension and thus provides accurate measurements of the cluster redshifts. In the higher redshift range where spectroscopic measurements become rare and photometric estimates dominate, the plot illustrates a larger dispersion while the matched filter still gives robust determinations of cluster redshifts even with only photometric galaxy redshift information for inputs. We find that the accuracy of the redshift estimates does incease with cluster richness as expected, which is albeit mostly accounted by higher fraction of cluster galaxy members with spectroscopic measurements inside these systems. There is a slight uptrend bias seen at the redshift of $z\sim0.45$, which we see as a similar indication of incompleteness of the input galaxy sample near the high end of the redshift range for this mock catalog because of the volume limit and magnitude cut. The estimated cluster redshift determined from maximum likelihood tends to drift towards smaller values in some cases since the detection probability at higher redshift is suppressed by such effects. We also note the existence of a few serious outliers, which probably represent the occasional scenario when there exists a mismatch between relevant clusters and dark halos due to the projection effects or false positive detections.

The normalized cluster richnesses $\Lambda_{200}$ are also compared with the virial mass $M_{200}$ of matched halos. The results are shown in Figure 6. We find that the richness-mass scaling relation follows

$$\Lambda_{200} = (47.2\pm4.1)\times \left( M_{200}  \over {10^{14} h^{-1} M_\odot} \right )^{1.03\pm0.04} ,$$

which is roughly a linear fit. Whether this is correct or not, clearly, depends upon the details of the simulation input, and the way the simulation was constructed gives no easy clue to what the results should be. What is important in this test, however, is that we recover what is present in the simulations, not what might or might not be present in the real universe. To that end, we have constructed three more plots. The first, Figure 7, compares the cluster richness determined by the present algorithm with the total three dimensional luminosity of the matched halos; the agreement is very good, with no bias evident at either the sparse or the rich end. Given this agreement and the results of Figure 6, the next plot, Figure 8, of the 3-D halo luminosity vs the 3-D halo mass, contains no surprises. The simulated halo mass is, in fact, linear with its total luminosity, and we recover this relationship.

Figure 9 compares the derived cluster virial radius $r_{200}$ from the cluster-finding algorithm and the $r_{200}$ determined from 3-dimensional galaxy overdensities. The agreement is excellent at small virial radii, though there is a strong hint that the algorithm slightly overestimates large virial radii, by seven percent or thereabouts. This is almost certainly due to the assumption of a single NFW profile to describe the cluster; neighboring halos have rather different effects in the cylinder to which the algorithm is sensitive and the corresponding sphere in the simulations, but it is gratifying that the effects are this small. These results further justify our choice to refer our richness measurements to the commonly-used virial radius determined from galaxy overdensities.

It is, however, clear that the scatter in the richness–mass relation derived from the cluster finding algorithm (Figure 6) is somewhat larger than that of the intrinsic richeness-mass relation in the simulations (Figure 8), which can be read as an indication of complications in the cluster-halo matching process, e.g., the inevitable difference between the cluster finder and halo finder regarding fragmentation and merging, differing shapes between the galaxy and mass distributions, and, even further, the variable mass-to-light ratios inside the systems incorporated in the current dark matter simulations. Despite these intrinsic dispersions, the richness-mass scaling relation shows a strong linear correspondence between the observables and the mass, and thus makes it possible to extract the true halo distribution in the Universe from the observed cluster abundance and correlation functions. It is important to note that the simulation from which the catalog was made is a dark-matter-only simulation, and thus effects which may well exist in real clusters and can affect the baryon fraction in the intracluster gas and galaxies (see, for example, [@Kra05]) as a function of cluster mass are absent here, but the fact that we recover the relation found from input 3-D simulations, here just linear, indicates that we should be able to investigate a possibly more complex relationship in the real universe.

Conclusions {#sec:Conclusion}
===========

We present a modified matched filter algorithm which is designed to construct a comprehensive cluster catalog from the Sloan Digital Sky Survey, but is applicable to any deep photometric survey. The technique is fully adaptive to 2-D, 2$\half$-D and 3-D optical surveys, as well as to various cluster scales and substructures.

The cluster-finding algorithm has been tested against a realistic mock SDSS catalog from a large N-body simulation. The results suggest that the selected cluster sample is $\sim 85\%$ complete and over $90\%$ pure for systems more massive than $1.0\times10^{14} h^{-1}$ M$_\odot$ with redshifts up to $z=0.45$. The estimated cluster redshifts derived from maximum likelihood analysis show small errors with $\Delta z < 0.01$, and the normalized cluster richness measurements fit linearly with the virial mass of matched halos, the correct relation in this simulation. This offers hope that the (very likely nonlinear) relation between richness and halo mass which exists in the real universe can be investigated with these techniques.

F.D. thanks H. Lin, H. Oyaizu, and the SDSS photo-$z$ group for providing the photometric redshifts which allowed us to derive the statistics of the photo-$z$ calibration to the spectroscopic redshifts. E.P. is an ADVANCE fellow (NSF grant AST-0649899), also supported by NASA grant NAG5-11489. RHW was supported in part by the U.S. Department of Energy under contract number DE-AC02-76SF00515. This research used computational facilities supported by NSF grant AST-0216105.
