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
This post contains code to assign velocity to the particles in C. I did this in a previous post in python, but we need it in a form that will be incorporated into MUSIC, and eventually Cholla.
Note that I am embarrassingly rusty at C, and I am not sure how efficiently I coded this! It does give the same answer as the python code though.
To assign velocity directions, we need a way to divide the sphere into equal area elements. For the python code I used the package “healpy” which is the python version of Healpix to do this.
In the C version, I created a lookup table for \(N_{\rm side}=2,3,4,5,6\) (note the number of directions at each grid point will be \(12 N_{\rm side}^2\)).
For Cholla, we need to decide between the following options: