CosmoCoffee Forum Index CosmoCoffee

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

PyCAMB for generating power spectrum of different source
 
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software
View previous topic :: View next topic  
Author Message
Abhishek Maniyar



Joined: 17 Mar 2016
Posts: 9
Affiliation: Laboratoire d’Astrophysique de Marseille

PostPosted: May 24 2017  Reply with quote

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
View user's profile [ Hidden ]
Antony Lewis



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

PostPosted: May 25 2017  Reply with quote

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
View user's profile [ Hidden ] Visit poster's website
Abhishek Maniyar



Joined: 17 Mar 2016
Posts: 9
Affiliation: Laboratoire d’Astrophysique de Marseille

PostPosted: May 25 2017  Reply with quote

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
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.