iCosmo: an interactive cosmology package
^{1}
UMR 7158 (CNRS)/Service d’Astrophysique, AIM, CEA Saclay,
91191
GifsurYvette Cedex,
France
email: refregier@cea.fr
^{2}
Institute for Atronomy, ETH Hoenggerberg Campus, Physics
Department, 8093
Zurich,
Switzerland
^{3}
Oxford Astrophysics, Department of Physics,
Keble Road,
Oxford, OX1 3RH, UK
^{4}
SUPA, University of Edinburgh,
Royal Observatory Edinburgh, EH9 3HJ, UK
Received: 8 October 2008
Accepted: 17 October 2010
Aims. The interactive software package iCosmo, designed to perform cosmological calculations is described.
Methods. iCosmo is a software package to perfom interactive cosmological calculations for the lowredshift universe. Computing distance measures, the matter power spectrum, and the growth factor is supported for any values of the cosmological parameters. It also computes derived observed quantities for several cosmological probes such as cosmic shear, baryon acoustic oscillations, and type Ia supernovae. The associated errors for these observable quantities can be derived for customised surveys, or for preset values corresponding to current or planned instruments. The code also allows for calculation of cosmological forecasts with Fisher matrices, which can be manipulated to combine different surveys and cosmological probes. The code is written in the IDL language and thus benefits from the convenient interactive features and scientific libraries available in this language. iCosmo can also be used as an engine to perform cosmological calculations in batch mode, and forms a convenient adaptive platform for the development of further cosmological modules. With its extensive documentation, it may also serve as a useful resource for teaching and for newcomers to the field of cosmology.
Results. The iCosmo package is described with a number of examples and command sequences. The code is freely available with documentation at http://www.icosmo.org, along with an interactive web interface and is part of the Initiative for Cosmology, a common archive for cosmological resources.
Key words: cosmology: miscellaneous / cosmology: theory / cosmological parameters / methods: numerical
© ESO, 2011
1. Introduction
Cosmology is a rapidly advancing field thanks to recent progress in instrumentation, numerical simulations, and theoretical methods. The past few decades have provided a previously innaccessible wealth of data with the advent of large surveys of the cosmic microwave background, galaxy clustering, cosmic shear, clusters, and supernovae (see Spergel et al. 2007; Dunkley et al. 2009, for more recent results and references therein). One of the challenges of cosmology is to link the derived observable quantities from these cosmological surveys with the parameters of an underlying cosmological model. Another necessary task is to predict the performance of future surveys and future observational probes in order to maximise the potential of future experiments. Existing publicly available computational tools (Seljak & Zaldarriaga 1996; Lewis et al. 2000; Lewis & Bridle 2002) are widely used within the cosmological community, yet there is at present no unified tool that considers the lowredshift universe and its associated probes.
In this paper, we present iCosmo, a software package that performs interactive cosmological calculations. The code can also be used as an engine to perform predictions for any cosmological model, and it also forms a convenient platform for developing further cosmological modules. With its extensive documentation, it may also serve as a useful resource for teaching and for newcomers in the field of cosmology.
The code calculates distance measures, the linear and nonlinear matter power spectrum, the growth factor, volume elements and other quantities for any CDM cosmological model. It also computes derived observable quantities for several cosmological probes such as cosmic shear, baryonic acoustic oscillations (BAO), and type Ia supernovae. The associated errors for these observables can be described for arbitrary survey parameters, or alternatively, for a number of preset values corresponding to planned surveys and experiments. The code also provides forecasts for future cosmological surveys, by allowing the user to compute, manipulate, and combine Fisher matrices. The code is written in the IDL language, so it benefits from the simple syntax, large scientific libraries and convenient interactive plotting environment of this language. In particular, all the above calculations can be completed in only a few lines of code.
The code is freely available at http://www.icosmo.org with full documentation and help files. It is part of the Initiative for Cosmology web site, and it includes an interactive web interface (see description in Kitching et al. 2009).
In this paper, we describe the main features of iCosmo and provide several examples illustrating its use. In Sect. 2, we describe the main conventions and architecture of the code. In Sect. 3 we describe how the code can quickly calculate the evolution of the main cosmological quantities, such as distance measures and growth factor, as a function of redshift. In Sect. 4, we describe how iCosmo calculates the derived observable quantities for cosmic shear, BAO and type Ia supernovae. Section 5 shows how the code can compute and manipulate Fisher matrices. Our conclusions and possible future developments are presented in Sect. 6.
Main iCosmo routines and a brief description of their use.
2. General presentation
The iCosmo code is a package of routines written in the IDL language. It is divided into several directories corresponding to the different levels of the calculations:

