CosmoCoffee Forum Index CosmoCoffee

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

CDM power spectrum from 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 01 2018  Reply with quote

I was running a quick consistency check between power spectra generated in pyCAMB and the command line executable and I'm a bit confused about some of the output. I've created an interpolation object:

Code:
PK=camb.get_matter_power_interpolator(pars,zmin=98,zmax=100,nz_step=100,nonlinear=False,var1="delta_tot")


where 'pars' has the same cosmology as the params.ini used in the executable. The ratio of the two is plot here, which gives exactly what you'd expect:



I then tried to do the same with the CDM power spectrum, by setting changing
Code:
transfer_power_var=2

in the params.ini file, and setting

Code:
PK=camb.get_matter_power_interpolator(pars,zmin=98,zmax=100,nz_step=100,nonlinear=False,var1="delta_CDM")


in the python program. When I compare these two power spectra however, I get:



so the power spectra are no longer the same. Am I right in expecting them to be the same, or am I attempting to get the CDM power spectrum the wrong way? Do var1 and var2 not select which fluids we want power spectra for?
Back to top
View user's profile [ Hidden ]
Antony Lewis



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

PostPosted: March 01 2018  Reply with quote

Your second python example should raise an error because delta_CDM is not recognised (should be all lower case).

You need to set var2 as well as var1 for an autospectrum of delta_cdm: var1='delta_cdm,var2 ='delta_cdm'.

You can also use

camb.model.transfer_power_var.value=2

to change the default variable globally.
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: March 01 2018  Reply with quote

Thanks, that's fixed it! (and yes you're right, delta_CDM did return an error, I had only var1="delta_cdm" to generate the second plot).
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.