CAMB: lensing

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Nicolas Ponthieu
Posts: 1
Joined: October 19 2004
Affiliation: IAS, Paris
Contact:

CAMB: lensing

Post by Nicolas Ponthieu » October 25 2004

Hi,

I'm a new CAMB user.
I tried to run CAMB with the default parameters file, simply setting do_lensing to 1 and I'm asked to provide a realistic normalization.
I could not find on any of the site i've looked at or in documentation how to fix this and try to have the B mode produced by Weak lensing.

Does one of you guys have the solution ?
Thank you very much in advance.

Cheers,
Nicolas.

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

Re: CAMB: lensing

Post by Antony Lewis » October 25 2004

CAMB computes the linear theory transfer functions, so the unlensed [tex]C_l[/tex] you get depend linearly on the primordial fluctutation power. By default CAMB sets the primordial power in the curvature perturbation (at 0.05 h^{-1} Mpc) to be 1. To obtain realistic results you need to multiply by the actual primordial power, which is O(10^{-5})^2, i.e. A_s \sim 2.5 \times 10^{-9}.

To do this in practice just change the settings in the params.ini file e.g.

scalar_amp(1) = 2.5e-9

The output will then be dimensionless. If you'd like it in \mu K^2 also set

CMB_outputscale = 7.4311e12

(this number is (2.726 \times 10^6)^2).

Note that to get B at all accurately you need to set l_max_scalar and k_eta_max_scalar quite large (e.g. 3000, 10000). Also the result will not be accurate to percent level because CAMB assumes linear evolution of the matter perturbations, whereas B is senstive at some level to non-linear evolution.

Also note that the Aug 2004 CAMB version (and earlier) lensed C_l are not accurate to better than 1% at l > 1500. There will be a new version soon, please let me know if you want to try it.

Lukas Hollenstein
Posts: 16
Joined: March 31 2009
Affiliation: IPhT CEA-Saclay
Contact:

CAMB: lensing

Post by Lukas Hollenstein » June 07 2010

Hi,

using CosmoMC with a slightly modified CAMB and some additional parameters I encountered this issue as well, although A_s is varied in the default range

Code: Select all

param[logA] = 3 2.7 4 0.01 0.01
So my questions is what are the checks

Code: Select all

  if (Cphil3(10) > 1e-7) then … 

  if (RR(1) > 1e-5) then
     write (*,*) 'You need to normalize realistically to use lensing.'
     write (*,*) 'see http://cosmocoffee.info/viewtopic.php?t=94'
   stop
  end if
in "lensing.f90" actually based on? Is it very unsafe to comment the "stop" in those statements to avoid CosmoMC to stop when falling into that trap?

Thanks for your help,
Lukas

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

Re: CAMB: lensing

Post by Antony Lewis » June 07 2010

The check is pretty conservative - if you get an error much the most likely thing is that something is wrong in your modification (or maybe you are a miles from the allowed region of parameter space, in which case check ranges for other parameters you've added).

Lukas Hollenstein
Posts: 16
Joined: March 31 2009
Affiliation: IPhT CEA-Saclay
Contact:

CAMB: lensing

Post by Lukas Hollenstein » June 08 2010

Thanks a lot for the quick reply. Yes, I seem to have been outside the reasonnable range of the additional parameters.

But, in principle, if I comment the stops in the lensing code, the likelihoods of the unreasonnable models will simply be very low, isn't it? Or could the likelihood codes crash in such cases?

Thanks again,
Lukas

Savvas Nesseris
Posts: 73
Joined: April 05 2005
Affiliation: UAM/IFT
Contact:

CAMB: lensing

Post by Savvas Nesseris » July 27 2015

Hi,

Sorry for the thread necromancy, but I'm having the same issue with a slightly modified CAMB. The problem is that in my case, I'm sure that I'm within reasonable and interesting to explore parameter ranges.

Also and more importantly, the flag "stop_on_error = F" doesn't seem to prevent CosmoMC from bombing out, so I think I will take the risk and comment out the relevant lines in /camb/lensing.f90 (maybe just the "stop" and not the warning).

Cheers,
Savvas

Jason Dossett
Posts: 97
Joined: March 19 2010
Affiliation: The University of Texas at Dallas
Contact:

CAMB: lensing

Post by Jason Dossett » July 27 2015

Hi Savvas,

It may also be good to inject a call to GlobalError() there too. That way cosmoMC rejects that sample where CAMB bombs. You will need to add a

Code: Select all

use Errors

at the beginning of the module if you choose to do this though. This is what I do with ISiTGR.

Savvas Nesseris
Posts: 73
Joined: April 05 2005
Affiliation: UAM/IFT
Contact:

CAMB: lensing

Post by Savvas Nesseris » July 27 2015

Hi Jason,

Good point, thanks!

Cheers,
Savvas

Post Reply