general, plotting: General utility and plotting routines;

cosmo, expt: Routines to define fiducial cosmological and survey parameters and compute basic cosmological quantities;

lensing, bao, sne: Routines to compute cosmic shear, BAO and type Ia supernovae observables;

fisher: Routines to create, plot and manipulate Fisher matrices for cosmological forecasts.
The routines in each of the directories make use of the variable structures in IDL. Their functionality is indicated by the first few letters of their name with the following conventions:

set: set up basic structures with calculation variables;

mk: make or compute a new structure using the information in an input structure;

get: get a substructure or derived quantity from an existing structure;

plt: plot;

rd, wt: read and write data from and into a file.
Table 2 shows an example of a typical call sequence for iCosmo, with the different levels of the code separated by horizontal lines. The following sections describe the use of each level of the code with examples of call sequences and output figures.
Example of a typical call sequence for iCosmo, with different levels of the code separated by horizontal lines.
3. Basic cosmological quantities
The first level in iCosmo defines the cosmological model and computes basic cosmological quantities; see, e.g., Peacock (1999) for their definitions and Refregier et al. (2004) for conventions. The first step is to define the fiducial parameter structure using the set_fiducial function (see Inst. 1 in Table 2). The resulting fid structure contains the following three substructures:

cosmo: input cosmological parameters;

expt: experiment parameters, such as survey area, number of galaxies or SNe as a function of redshift, or preset surveys;

calc: calculation parameters, such as redshift and krange, fitting functions, etc.
These parameters have default values that can be easily modified using the syntax of instruction 1 in Table 2.
The next step is to compute all the basic cosmological quantities using the mk_cosmo function (see Inst. 2 in Table 2). The resulting cosmo structure is organised into several substructures:

const: all original fiducial quantities, as well as constantquantities derived from the fiducial parameters (e.g., the Hubbleradius);

evol: evolving scalar quantities such as distance measures, the growth factor, tabulated as a function of redshift;

pk: Linear and nonlinear matter power spectrum P(k,z) tabulated as a function of wavenumber k and redshift z.
The evolving scalar quantities can then be plotted easily using the plt_cosmo routine (see Inst. 3 in Table 2). As an example, the following call sequence:
⟩ fid=set_fiducial(cosmo={w0:0.9},calc={fit_tk:1})
⟩ cosmo=mk_cosmo(fid)
⟩ plt_cosmo,cosmo,“z”,“da”
produces Fig. 1 which shows the angular diameter distance D_{A}(z) as a function of redshift z, defined in a flat universe by (1)where χ(z) represents the comoving radial distance, H(z) the Hubble parameter, and c the speed of light. In all figures below, the fiducial cosmology is set to [h = 0.7,Ω_{b} = 0.045,Ω_{m} = 0.3,Ω_{Λ} = 0.7,w_{0} = − 0.95,w_{a} = 0.0,n = 1.0,τ = 0.09,σ_{8} = 0.8], unless otherwise stipulated. For example, the call sequence above changes w_{0} to − 0.9, which is used in the rest of this paper.
Fig. 1 Example of an iCosmo output showing the angulardiameter distance D_{A}(z) as a function of redshift. See text for command sequence. 

