View previous topic :: View next topic |
Author |
Message |
Abhishek Maniyar
Joined: 17 Mar 2016 Posts: 9 Affiliation: Laboratoire d’Astrophysique de Marseille
|
Posted: 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 |
|
Back to top |
|
 |
Antony Lewis
Joined: 23 Sep 2004 Posts: 1332 Affiliation: University of Sussex
|
Posted: 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). |
|
Back to top |
|
 |
Abhishek Maniyar
Joined: 17 Mar 2016 Posts: 9 Affiliation: Laboratoire d’Astrophysique de Marseille
|
Posted: 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. |
|
Back to top |
|
 |
|