In [48]:
# Setup enviroment to autoreload packages
%load_ext autoreload
%autoreload 2
%matplotlib inline
from matplotlib.pyplot import figure,plot,xlabel,ylabel,gca,show,close,axvline,xlim,ylim,savefig,legend,title
# Import select nrutils packages
from nrutils import scbuild,red,cyan,yellow,green,scsearch,gwylm,rgb,lim,pylim
# Others
from numpy import array,pi
from kerr import leaver
In [114]:
# Look for simulations
A = scsearch(keyword='sxs',nonspinning=True,verbose=True,unique=True)
# A = scsearch(keyword='sxs',nonspinning=True,verbose=True,unique=True)
In [115]:
# Load selected waveform data from a simulation
y = gwylm( A[-1], lm=([2,2],[3,2],[4,4],[3,3]), verbose=False )
In [116]:
# Collect Ringdown Frequencies for plotting
cw = []
for h in y.hlm:
cw.append( leaver( y.xf, h.l, h.m, Mf=y.mf )[0] )
In [117]:
# Plot the Mode Amplitudes in the FD
fig = figure( figsize=2*array([5,3]) )
clr = rgb( len(y.hlm), jet=True )
for k,h in enumerate(y.hlm):
plot( h.f, h.fd_amp, color=clr[k], linewidth=1.5, label='(%i,%i)'%(h.l,h.m) )
axvline( x=cw[k].real/(2*pi), color = clr[k], linestyle=':', linewidth=1.5 )
xlim( [2e-2,4e-1] )
ylim( [ 1e-7, 2e2 ] )
xlabel('$Mf$')
ylabel(r'$\frac{r}{M} |h_{lm}|$')
title( '%s, $M_f = %1.2f$, $\chi_f = %1.2f$'%(y.label,y.mf,y.xf), fontsize=16 )
lg = legend( frameon=False )
gca().set_xscale("log", nonposx='clip')
gca().set_yscale("log", nonposy='clip')
savefig( '/Users/book/Desktop/sxs-'+y.label.replace('-','')+'.jpg' )
In [ ]: