PyCAMB for generating power spectrum of different source

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Abhishek Maniyar
Posts: 10
Joined: March 17 2016
Affiliation: Laboratoire d’Astrophysique de Marseille

PyCAMB for generating power spectrum of different source

Post by Abhishek Maniyar » May 24 2017

Hello,

In equations.f90 file in CAMB, there's a provision to modify the source(3) term to obtain a power spectrum for different source. I have successfully done this in the past. I would like to do this in PyCAMB because I have to repeat this exercise several times slightly modifying individual parameter every time and hence running a loop in PyCAMB would be easier.
I am interested in the cross-correlation power spectrum of the new source and CMB.
Can someone please tell me which function can I modify in PyCAMB to achieve this? Or is there some trick using which I can run CAMB in a loop changing a parameter in params.ini file every time?
Thank you.

Regards,
Abhishek

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

Re: PyCAMB for generating power spectrum of different source

Post by Antony Lewis » May 25 2017

Best to use CAMB sources for different sources. The "devel" branch on CAMB on github will work through the CAMB wrapper, though there's no specific support in the wrapper for the additional sources (would be useful addition if you want to have a go).

You can also just use python/iniFile.py to easily read and write .ini files and call CAMB program from python using subprocess (CAMB_test_files.py is a complicated example).

Abhishek Maniyar
Posts: 10
Joined: March 17 2016
Affiliation: Laboratoire d’Astrophysique de Marseille

PyCAMB for generating power spectrum of different source

Post by Abhishek Maniyar » May 25 2017

Perfect! Thanks a lot.
I am going for the second option. Seems easier to modify .ini files in python and run CAMB using subprocess.

Post Reply