from scipy import *
from pylab import *

# plots at fixed transmissions
x = load('advirgo1_optimal_schnupp.out', comments='%')

figure()
semilogy(x[:,0], x[:,1]*x[:,1], 'r-')
semilogy(x[:,0], x[:,2]*x[:,2], 'g-')
semilogy(x[:,0], x[:,3]*x[:,3], 'b-')
semilogy(x[:,0], x[:,4]*x[:,4], 'r--')
semilogy(x[:,0], x[:,5]*x[:,5], 'g--')
semilogy(x[:,0], x[:,6]*x[:,6], 'b--')
xlabel('Schnupp asymmetry [m]')
ylabel('Sidebands power inside SRC [W]')
grid(True)
legend(('SB1', 'SB2', 'SB3'), 'lower right')
title('T_SRM = 0.11 T_PRM = 0.0464 phi = 0.15 rad dL=10^-11 m')
axis(xmin=0, xmax=0.1)
savefig('optimal_schnupp.eps')
savefig('optimal_schnupp.png')

x[find(x[:,2] == amax(x[:,2])),0]   # 0.0368 m LSB
x[find(x[:,5] == amax(x[:,5])),0]   # 0.0363 m USB

