CosmoCoffee Forum Index CosmoCoffee

 
 FAQFAQ   SearchSearch  MemberlistSmartFeed   MemberlistMemberlist    RegisterRegister 
   ProfileProfile   Log inLog in 
Arxiv New Filter | Bookmarks & clubs | Arxiv ref/author:

N_eff in pyCAMB
 
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software
View previous topic :: View next topic  
Author Message
Chris Pedersen



Joined: 01 Mar 2018
Posts: 5
Affiliation: University College London

PostPosted: March 15 2018  Reply with quote

Having an issue printing out Neff in pycamb. Trying:

Code:
pars = camb.CAMBparams()
pars.set_cosmology(H0=H0, ombh2=ombh2, omch2=omch2, omk=omk,num_massive_neutrinos=0,
                   neutrino_hierarchy='degenerate',mnu=0.0,YHe=YHe,TCMB=TCMB)
## Primordial parameters
pars.InitPower.set_params(ns=ns, As=As, pivot_scalar=pivot_scalar)
pars.set_matter_power(redshifts=zs, kmax=100.0)
pars.N_eff()


Which outputs:

AttributeError Traceback (most recent call last)
<ipython-input−24-d90bcc49dcbb> in <module>()
8 pars.InitPower.set_params(ns=ns, As=As, pivot_scalar=pivot_scalar)
9 pars.set_matter_power(redshifts=zs, kmax=100.0)
—> 10 pars.Neff()
11 camb.model.transfer_power_var.value=fluid ## Set fluid
12 results = camb.get_results(pars)

AttributeError: 'CAMBparams' object has no attribute 'Neff'

This seems odd because in the link below it looks like this should be a callable function? Apologies if I'm doing something stupid.
http://camb.readthedocs.io/en/latest/_modules/camb/model.html#CAMBparams.N_eff
Back to top
View user's profile [ Hidden ]
Antony Lewis



Joined: 23 Sep 2004
Posts: 1341
Affiliation: University of Sussex

PostPosted: March 15 2018  Reply with quote

Do you have the latest master branch from github installed?
Back to top
View user's profile [ Hidden ] Visit poster's website
Chris Pedersen



Joined: 01 Mar 2018
Posts: 5
Affiliation: University College London

PostPosted: April 08 2018  Reply with quote

I downloaded and installed the latest version so printing Neff now works ok. But I'm unable to get the value to actually change, as below:

Code:
pars = camb.CAMBparams()
pars.set_cosmology(H0=67.24, ombh2=0.0223, omch2=0.115579, omk=0.0, num_massive_neutrinos=0,
                   mnu=0., nnu=0., YHe=0.24, meffsterile=0.0, standard_neutrino_neff=0.,
                   TCMB=2.718, tau=None, neutrino_hierarchy='degenerate')
## Primordial parameters
pars.InitPower.set_params(ns=0.9667,As=2.142e-09,pivot_scalar=0.002,pivot_tensor=0.002,
                         nrun=0, nrunrun=0.0)
pars.set_dark_energy(w=-1,sound_speed=1)
pars.set_matter_power(redshifts=[z1,z2,z3,z4], kmax=100.0)
print(pars.N_eff())


The output for pars.Neff() is always 3.046 no matter what I sent nnu, or standard_neutrino_neff to. Am I attempting to set Neff in the wrong way?
Back to top
View user's profile [ Hidden ]
Display posts from previous:   
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software All times are GMT + 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group. Sponsored by WordWeb online dictionary and dictionary software.