import EOBRun_module as EOB
import matplotlib.pyplot as plt
import numpy as np
def plot_teob_wf():
pars = {
# System parametes, assuming aligned spins
'M' : 1, # Total mass
'q' : 2, # Mass ratio m1/m2 > 1
'chi1' : 0., # Z component of chi_1
'chi2' : 0., # Z component of chi_2
'LambdaAl2' : 0., # Quadrupolar tidal parameter of body 1 (A)
'LambdaBl2' : 0., # Quadrupolar tidal parameter of body 2 (B)
'ecc' : 0.3, # Eccentricity. Default = 0.
'ecc_freq' : 2, # Use periastron (0), average (1) or apastron (2) frequency for initial condition computation. Default = 1
# Initial conditions and output time grid
'domain' : 0, # Time domain. EOBSPA is not available for eccentric waveforms!
'srate_interp' : 4096., # srate at which to interpolate. Default = 4096.
'use_geometric_units': "yes", # output quantities in geometric units. Default = 1
'initial_frequency' : 0.005, # in Hz if use_geometric_units = 0, else in geometric units
'interp_uniform_grid': "yes", # interpolate mode by mode on a uniform grid. Default = 0 (no interpolation)
# Modes
'use_mode_lm' : [1], # List of modes to use/output through EOBRunPy
# Output parameters (Python)
'arg_out' : "yes", # Output hlm/hflm. Default = 0
}
print("Run the WF generator...")
t, hp, hc, hlm, dyn = EOB.EOBRunPy(pars)
fig, ax = plt.subplots()
t_mrg = t[np.argmax(hp**2 + hc **2)]
A_mrg = max(np.sqrt(hp**2 + hc **2))
ax.plot(t, hp)
ax.axvline(t_mrg, linestyle='--', color='k', label='Merger')
ax.set_xlabel('t / M')
ax.set_ylabel(r'$h_{+}$')
plt.legend()
plt.tight_layout()
plt.show()
if __name__ == "__main__":
plot_teob_wf()