Open with DEXTER 
As an example of the plotting functionality, the plotting routine plt_pk can be used to plot the matter power spectrum P(k,z) as a function of wavenumber k at a redshift z, where P(k) is defined as (2)and δ(k) represents matter fluctuations in Fourier space. For example, Fig. 2 shows the linear and nonlinear power spectrum at z = 0 and 1 and is produced by the additional sequence:
⟩ plt_pk,cosmo,z=0,xran=[0.001,10.]
⟩ plt_pk,cosmo,z=0,/over,/linear,linestyle=2
⟩ plt_pk,cosmo,z=1,/over,color=2
⟩ plt_pk,cosmo,z=1,/over,/linear,linestyle=2, color=2
The keyword over can be used to overlay several results on a single figure.
Fig. 2 Matter power spectrum at z = 0 and 1, for top and bottom lines, respectively. Linear and nonlinear power spectra are shown as dashed and solid lines. These plots were derived using the plt_pk routine. 

Open with DEXTER 
4. Derived cosmological observable quantities
The next level of iCosmo consists in the calculations of the derived observables related to different cosmological probes. At present, cosmic shear, baryon acoustic oscillations, and type Ia supernovae are supported. The underlying physics of each of these probes is described below.
4.1. Cosmic shear
As light travels towards us from distant galaxies, its path is perturbed by intervening matter along the line of sight. This causes distortions in the background images and is known as gravitational lensing. To first order this can be described by a distortion matrix: (3) where δθ_{i}(θ) is the deflection vector that results from the lensing. The distortion matrix captures two effects of gravitational lensing: the observed image can be dilated or contracted, which is described by the convergence κ, and the image can also be stretched and compressed along (and at 45° from) the xaxis, which is described by the shear component γ_{1} (γ_{2}).
Cosmic shear – the statistical measure of shear (γ_{1}, γ_{2}), uses the two point function of the shear field as a cosmological observable, given by (4)where the weighting function is given by (5)where and D_{A} is the angulardiameter distance. In Eq. (4), the autocorrelation is given for i = j and the crosscorrelation for i ≠ j, where i and j correspond to galaxy populations at different redshifts. The galaxy distribution function is given by n_{i}(χ), i.e. the probability of finding a galaxy at a distance χ, and is normalised to ^{∫}dχn_{i}(χ) = 1.
In iCosmo, cosmic shear is implemented using shear power spectrum tomography as described in references Hu (1999), Hu & Jain (2004), Refregier et al. (2004) and Amara & Réfrégier (2007). The uncertainties ΔC_{ij}(ℓ) are calculated under the assumption that the twopoint function is Gaussian.
4.2. Baryon acoustic oscillations
In the early Universe, just before decoupling, baryons and photons were coupled through Thomson scattering and Coulomb interactions. The photonbaryon fluid was subject to two competing effects: collapse due to gravitational instability and repulsion due to outward pressure. These two effects created oscillations in the fluctuation field, visible today in the Cosmic Microwave Background (CMB, Peebles & Yu 1970; Sunyaev & Zeldovich 1970), as well as in the galaxy distribution. In Fourier space, this effect corresponds to a series of acoustic peaks, dubbed Baryon Acoustic Oscillations (BAOs). They can be visualised by considering the ratio of a matter power spectrum with baryons, to one without: P^{b}(k) / P^{nob}(k), and in this case are also called “wiggles”.
By measuring the BAOs in the matter power spectrum, it is possible to extract a characteristic BAO scale present in both the radial (y) and tangential (y′) directions (see Sect. 2.2 of Blake et al. 2006): (6)where r(z) corresponds to the comoving radial distance, H(z) to the Hubble parameter, s to the comoving sound horizon at recombination and c to the speed of light. The reviews by Peacock et al. (2006) and Albrecht et al. (2006) concluded that the measurement of the BAO scale was a fundamental tool for future precision cosmology.
To use the information contained in the BAO scale, it is necessary to have an estimate of the accuracy with which a given survey can measure the scale. In the current version of iCosmo, we use the analytic expression derived in Blake et al. (2006) for the accuracy of the measurement on the BAO scale (though there are several approaches for using information from BAOs, as shown in Rassat et al. 2008). This analytic expression was derived from simulations and depends on the central redshift z of the survey, the total volume V of the survey, and the average number density of galaxies. For the moment, photometric redshift errors are not included in the iCosmo BAO module, though it is given in the accuracy expression of Blake et al. (2006). The expression for the accuracy measurement is given by Eqs. (6)–(9) in Blake et al. (2006).
4.3. Type Ia supernovae
Type Ia supernovae are assumed in cosmology to behave as standard candles; i.e., the rate with which the brightness of a supernova declines is assumed proportional to its intrinsic luminosity. Thus by measuring the light curves of distant supernovae, it is possible to measure their distance, and by obtaining spectra one can compare their distanceredshift relation, which is highly dependent on cosmological parameters.
The derived observable for type Ia supernovae is therefore the apparent magnitude m(z) at a given redshift z, related to the luminosity distance by (7)%where the H_{0}independent luminosity distance D_{L}(z) is given by (8)The normalisation parameter ℳ is given by (9)where M is the absolute magnitude.
The uncertainty on the magnitude is given by Kim et al. (2004): (10) where σ_{ν} accounts for the scatter in peculiar velocities, σ_{m} the observed variance, and N_{z} is the number of supernovae redshift bins.
4.4. Derived cosmological observables with iCosmo
A typical call sequence is given in Instructions 5–8 in Table 2. The sequence first defines the survey using mk_survey and then computes the derived observable using mk_cl_tomo, mk_bao, mk_sne, for lensing tomography, BAO and SNe, respectively. The statistical errors in these observables for the fiducial survey can be derived using the correspondng mk_cov routines listed in Table 1.
As an example, the following produces Fig. 3, a plot of cosmic shear power spectra for DUNE (Refregier et al. 2008) with its associated 1σ error bars:
⟩ fid=set_fiducial(“DUNE”, expt_in={sv1_n_zbin:2})
⟩ cosmo=mk_cosmo(fid)
⟩ sv=mk_survey(fid,“sv1”)
⟩ cl=mk_cl_tomo(fid,cosmo,sv)
⟩ cl_cov=mk_cl_cov_tomo(fid,cl,sv)
⟩ plt_cl,cl,[1,1],cl_cov,/errors,yran=[1e7,1e3]
⟩ plt_cl,cl,[0,1],cl_cov,/errors,/over, linestyle=1
⟩ plt_cl,cl,[0,0],cl_cov,/errors,/over, linestyle=2
The different power spectra correspond to two different tomographic redshift bins with median redshifts 0.68 and 1.36, as well as their crosspower spectra. Similar call sequences can produce predictions and errors for the BAO distance measures and for SNe Hubble diagrams.
Fig. 3 The cosmic shear power spectrum and associated 1σ error bars for the DUNE/Euclid cosmic shear survey for the 1st (upper line) and 2nd (middle line) tomographic bins (with median redshifts of 0.68 and 1.36 respectively) as well as the crosscorrelation between the bins (lower line). 

