This code calculates the waveforms and SNRs of gravitational burst radiation from a pulsar orbiting a massive BH. We use a numerical kludge method where the relativistic spin-orbital dynamics are specified by the Mathsisson Papetrou Dixon formulation (see the SpinCurvature git repo).
The orbital motion is calculated by solving a set of coupled ODEs numerically and then the waveforms can be calculated. With the waveforms constructed we can then also determine the SNR, using the noise models as described in Robson 2018.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
This code is written in FORTRAN with a gfortran compiler. Other compilers have not been tested. The gfortran installation binaries can be found here, although typically gfortran comes pre-installed on most Linux/Unix systems. If you have Homebew installed on OSX, you can simply run
brew install gcc
After cloning the repo, the first thing to do is to set the path to the output files that the code will produce.This can be found in src/parameters.f
echo 'export SCDir="/Users/tomkimpson/Data/SpinCurv/"' >> ~/.bash_profile
source ~/.bash_profile
Just change the path to some appropriate local destination
You can check the environment variable has been added to bash_profile
by either env
or vim ~/.bashprofile
Set this to point to a local direcory.
The code should then run as is, out of the box. Try
run.py
to compile and run the code. Once you have checked that everything is running OK, you can then start playing. The code structure (modules, subroutines etc.) is outlined below.
If making edits to the code, try to keep to the FORTRAN Style Guide
parameters.f
defines all the system parameters. That is, anything that needs changing (e.g. eccentricity, orbital period, BH mass) can be modified in this module
constants.f
is for calculations with those parameters for use later in the code. It can effectively be ignored - no changes should be necessary to this file
main.f
is where the code program is run from. After setting up the initial conditions (initial_conditions.f
) it then goes on to integrate the equations and save the output (rk.f
).
In turn, rk.f
calls derivatives.f
and tensors.f
to calculate e.g. the curvature tensors, ODEs and then integrates numerically.
plot_trajectory.py
. As on the tin. Can switch between 3d and 2d plotting.
plot_ds.py
. Compares the spatial difference between the lamba=0 and lamba=1 cases. Useful for quickly eyeing Roemer delay. Requires interpolation.
A python wrapper has been provided to compile and run the code, run.py
. We use a -O3
optimization. See the docs for discussion on the optimization flags
We integrate the equations using a Runge-Kutta-Fehlberg algorithm with adaptive stepsize. See Press et al.
- Tom Kimpson