Quickly compute the CMB powerspectra and matter transfer functions.
To install PICO type:
$ python setup.py install
(If you don’t have root access, you can append the option --user which installs PICO under your home directory.)
Once you have PICO installed, to do anything you’ll need some data files which actually contain interpolated data. You can find them on the PICO website at https://sites.google.com/a/ucdavis.edu/pico.
After that, typical usage is loading a PICO data file:
>> import pypico >> pico = pypico.load_pico("example_pico_file.dat")
To show possible inputs parameters and output values use:
>> pico.inputs() >> pico.outputs()
And finally, to calculate output values, run:
where inputs is a dictionary with keys for each input returned by pico.inputs()
Installing Plugins for CAMB, CosmoMC, etc..
If all you’d like to do it use PICO from Python with various data files then you do not need to do anything in this section. If on the other hand, you’d like to either
- Plug PICO into your code which currently calls CAMB_GetResults
- Plug PICO into CosmoMC
then you’ll need to follow these instructions.
You can find the various plugin files in a folder plugin in the archive. If you installed PICO via pip or easy_install, you can find the location of the plugins by running:
$ python -c "import pypico; print pypico.get_folder()"
If your code is set up to call the CAMB function CAMB_GetResults, then it should be trivial to use the PICO version called PICO_GetResults instead. The PICO version will fall back on the CAMB version if called with parameters for which it cannot calculate the relevant quantities.
To install the CAMB plugin, do the following:
- Copy plugins/camb/pico_camb.f90 to the folder containing your code
- Add a call fpico_load(file) to load a PICO datafile.
- Replace CAMB_GetResults with PICO_GetResults
- Compile your code, making sure to use the correct include/link flags (as described above).
PICO can also be plugged into CosmoMC.
To install the CosmoMC plugin, do the following:
- Copy plugins/cosmomc/CMB_Cls_pico.f90 and plugins/camb/pico_camb.f90 to the CosmoMC source folder
- Replace driver.f90 in the CosmoMC source folder with the one in plugins/cosmomc
- In your CosmoMC Makefile, replace references to CMB_Cls_simple with references to CMB_Cls_pico
- Add the correct include/link flags to the Makefile (as described above).
- Add the a key pico_datafile to your parameter file.
To install the CosmoSlik plugin, copy plugins/cosmoslik/pico.py to the cosmoslik/models/ folder.