Open with DEXTER 
5. Fisher matrices
The final level of iCosmo is related to the computation and manipulation of Fisher matrices to assess the constraints on cosmological parameters that can be achieved with future surveys.
5.1. The Fisher information matrix
It is possible to forecast the precision with which a given experiment can constrain cosmological parameters using the Fisher Information Matrix (FIM, see Tegmark et al. 1997, for a detailed derivation). A method based on the FIM requires the following ingredients as input:

A set of cosmological parameters θ = (θ_{1},θ_{2},...,θ_{i}) for which one requires predicted constraints;

A choice of underlying fiducial cosmology;

A set of measurements x = (x_{1},x_{2},...,x_{n}), for e.g., this could be the shear power spectrum C(ℓ) over a range ℓ = 1...n;

A cosmological model for how the observable depends on cosmological parameters, i.e. a model for calculating C(ℓ) = C(ℓ,θ);

An estimate of the uncertainty on the observable, i.e. in our example an estimate of ΔC(ℓ). This may depend on the experiment (instrument noise, shot noise, etc.) as well as on the data estimator (cosmic variance).
In practise, for a given observable C(ℓ,θ), assumed to have Gaussian errors, the Fisher matrix can be calculated using (12)For example, the coefficients of the Fisher matrix for the supernovae calculation is obtained by calculating (see Tegmark et al. 1998; Huterer & Turner 2001) (13)where the sum is over redshift bin.
When a vector of parameters are allowed to vary, marginalised parameter constraints can be obtained by (14)This equation provides a lower limit on the constraints one can expect to attain for a given survey and fiducial cosmology. When all other cosmological parameters are fixed, the constraint on a parameter can be estimated by (15)
5.2. Calculating Fisher matrices with iCosmo
For this purpose, Fisher matrices can first be computed using the mk_fisher routines for each probe (see Table 1). The computation is done by taking excursions from the fiducial cosmological model for each of the parameters of interest. Fisher matrices can be combined using the combine_fisher routine to derive joint cosmological constraints with several surveys and probes. The routine margin_fisher can be used to marginalise over unwanted parameters. The resulting contraints can be plotted using the plt_fisher routines.
A typical call sequence to compute and plot Fisher matrices can be found in instructions 9–11 in Table 2. As an example, the following sequence computes the Fisher matrices for a DUNE cosmic shear survey, a full sky BAO spectroscopic survey (20 000 deg^{2}), and their combination:
⟩ fid_lens=set_fiducial(“DUNE”)
⟩ fid_bao=set_fiducial(“bao_halfsky”)
⟩
⟩ sv_lens=mk_survey(fid_lens,“sv1”)
⟩ sv_bao=mk_survey(fid_bao,“sv2”)
⟩
⟩ f_lens=mk_fisher_lens(fid_lens,sv_lens)
⟩ f_bao=mk_fisher_bao(fid_bao,sv_bao)
⟩ f_comb=comb_fisher(f_lens,f_bao)
The following call sequence produces Fig. 4 showing the 68% CL constraints on the dark energy parameters Ω_{DE} and w_{0} expected for each surveys separately (blue and red ellipse) and jointly (solid green ellipse).
⟩ margin_fisher,f_lens,f_lens2,[0,1,0,0,0,0,0,1]
⟩ margin_fisher,f_bao,f_bao2,[0,1,0,0,0,1]
⟩ margin_fisher,f_comb,f_comb2,[0,1,0,0,0,0,0,1]
⟩ plt_fisher_2p,f_bao2,/nofill,color=2
⟩ plt_fisher_2p,f_lens2,/nofill, $ linestyle=2,/over
⟩ plt_fisher_2p,f_comb2,/over,color=3
The margin_fisher routine was used to retain only the parameters to be plotted, and marginalise over all the other parameters.
Fig. 4 Marginalised 68% CL constraints on the dark energy parameters Ω_{DE} and w_{0}, expected for the DUNE cosmic shear (blue), a full sky BAO survey (red) and their combination (solid green). This figure was derived using the Fisher matrix routines of iCosmo. 

