CAMB Warning : root:getting CMB power spectra to higher L than calculated, may be innacurate/zeroed.

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Ayan MitraAM
Posts: 6
Joined: March 07 2019
Affiliation: Energetic Cosmos Laboratory

CAMB Warning : root:getting CMB power spectra to higher L than calculated, may be innacurate/zeroed.

Post by Ayan MitraAM » April 12 2019

Hi Antony,
While working on a project in CAMB, I keep getting a warning with l_max, I have stripped off the entire remaining code and come down to the bare bones to check them, which is shared below, and this would still give me a warning (for basically anything beyond l = 2400)
I did have a look at previous posts on similar topics including this one : viewtopic.php?t=3123
and I do have the updated version :

Code: Select all

Using CAMB version 1.0.4
So for l_max <5000 , why is this warning appearing ? Ideally I would like to test for even smaller scales i.e. > 5000.

Code: Select all

import camb
from camb import model, initialpower
print "Using CAMB version", camb.__version__
pars = camb.CAMBparams()
import numpy as np
pars.set_cosmology(H0=67.5, ombh2=0.022, omch2=0.122, mnu=0.06, omk=0, tau=0.06)
pars.InitPower.set_params(As=2.36e-9, ns=0.965, r=0.0)

results_original = camb.get_transfer_functions(pars)
lmax=2401
r = 0
inflation_params = initialpower.InitialPowerLaw()
inflation_params.set_params(ns=0.96, r=r)
results_original.power_spectra_from_transfer(inflation_params) #warning OK here, not changing scalars
cl = results_original.get_total_cls(lmax, CMB_unit='muK')
plt.semilogx(np.arange(lmax+1),cl[:,0],'*',label='CAMB initial power')
This would return for

Code: Select all

 n=2401, Cl = 0
and the warning :

Code: Select all

root:getting CMB power spectra to higher L than calculated, may be innacurate/zeroed.
Thanks,
Ayan

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: CAMB Warning : root:getting CMB power spectra to higher L than calculated, may be innacurate/zeroed.

Post by Antony Lewis » April 12 2019

You need to set the calculated lmax using camb.model.CAMBparams.set_for_lmax before calculating results.

Post Reply