<jupyter_start><jupyter_text>Plot Component QNM of a Strain Waveform's Spherical $l=m=2$ Mode<jupyter_code># Setup ipython environment
%load_ext autoreload
%autoreload 2
%matplotlib inline
# The Important Things
from nrutils import scsearch,gwylm
from matplotlib.pyplot import *
from kerr.models import mmrdns 
from numpy import array
# Setup plotting backend
import matplotlib as mpl
mpl.rcParams['lines.linewidth'] = 0.8
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['font.size'] = 12
mpl.rcParams['axes.labelsize'] = 20<jupyter_output>The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload<jupyter_text>Find a Simulation<jupyter_code>A = scsearch(keyword=['athena','hrq'],q=1.0,verbose=True)<jupyter_output>[scsearch]>> Found [4mkeyword[0m (=['athena', 'hrq']) keyword.
[scsearch]>> Found [4mq[0m (=1.0) keyword.
[scsearch]>> Found [4mverbose[0m (=True) keyword.
([0;36mscsearch[0m)>> List of keywords or string keyword found: [0;36mALL scentry objects matching will be passed.[0m To pass ANY entries matching the keywords, input the keywords using an iterable of not of type list.
## Found [1m1[0m[1;35m possibly degenerate[0m simulations:
[0001][[92mathena[0m] [0;36mHRq-series[0m: ns-q1.00<jupyter_text>Load waveform data for this simulation<jupyter_code># Here we load only the l=m=2 spherical multipole moment
y = gwylm( A[0], lm=[2,2], verbose=True )
# Plot the strain waveform
y.hlm[0].plot(show=True);<jupyter_output><empty_output><jupyter_text>We are interested in ringdown<jupyter_code>g = y.ringdown(T0=5,T1=30) # Here, T0 is where we will define ringdown to start in terms of M after the peak luminosity; in the same sense, T1 is where the waveform will terminate
# Plot the strain and psi4 waveforms. NOTE that Ringdown in strain is of lower quality 
g.plot()
ll,mm,eta = 2,2,mmrdns.q2eta(A[0].m1/A[0].m2)
h = mmrdns.meval_spherical_mode(ll,mm,eta,kind='strain',gwfout=True)(g.hlm[0].t)
h.plot()<jupyter_output><empty_output><jupyter_text>Given the NR data for the l=m=2 mode, plot QNM components and MMRDNS in full<jupyter_code>lmn = [ (2,2,0), (2,2,1) ]
hlm = []
for k in lmn:
    hlm.append( mmrdns.meval_spherical_mode(ll,mm,eta,kind='strain',mode=k,gwfout=True)(g.hlm[0].t) )
figure( figsize=2*array([5,3]) )
# gca().set_yscale("log", nonposy='clip')
ylim( [0, 0.25] )
# xlim( [min(hk.t),max(hk.t)] )
plot( g.hlm[0].t, g.hlm[0].amp, color=0.9*array([1,1,1]), linewidth=4, label='NR-MAYA' )
plot( g.hlm[0].t, g.hlm[0].plus, color=0.9*array([1,1,1]), linewidth=4 )
plot( g.hlm[0].t, g.hlm[0].cross, color=0.9*array([1,1,1]), linewidth=4 )
plot( h.t, h.amp, '--k', label='MMRDNS: (2,2,0), (2,2,1)' )
plot( hlm[0].t, hlm[0].amp, alpha=0.8, label='Only (2,2,0)' )

#
xlabel(r'$(t-t_{PeakLum.})/M$')
ylabel(r'$\frac{r}{M}\,h_{22}(t)$')
title(g.label.upper())
legend(frameon=False)

#
savefig('mmrdns_strain_comparison_%s_ll%imm%i.pdf'%(g.label.replace('-','_'),ll,mm))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17952172448635903, 'fraction_numerical': 0.04109127652408218, 'mean_word_length': 6.634961439588689, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '572824', 'license': 'MIT', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1222, 'n_words': 267, 'path': 'notes/ns/notebooks/manual_strain_data_comparison.ipynb', 'repo_name': 'llondon6/kerr_public', 'size': '2969'}