Open with DEXTER 
6. Conclusions
The iCosmo package provides a convenient and flexible interactive tool for cosmological calculations, and it can also be used as a computation engine in batch mode. With all the builtin IDL libraries, it is also a convenient platform for developing other cosmological routines and for teaching. The code, along with an
interactive web tool Kitching et al. (2009) and various cosmological resources are freely available at at http://www.icosmo.org.
In the future, we plan to add more features to the code, such as the halo model, higher order clustering statistics, and interfaces with CMB Boltzmann codes. Contributions from the community are encouraged.
Acknowledgments
The authors thank the many people who have contributed to iCosmo over the years, particularly, Richard Massey, David Bacon, Joel Berge, Florian Pacaud, Romain Teyssier, JeanBaptiste Juin, Dominique Ivon, Ivan Debono, Sarah Bridle, Andrew Hodgson, Benjamin Joachimi, Chaz Shapiro, Andy Taylor, Licia Verde, Martin Kunz, and Francisco Castander. T.D.K. is supported by STFC Rolling Grant Number RA0888.
References
 Albrecht, A., Bernstein, G., Cahn, R., et al. 2006 [arXiv:astroph/0609591] [Google Scholar]
 Amara, A., & Réfrégier, A. 2007, MNRAS, 381, 1018 [NASA ADS] [CrossRef] [Google Scholar]
 Blake, C., Parkinson, D., Bassett, B., et al. 2006, MNRAS, 365, 255 [NASA ADS] [CrossRef] [Google Scholar]
 Dunkley, J., Komatsu, E., Nolta, M. R., et al. 2009, ApJS, 180, 306 [NASA ADS] [CrossRef] [Google Scholar]
 Hu, W. 1999, ApJ, 522, L21 [NASA ADS] [CrossRef] [Google Scholar]
 Hu, W., & Jain, B. 2004, Phys. Rev. D, 70, 043009 [NASA ADS] [CrossRef] [Google Scholar]
 Huterer, D., & Turner, M. S. 2001, Phys. Rev. D, 64, 123527 [NASA ADS] [CrossRef] [Google Scholar]
 Kim, A. G., Linder, E. V., Miquel, R., & Mostek, N. 2004, MNRAS, 347, 909 [NASA ADS] [CrossRef] [Google Scholar]
 Kitching, T., Amara, A., Rassat, A., & Refregier, A. 2009 [arXiv:0901.3143] [Google Scholar]
 Lewis, A., & Bridle, S. 2002, Phys. Rev. D, 66, 103511 [NASA ADS] [CrossRef] [Google Scholar]
 Lewis, A., Challinor, A., & Lasenby, A. 2000, ApJ, 538, 473 [NASA ADS] [CrossRef] [Google Scholar]
 Peacock, J. A. 1999, Cosmological Physics, ed. J. A. Peacock (Cambridge, UK: Cambridge University Press), 704 [Google Scholar]
 Peacock, J. A., Schneider, P., Efstathiou, G., et al. 2006, ESAESO Working Group on Fundamental Cosmology, Tech. Rep. [Google Scholar]
 Peebles, P. J. E., & Yu, J. T. 1970, ApJ, 162, 815 [NASA ADS] [CrossRef] [Google Scholar]
 Rassat, A., Amara, A., Amendola, L., et al. 2008, MNRAS, submitted [arXiv:0810.0003] [Google Scholar]
 Refregier, A., Massey, R., Rhodes, J., et al. 2004, AJ, 127, 3102 [NASA ADS] [CrossRef] [Google Scholar]
 Refregier, A., Douspis, M., and the DUNE Collaboration 2008, in SPIE Conf. Ser., 7010 [Google Scholar]
 Seljak, U., & Zaldarriaga, M. 1996, ApJ, 469, 437 [NASA ADS] [CrossRef] [Google Scholar]
 Spergel, D. N., Bean, R., Doré, O., et al. 2007, ApJS, 170, 377 [NASA ADS] [CrossRef] [Google Scholar]
 Sunyaev, R. A., & Zeldovich, Y. B. 1970, Ap&SS, 7, 3 [NASA ADS] [Google Scholar]
 Tegmark, M., Taylor, A. N., & Heavens, A. F. 1997, ApJ, 480, 22 [NASA ADS] [CrossRef] [Google Scholar]
 Tegmark, M., Eisenstein, D. J., & Hu, W. 1998, in Fundamental Parameters in Cosmology, XIIIe Rencontres de Moriond, ed J. Tran Thanh Van, (France, Paris: Éditions Frontières) [arXiv:astroph/9804168] [Google Scholar]
All Tables
Example of a typical call sequence for iCosmo, with different levels of the code separated by horizontal lines.
All Figures
Fig. 1 Example of an iCosmo output showing the angulardiameter distance D_{A}(z) as a function of redshift. See text for command sequence. 

Open with DEXTER  
In the text 
Fig. 2 Matter power spectrum at z = 0 and 1, for top and bottom lines, respectively. Linear and nonlinear power spectra are shown as dashed and solid lines. These plots were derived using the plt_pk routine. 

Open with DEXTER  
In the text 
Fig. 3 The cosmic shear power spectrum and associated 1σ error bars for the DUNE/Euclid cosmic shear survey for the 1st (upper line) and 2nd (middle line) tomographic bins (with median redshifts of 0.68 and 1.36 respectively) as well as the crosscorrelation between the bins (lower line). 

Open with DEXTER  
In the text 
Fig. 4 Marginalised 68% CL constraints on the dark energy parameters Ω_{DE} and w_{0}, expected for the DUNE cosmic shear (blue), a full sky BAO survey (red) and their combination (solid green). This figure was derived using the Fisher matrix routines of iCosmo. 

Open with DEXTER  
In the text 