The

**all_l_exact** format uses the exact full-sky likelihood function given in e.g. Eq. 5 of

astro-ph/0502469.

A .dataset file for an

**all_l_exact** simulation would look something like

Code: Select all

```
name = Planck
has_pol = T
all_l_exact=T
all_l_file = data/Planck.dat
all_l_lmax=2000
```

Then you just need to make the Planck.dat file with the mock data. The columns in this file are

l C_TT (C_TE C_EE [C_BB]) N_T (N_P) f_sky^eff

The brackets are included if

**has_pol = T**, and C_BB if you have compiled cosmomc with

**num_cls=4**.

C_TT (and the polarized ones similarly) are raw C_l + noise (no l(l+1) or 2\pi factors). i.e. they increase on scales below the beam size due to the larger noise there.

Here's some simple code to make a Planck.dat file from a C_l file output by CAMB (in \mu\rm{K}^2):

Code: Select all

```
!Simulate CMB C_l data
!Simple version assuming isotropic noise and full sky
!no lensing, no tensors (check input Cl file has only 4 columns!)
!all parameters hard wired in code
!Data points are max likelihood values
!AL: Sept 2004
program CMB_cl_sim
use AMLutils
implicit none
!parameters
character(LEN=*), parameter :: cl_infile = 'MAPcls.dat'
character(LEN=*), parameter :: out_name = 'planck.dat'
logical :: DoPol = .true., DoTemp = .true.
real :: NoiseVar = 3d-4 !Pessimistic Planck
!in MicroK^2
real, parameter :: fwhm_arcmin = 7. ! 13. !WMAP ~ 13 (0.22 deg min)
real, parameter :: ENoiseFac = 2 !factor more noise on the polarization
integer, parameter :: lmax = 2250
!Other stuff
integer, parameter :: C_T = 1, C_E = 2, C_B = 3, C_C = 4
real :: fwhm_deg = fwhm_arcmin/60
real :: Cl(lmax,4), NoiseCl(lmax)
real amp, xlc, sigma2
integer l,ll
real T, E, TE,B, scal
print *,'lmax = ',lmax
print *,'fwhm_arcmin = ', fwhm_arcmin
print *,'Noise = ',NoiseVar
xlc= 180*sqrt(8.*log(2.))/3.14159
sigma2 = (fwhm_deg/xlc)**2
do l=2, lmax
NoiseCl(l) = NoiseVar*exp(l*(l+1)*sigma2)
end do
Cl=0
B=0
open(unit=1,file=Cl_infile,form='formatted',status='old')
do ll=2,lmax
read (1,*) l, T, E, TE
if (l/=ll) stop 'cl must start at l=2'
scal=twopi/(l*(l+1))
Cl(l,1) = T*scal
Cl(l,2) = E*scal
Cl(l,3) = B*scal
Cl(l,4) = TE*scal
end do
close(1)
call CreateTxtFile(out_name,34)
do l=2, lmax
write (34,'(1I5,6E15.5)') l,(Cl(l,1)+NoiseCl(l)) , &
(Cl(l,C_C)), &
(Cl(l,C_E)+ENoiseFac*NoiseCl(l)), &
! (Cl(l,C_B)+ENoiseFac*Noise%Cl(l,1))*1e6, &
NoiseCl(l)*1e6,ENoiseFac*NoiseCl(l), 1.
end do
close(34)
end program CMB_cl_sim
```

If you want to use a proper simulation rather than taking the data to be the exact model, you should use 1/(2l+1) \sum_m |a_{lm}|^2 in the output, where a_{lm} is a Gaussian generated with variance C_l + N_l, or general a_{lm} from the theory C_l only and then add your own noise.