In [1]:
# Setup ipython environment
%load_ext autoreload
%autoreload 2
%matplotlib inline
# Import useful things from kerr
from kerr.pttools import slm
from kerr import sYlm
# Other things
from numpy import pi,cos,sin,log,exp,linalg,linspace,array,sqrt
from scipy.integrate import trapz
# 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
from matplotlib.pyplot import *
slm calls leaver, which return QNM frequencies and separation constantsnorm keyword.
In [6]:
# Define which mode to use
l,m,n = 3,3,1
jf = 0.68
# Define which angles to use
ph = pi/4
th = linspace(0,pi,1024)
# Call the spheroidal fucntion:
f = slm(jf,l,m,n,th,ph,plot=True,verbose=True)
In [13]:
# NOTE that spin weights for slm and sYlm are set to -2 by defualt.
f = slm(0,l,m,n,th,ph,verbose=True)
g = sYlm(-2,l,m,th,ph)
figure( figsize=3*array([5,2]) )
plot(th,abs(f),'c-')
plot(th,abs(g),'--k')
xlabel(r'$\theta$')
ylabel(r'$|S_{lmn}|=|_{-2}Y_{lm}|$')
Out[13]:
In [14]:
for jf_ in linspace(0,0.99,11):
f = slm(jf_,l,m,n,th,ph)
print sqrt(trapz(f.conj()*f*sin(th),x=th)*(2*pi))
g = sYlm(-2,l,m,th,ph)
print sqrt(trapz(g.conj()*g*sin(th),x=th)*(2*pi))
In [8]:
#
lmn = [ (2,2,0), (2,2,1), (2,1,0), (3,3,0), (3,3,1), (3,2,0), (4,4,0), (4,3,0), (5,5,0) ]
#
jf_range = linspace(0,0.995,4)
# Define which angles to use
ph = pi/4
th = linspace(0,pi,180)
#
fig,axarr = subplots(len(lmn), 2*len(jf_range),figsize=4*array( [2*len(jf_range),len(lmn)] ))
tight_layout(pad=3, w_pad=3, h_pad=3)
#
for k,(l,m,n) in enumerate(lmn):
for h,jf in enumerate(jf_range):
#
ax = [ axarr[k,2*h],axarr[k,2*h+1] ]
slm(jf,l,m,n,th,ph,plot=True,norm=True,ax=ax)
savefig('test_slm_composite.pdf')
In [ ]: