import sys
import numpy as np
import declarative
from IIRrational.utilities.ipynb_lazy import *
asavefig.formats.png.use = True
from phasor import alm
plt.style.use(style_6p5in)
plt.style.use(style_serif)
import sys
import IIRrational
from coupled_cavity import coupled_cavity, coupled_cavity_2ph
axB = mplfigB(Nrows=2, size_in=(8, 6))
def plot_CC(color = None, label = None, **kwargs):
rB = coupled_cavity(F_Hz = logspaced(1, 2e4, 10000), **kwargs)
fit = IIRrational.v2.data2filter(
F_Hz = rB.F_Hz,
data = rB.TRANS_CA[..., 0, 0],
mode = 'fit',
poles = (-400,),
zeros = (),
log_level = 1,
log_level_warn = 1,
)
pole = fit.fitter.poles.fullplane[0]
axB.ax0.semilogx(rB.F_Hz, abs(rB.REFL_AB[..., 0, 0])**2, color = color, label = label)
axB.ax1.loglog(rB.F_Hz, abs(rB.TRANS_CA[..., 0, 0]), color = color, label = 'cavity pole: {:.1f}Hz'.format(-pole))
return fit
for L_B in [0, 0.001, .003, .01, .03]:
fit = plot_CC(L_B=L_B, label = 'SRC RT loss {}%'.format(100 * L_B))
coupled_cavity(F_Hz = logspaced(1, 2e4, 100)).MM_AB
axB.ax0.legend()
axB.ax1.legend()
axB.ax0.set_title('SRC SQZ Reflection')
axB.ax1.set_title('Endmirror-ASport optical gain (cavity pole)')
axB.ax1.set_xlabel('Frequency [Hz]')
axB.ax0.set_ylabel('Reflectivity [W/W]')
axB.ax1.set_ylabel('field gain')
axB.finalize()
axB.save('cavity_pole_SRCloss.png')
axB = mplfigB(Nrows=2, size_in=(8, 6))
def plot_CC(color = None, label = None, **kwargs):
rB = coupled_cavity(F_Hz = logspaced(1, 2e4, 10000), **kwargs)
fit = IIRrational.v2.data2filter(
F_Hz = rB.F_Hz,
data = rB.TRANS_CA[..., 0, 0],
mode = 'fit',
poles = (-400,),
zeros = (),
log_level = 1,
log_level_warn = 1,
)
pole = fit.fitter.poles.fullplane[0]
axB.ax0.semilogx(rB.F_Hz, abs(rB.REFL_AB[..., 0, 0])**2, color = color, label = label)
axB.ax1.loglog(rB.F_Hz, abs(rB.TRANS_CA[..., 0, 0]), color = color, label = 'cavity pole: {:.1f}Hz'.format(-pole))
return fit
for MM_L_AB in [0, 0.001, .003, .01, .03]:
fit = plot_CC(MM_L_AB = MM_L_AB, label = 'IFO MM loss {}%'.format(100 * MM_L_AB))
axB.ax0.legend()
axB.ax1.legend()
axB.ax0.set_title('SRC SQZ Reflection')
axB.ax1.set_title('Endmirror-ASport optical gain (cavity pole)')
axB.ax1.set_xlabel('Frequency [Hz]')
axB.ax0.set_ylabel('Reflectivity [W/W]')
axB.ax1.set_ylabel('field gain')
axB.finalize()
axB.save('cavity_pole_SRCmm.png')