*** Cosmic Variance (Sampling Variance) of the Mean Density *** December 5, 2010: E.Komatsu Imagine that you find lots of galaxies within a given cosmological volume. You then divide the number of galaxies you found by the volume of the survey. This is supposed to be the mean number density - but how accurate is it? When the survey volume is too small, it is probably a very noisy estimate of the true mean density. Then, how large should the survey volume be, for this "sampling variance" (or "cosmic variance" depending on who you talk to) to be smaller than the shot noise given by 1/(the number of galaxies)? This code calculates "sigma," which is a fractional error on the measured mean density of galaxies within a survey volume. It is calculated as: sigma^2 = int dkx dky dkz P(sqrt(kx^2+ky^2+kz^2)) *[sinc(kxLx)sinc(kuLy)sinc(kzLz)]^2 where sinc(x)=sin(x)/x is the usual sinc function, and P(kx,ky,kz) = b^2(1+beta mu^2)^2 P_matter(k) is the galaxy power spectrum with a given linear galaxy bias factor, b, that you specify. Here, the linear redshift distortion factor, beta, is also included, and mu^2 = kz^2/(kx^2+ky^x+kz^2). If you do not wish to include the redshift space distortion factor, you need to set beta=0d0 manually in the code. For the matter power spectrum, we provide the sample data, "wmap5baosn_max_likelihood_matterpower.dat," which was generated using CAMB code for the maximum likelihood parameters given in Table I of Komatsu et al. (2008) [WMAP 5-year interpretation paper] with "WMAP5+BAO+SN". The input file for CAMB is also provided (wmap5baosn_max_likelihood_params.ini). NOTE THAT THIS POWER SPECTRUM IS COMPUTED AT Z=0. In the code, we use the matter power spectrum evolved back to z=30. This isprovided as "wmap5baosn_max_likelihood_matterpower_at_z=30.dat". (The above file at z=0 is not used.) - To compile and use the program, edit Makefile and simply "make" - It will generate an executable called "cosmicvariance" - Running it will ask you for: - redshift range (eg: 1.9 3.5) - linear bias (eg: 2) - angular extensions in x and y directions on the sky in degrees (eg: 10 10) - The code will give you a value of sigma, which you can determine the mean number density of galaxies in the survey, and should be compared to the shot noise given by 1/SQRT(N). (Here, N is the number of objects in the survey.)