Page 1 of 1

PyCAMB for generating power spectrum of different source

Posted: May 24 2017
by Abhishek Maniyar
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

Re: PyCAMB for generating power spectrum of different source

Posted: May 25 2017
by Antony Lewis
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).

PyCAMB for generating power spectrum of different source

Posted: May 25 2017
by Abhishek Maniyar
Perfect! Thanks a lot.
I am going for the second option. Seems easier to modify .ini files in python and run CAMB using subprocess.