Research Blog
Welcome to my Research Blog.
This is mostly meant to document what I am working on for myself, and to communicate with my colleagues. It is likely filled with errors!
This project is maintained by ndrakos
To assign neutrino positions, neutrinos are placed on a coarse grid, then displaced using LPT. This requires a transfer function.
I will use the Code for Anisotropies in the Microwave Background (CAMB). MUSIC has a plugin to read CAMB outputs. The different transfer variables are listed here.
There is now a python wrapper for CAMB. I pip installed CAMB to play around with (see the example notebook here).
Here is some code for generating transfer functions in python:
import camb
pars = camb.CAMBparams()
pars.set_cosmology(H0=70, ombh2=0.022, omch2=0.122)
pars.InitPower.set_params(ns=1)
pars.set_matter_power(redshifts=[zstart], kmax=kmax)
results= camb.get_results(pars)
trans = results.get_matter_transfer_data()
kh = trans.transfer_data[0,:,0] #get kh - the values of k/h at which they are calculated
delta_cdm = trans.transfer_data[model.Transfer_cdm-1,:,0] #Deltac/k^2
delta_b = trans.transfer_data[model.Transfer_b-1,:,0]
delta_nu = trans.transfer_data[model.Transfer_nu-1,:,0]
delta_tot = trans.transfer_data[model.Transfer_tot-1,:,0]
To actually run this in MUSIC, I’ll just use the fortran version, since it automatically creates the correct output files needed for MUSIC.
To install and compile:
git clone https://github.com/cmbant/CAMB.git --recurse-submodules
cd CAMB/fortran
make
To run the code:
./camb ../inifiles/params.ini
The params.ini file is pretty straightforward to modify. I can set the cosmological parameters in here.
As mentioned above, MUSIC already as a CAMB plugin. transfer_camb.cc
contains machinery for reading in the transfer functions from camb output. I just needed to change it so that it stores the neutrino transfer function, rather than discard it as a dummy variable. This just meant reading through the code, and adding neutrinos in the same way cdm particles were treated throughout.
I also needed to add neutrinos to the tf_type types in transfer_function.hh
.
This compiled fine.
Make sure initial positions all make sense
write_neutrino_position
properly writtenMake sure initial velocities make sense
Try in Gadget