This is an add-on to CAMB and CosmoMC to enable the use of general reionization histories parametrized by a set of principal component (PC) basis functions.
Two versions of the modified code are available. The first includes only the files that we have modified:
Download modified files only
These files can be incorporated into existing copies of the most recent (as of June 2009) versions of CAMB (Feb. 2009) and CosmoMC (June 2008) either by adding _rpc to the end of the filenames in the Makefile or by overwriting the original files. The code should then compile as usual.
The other version includes the full CAMB and CosmoMC codes with the reionization PC modifications:
Download full code
These are gzipped tarfiles (extract with tar -xzvf camb_rpc[_full].tar.gz). Changes to the original code within each file are bracketed by comments labeled RPC.
The following instructions describe how to use this add-on to CAMB and CosmoMC. For more information on using the original versions of these codes, see the CosmoMC readme.
For use with the default configuration from Ref. , simply edit the entries for the principal component amplitudes m_amp* found in params_rpc.ini in the RPC section following the standard reionization parameters.
For other configurations, the 3 main inputs for setting the reionization history xe(z) are:
The default configuration uses xez.dat for the fiducial xe(z) and xepcs.dat for the PCs. This fiducial model has constant xe=0.15 over the range 6 < z < 30, and there are 95 redshift bins of width dz=0.25. The PCs are normalized using the conventions of Ref. . Note that the code has not been tested for ionization variations at z < 6 since there is strong evidence from quasar spectra that hydrogen is fully ionized after redshift 6.
In addition to the usual output from CAMB, the reionization history is written to a file if one is specified using xe_out. The format is the same as for the fiducial xe(z) file.
The redshift bins for the fiducial model and the PCs are expected to be identical, and should only span the range over which the reionization history is to be varied. Outside of this range, the ionization fraction is set to nearly zero at high z (i.e. whatever the residual post-recombination ionization fraction is), and is set to one at low z (or slightly more than one for the standard helium reionization settings).
The order of the redshift bins in the fiducial model and PC files can be either increasing or decreasing, but the principal component rows should be in order of increasing variance (i.e., starting with the best-measured component).
Other reionization basis functions may be used instead of principal components, as long as the file listing these functions is in the correct format as described above.
The instructions for CosmoMC are similar to those for CAMB. Files for the fiducial ionization history and PCs are the same. The example params_rpc.ini and distparams_rpc.ini files provided are set up to vary 5 out of a total of 7 ionization PCs in an MCMC likelihood analysis of CMB data. The total number of PCs allowed can be changed from 7 by changing num_rpc in settings_rpc.f90 and adding or subtracting lines for the PC amplitudes in params_rpc.ini and distparams_rpc.ini. The PC amplitudes come after all of the original CosmoMC parameters, so they start with parameter 14. Note that if you change num_rpc, you will also need to change the parameter numbers of the derived parameters in distparams_rpc.ini (starting at parameter 14+num_rpc).
Since the sum of PCs can in general exceed the physical bounds on the reionization history corresponding approximately to 0 < xe < 1, it may be desirable to include priors on the PC amplitudes limiting this behavior. Top hat priors for this purpose are derived in Ref. , Eq. (10). These priors may be applied in CosmoMC by setting the minimum and maximum allowed parameter values for the PC amplitudes in params_rpc.ini. (If using getdist for analysis of the chains, the limits variables in distparams.ini for the PC amplitudes should be set to the same values.) Note that although these priors restrict the range of xe, they do not strictly require it to be between zero and one for reasons discussed in Ref. .
Parameter 4 is no longer used for the reionization optical depth in this modified version of CosmoMC. Instead, the optical depth is derived from the PC amplitudes and written to the parameter chain output after sigma_8 (with the default setting of 7 reionization PCs, tau appears as parameter 25).
 ''Model-independent constraints on reionization from large-scale cosmic microwave background polarization,'' Mortonson & Hu (2008) ApJ, 672, 737, arXiv:0705.1132
 ''Impact of reionization on CMB polarization tests of slow-roll inflation,'' Mortonson & Hu (2008) PRD, 77, 043506, arXiv:0710.4162
 ''Reionization constraints from five-year WMAP data,'' Mortonson & Hu (2008) ApJ Lett., 686, 53, arXiv:0804.2631
 ''CMB polarization features from inflation versus reionization,'' Mortonson, Dvorkin, Peiris, & Hu (2009) PRD 79, 103519, arXiv:0903.4920