Module cosmicBallet.utils.binaryBH

This module contains functions to generate binary black hole waveforms and trajectories. This script is a modified version of the binaryBHexp module that aims to visualize the trajectories of binary black hole mergers using matplotlib animations with trajectories interpolated from data generated by the NRSur7dq2 module. The original copyright and scripting is credited to:

copyright: Copyright (C) 2018 Vijay Varma email: vvarma@caltech.edu author: Vijay Varma license: MIT GitHub Link: https://github.com/vijayvarma392/binaryBHexp/tree/master git clone link: https://github.com/vijayvarma392/binaryBHexp.git

Functions

def get_binary_data(q: float, chiA: , chiB: , omega_ref: , omega_start:  = None, uniform_time_step_size: int = None) ‑> tuple

Function that generates binary black hole waveforms and trajectories.

Args

q : float
mass ratio
chiA : np.array
dimensionless spin of object A
chiB : np.array
dimensionless spin of object B
omega_ref : np.array
reference frequency
omega_start : np.array, optional
start frequency. Defaults to None.
uniform_time_step_size : int, optional
uniform time step size. Defaults to None.

Returns

tuple
Trajectories and waveforms of the binary system
def get_omegaOrb_from_sparse_data(t_sparse: , phiOrb_sparse: ) ‑> 

Function that computes orbital frequency from sparse data using splines.

Args

t_sparse : np.array
Sparse time array
phiOrb_sparse : np.array
Sparse orbital phase array

Returns

omegaOrb_spl (np.array): Orbital frequency array

def get_separation_from_omega(omega: , mA: float, mB: float, chiA: , chiB: , LHat: , pnorder: float = 3.5) ‑> 

Function that calculates the separation of the binary system from the orbital frequency and other parameters.

The separation from omega is not scientifically verified and is only used for visualization purposes (original 
author's note).

Args

omega : np.array
Orbital frequency array
mA : float
Mass of component A
mB : float
Mass of component B
chiA : np.array
Spin of component A
chiB : np.array
Spin of component B
LHat : np.array
Angular Momentum unit vector
pnorder : float
Post-Newtonian order (defaults to 3.5 PN)

Returns

r (np.array): Separation array

def get_trajectory(separation: , quat_nrsur: , orbphase_nrsur: , bh_label: str) ‑> 

Function that determines the trajectory of a component in a binary given the separation, the coprecessing frame quaternion and orbital phase in the coprecessing frame.

Args

separation : np.array
Separation of the binary
quat_nrsur : np.array
Quaternion of the binary system
orbphase_nrsur : np.array
Orbital phase of the binary system
bh_label : str
Label of the black hole component
def get_uniform_in_orbits_times(t: , phi_orb: , PTS_PER_ORBIT: int) ‑> 

Function that calculates the time array for the binary system simulation.

Args

t : np.array
Time array of the simulation
phi_orb : np.array
Orbital phase array of the simulation
PTS_PER_ORBIT : int
Number of points per orbit

Returns

t_sparse (np.array): Time array for the binary system simulation

def spline_interp(newX: , oldX: , oldY: , allowExtrapolation: bool = False) ‑> 

Function that interpolates data using splines.

Args

newX : np.array
New x values
oldX : np.array
Old x values
oldY : np.array
Old y values
allowExtrapolation : bool
Flag to allow extrapolation

Returns

newY (np.array): New y values