In [5]:
from stack import *
my_stack = load('io_files/saved_stack_200_thick.txt')
pyplot.figure(figsize=(16,4));
my_stack.plot()
## 200 layers, with 100 micon average thickness



In [5]:
pyplot.figure(figsize=(16,4))
my_stack.scan('transmission',[1550,1650],400)



In [1]:
def show_spectra(my_pump):
    pyplot.figure(figsize=(16,4))
    pyplot.title('1-photon power spectrum before entering the stack',fontsize=16)
    my_pump.plot_1PIS('i')

    pyplot.figure(figsize=(16,4))
    pyplot.title('1-photon power spectrum in the 1st layer',fontsize=16)
    my_pump.plot_1PIS(1)

    pyplot.figure(figsize=(16,4))
    pyplot.xlabel('wavelength (nm)',fontsize=16)
    pyplot.ylabel('2-photon power spectrum',fontsize=16)
    pyplot.title('2-photon power spectrum in the 1st layer',fontsize=16)
    pyplot.plot(my_pump.get_2PS(1)[:,0],my_pump.get_2PS(1)[:,1],'o-')
    pyplot.show()

def show_focusing(path):
    files = map(lambda f:path+f,[
        'inv-focus0.npy',
        'inv-focus.npy'])
#        'inv-focus-min.npy',
#        'inv-focus-field.npy',
#        'inv-focus-field+min.npy'])

    legends = ['focus a0 before entrance', 
           'focus a0 inside']
#           'focus a0 inside + min',
#           'focus field inside',
#           'focus field inside + min']

    pyplot.figure(figsize=(18, 6))
    pyplot.xlabel('layer number',fontsize=20)
    pyplot.ylabel('population inversion',fontsize=20)

    data = map(np.load,files)
    for j in range(len(data)):
        pyplot.plot(data[j][:,0],data[j][:,1],'o-')
        #legends[j] += str("{:7.4f}".format(sum(data[j][1:50])/sum(data[j][100:150])))
    pyplot.legend(legends,fontsize=22)
    pyplot.show()
    #return data

def plot_focusing(case):
    for location in locations: show_focusing('io_files/'+case+location)

In [3]:
locations = ['200@10/', '200@50/','200@90/','200@125/','200@160/','200@190/']
case1 = '1600nm-150nmS-100um-025nm-central/'
case2 = '1600nm-100nm-100um-025nm-central/'
case3 = '1600nm-50nm-100um-025nm-central/'
case4 = ''

In [12]:
pump1 = incident_wp(my_stack)
pump1.add_packet(200,[1625.5,1675.5])
pump1.add_packet(200,[1575.25,1625.25],type='uniform',height=0.0001)
pump1.add_packet(200,[1525,1575])

In [13]:
pump2 = incident_wp(my_stack)
pump2.add_packet(200,[1600.25,1650.25])
pump2.add_packet(200,[1550,1600])

In [6]:
pump3 = incident_wp(my_stack)
pump3.add_packet(100,[1600.25,1625.25])
pump3.add_packet(100,[1575,1600])

In [14]:
show_spectra(pump1)



In [9]:
plot_focusing(case1)



In [15]:
show_spectra(pump2)



In [10]:
plot_focusing(case2)



In [11]:
show_spectra(pump3)



In [12]:
plot_focusing(case3)



In [1]:
# saved codes
"""
n = 1
xout = data[n][:,0]
yout = data[n][:,1]
pyplot.figure(figsize=(18, 4));
pyplot.xlabel('layer number',fontsize=20)
pyplot.ylabel('population inversion',fontsize=20)
pyplot.plot(xout[0::2],yout[0::2],'o-')
pyplot.plot(xout[1::2],yout[1::2],'o-')
pyplot.legend(['even layers','odd layers'],fontsize=22)
pyplot.show()
"""
"""
Shaping types:
- "no shaping": the pulse is focused outside (left side) the stack
- "positive-wave focusing": make the 'a_j' complex amplitudes to have the same phase for all eigenmodes at midpoint of the layer
- "total field focusing": make the total complex field to have the same phase for all eigenmodes, at a location with maximum spatial field magnitude
- "minimization": randomize phases of the eigenmodes which do not localize in layers we'd like to focus (e.g. randomize those in layer 1 to 20, but not 40)
"""


Out[1]:
'\nShaping types:\n- "no shaping": the pulse is focused outside (left side) the stack\n- "positive-wave focusing": make the \'a_j\' complex amplitudes to have the same phase for all eigenmodes at midpoint of the layer\n- "total field focusing": make the total complex field to have the same phase for all eigenmodes, at a location with maximum spatial field magnitude\n- "minimization": randomize phases of the eigenmodes which do not localize in layers we\'d like to focus (e.g. randomize those in layer 1 to 20, but not 40)\n'

In [ ]: