In [1]:

```
import numpy as np
import matplotlib.pyplot as P
%matplotlib inline
import gwsurrogate
```

In [2]:

```
# This can take a few minutes
gwsurrogate.catalog.pull('NRHybSur3dq8')
```

Out[2]:

In [3]:

```
sur = gwsurrogate.LoadSurrogate('NRHybSur3dq8')
```

In [4]:

```
help(sur)
```

In [5]:

```
q = 7
chiA = [0, 0, 0.5]
chiB = [0, 0, -0.7]
dt = 0.1 # step size, Units of M
f_low = 5e-3 # initial frequency, Units of cycles/M
t, h, dyn = sur(q, chiA, chiB, dt=dt, f_low=f_low) # dyn stands for dynamics and is always None for this model
```

In [6]:

```
# Let's see all available modes (m<0 modes will be included automatically if inclination/phi_ref arguments are given)
print sorted(h.keys())
```

In [7]:

```
P.plot(t, h[(2,2)].real, label='l2m2 real')
P.plot(t, h[(3,3)].real, label='l3m3 real')
P.plot(t, h[(4,4)].real, label='l4m4 real')
P.ylabel('Re[$h_{lm}$]', fontsize=18)
P.xlabel('t [M]', fontsize=18)
P.legend()
```

Out[7]:

In [8]:

```
q = 7
chiA = [0, 0, 0.5]
chiB = [0, 0, -0.7]
f_low = 0 # this will be ignored and the wavefrom will be returned on the times given below
times = np.arange(-10000,130,0.1)
# The returned times are the same as the input times
times, h, dyn = sur(q, chiA, chiB, times=times, f_low=f_low)
P.plot(times, h[(2,2)].real, label='l2m2 real')
P.plot(times, h[(3,3)].real, label='l3m3 real')
P.plot(times, h[(4,4)].real, label='l4m4 real')
P.ylabel('Re[$h_{lm}$]', fontsize=18)
P.xlabel('t [M]', fontsize=18)
P.legend()
```

Out[8]:

In [9]:

```
q = 7
chiA = [0, 0, 0.5]
chiB = [0, 0, -0.7]
M = 20 # Total masss in solar masses
dist_mpc = 100 # distance in megaparsecs
dt = 1./4096 # step size in seconds
f_low = 20 # initial frequency in Hz
t, h, dyn = sur(q, chiA, chiB, dt=dt, f_low=f_low, mode_list=[(2,2), (2,1), (3, 3)], M=M, dist_mpc=dist_mpc, units='mks')
P.plot(t, h[(2,2)].real, label='l2m2 real')
P.plot(t, h[(3,3)].real, label='l3m3 real')
P.plot(t, h[(2,1)].real, label='l2m1 real')
P.ylabel('Re[$h_{lm}$]', fontsize=18)
P.xlabel('t [s]', fontsize=18)
P.legend()
```

Out[9]:

In [10]:

```
q = 7
chiA = [0, 0, 0.5]
chiB = [0, 0, -0.7]
M = 60 # Total masss in solar masses
dist_mpc = 100 # distance in megaparsecs
dt = 1./4096 # step size in seconds
f_low = 20 # initial frequency in Hz
inclination = np.pi/4
phi_ref = np.pi/5
# Will only include modes given in mode_list argument as well as the m<0 counterparts.
# If mode_list is not specified, uses all available modes.
# Returns h_+ -i h_x
t, h, dyn = sur(q, chiA, chiB, dt=dt, f_low=f_low, mode_list=[(2,2), (2,1), (3, 3)], M=M, dist_mpc=dist_mpc,
inclination=inclination, phi_ref=phi_ref, units='mks')
P.plot(t, h.real)
P.ylabel('$h_{+}$ $(\iota, \phi_{ref})$', fontsize=18)
P.xlabel('t [s]', fontsize=18)
```

Out[10]:

In [ ]:

```
```