示例#1
0
        CSVFit


    lt = layout.Layout(domain.Domain(samples_per_bit=512,bit_width=20.0))
    pulse = gaussian.Gaussian(channels=2, peak_power=[10.0, 10e-1],
                              width=[1.0, 5.0], center_lambda=[1050.0, 1048.0])
    gamma_data = CSVFit('./data/gamma_test.txt')
    fiber = Fiber(length=.10, method="ssfm_symmetric", alpha=[0.046],
                  alpha_order=4, beta_order=4, gamma=1.5,
                  nl_approx=False, ATT=True, DISP=True,
                  SPM=True, XPM=False, SS=False, RS=False, approx_type=1,
                  steps=1000, medium='sio2')
    lt.link((pulse[0], fiber[0]))
    lt.run(pulse)

    x_datas = [pulse.fields[0].nu, fiber.fields[1].nu,
               pulse.fields[0].time, fiber.fields[1].time]

    y_datas = [spectral_power(pulse.fields[0].channels),
               spectral_power(fiber.fields[1].channels),
               temporal_power(pulse.fields[0].channels),
               temporal_power(fiber.fields[1].channels)]

    x_labels = ['nu', 'nu', 't', 't']
    y_labels = ['P_nu', 'P_nu', 'P_t', 'P_t']
    plot_titles = ["Original Pulse", "Pulse at the end of the fiber"]
    plot_titles.extend(plot_titles)

    plot.plot(x_datas, y_datas, x_labels = x_labels, y_labels = y_labels,
              plot_titles=plot_titles, plot_groups=[0,1,2,3], opacity=0.3)
示例#2
0
        medium=medium,
        dopant=dopant,
        steps=steps,
        solver_order='alternating',
        error=error,
        propagate_pump=True,
        save_all=True)
    lt.link((pulse[0], fiber[0]), (pump[0], fiber[2]))
    lt.run(pulse, pump)

    x_datas = [
        pulse.fields[0].nu, pump.fields[0].nu, pulse.fields[0].time,
        pump.fields[0].time, fiber.fields[1].nu, fiber.fields[1].time
    ]
    y_datas = [
        spectral_power(pulse.fields[0].channels),
        spectral_power(pump.fields[0].channels),
        temporal_power(pulse.fields[0].channels),
        temporal_power(pump.fields[0].channels),
        spectral_power(fiber.fields[1].channels),
        temporal_power(fiber.fields[1].channels)
    ]
    x_labels = ['nu', 'nu', 't', 't', 'nu', 't']
    y_labels = ['P_nu', 'P_nu', 'P_t', 'P_t', 'P_nu', 'P_t']

    plot.plot(x_datas,
              y_datas,
              x_labels=x_labels,
              y_labels=y_labels,
              plot_groups=[0, 0, 1, 1, 2, 3],
              opacity=0.3)
示例#3
0
    channels = 3
    center_lambda = [1552.0, 1549.0, 1596.0]
    position = [0.3, 0.5]
    width = [5.3, 6]
    peak_power = [1e-3, 2e-3, 6e-3]
    bit_rate = [0.03, 0.04]
    offset_nu = [1.56, -1.6]
    chirp = [0.5, 0.1]
    init_phi = [1.0, 0.0]

    sech = Sech(channels=channels,
                center_lambda=center_lambda,
                position=position,
                width=width,
                peak_power=peak_power,
                bit_rate=bit_rate,
                offset_nu=offset_nu,
                chirp=chirp,
                init_phi=init_phi,
                save=True)

    lt.run(sech)

    plot.plot([sech.fields[0].time, sech.fields[0].nu], [
        temporal_power(sech.fields[0].channels),
        spectral_power(sech.fields[0].channels)
    ], ["t", "nu"], ["P_t", "P_nu"],
              plot_titles=["Sech pulse"],
              split=True)
示例#4
0
                                            phase

    lt = layout.Layout(Domain(samples_per_bit=4096))

    channels = 3
    center_lambda = [1552.0, 1549.0, 1596.0]
    peak_power = [1e-3, 2e-3, 6e-3]
    offset_nu = [0.0, 1.56, -1.6]
    init_phi = [1.0, 1.0, 0.0]

    cw = CW(channels=channels,
            center_lambda=center_lambda,
            peak_power=peak_power,
            offset_nu=offset_nu,
            init_phi=init_phi,
            save=True)

    lt.run(cw)

    plot_titles = [
        "CW pulse temporal power", "CW pulse spectral power", "CW pulse phase"
    ]

    plot.plot([cw.fields[0].time, cw.fields[0].nu, cw.fields[0].time], [
        temporal_power(cw.fields[0].channels),
        spectral_power(cw.fields[0].channels),
        phase(cw.fields[0].channels)
    ], ["t", "nu", "t"], ["P_t", "P_nu", "phi"],
              plot_titles=plot_titles,
              split=True)
示例#5
0
        dopant=dopant,
        steps=steps,
        solver_order='alternating',
        error=error,
        propagate_pump=True,
        save_all=True)
    lt.link((pulse[0], fiber[0]), (pump[0], fiber[2]))
    lt.run(pulse, pump)

    x_datas = [
        pulse[0][0].nu, pump[0][0].nu, pulse[0][0].time, pump[0][0].time,
        np.vstack((fiber[1][0].nu, fiber[1][1].nu)),
        np.vstack((fiber[1][0].time, fiber[1][1].time))
    ]
    y_datas = [
        spectral_power(pulse[0][0].channels),
        spectral_power(pump[0][0].channels),
        temporal_power(pulse[0][0].channels),
        temporal_power(pump[0][0].channels),
        spectral_power(np.vstack(
            (fiber[1][0].channels, fiber[1][1].channels))),
        temporal_power(np.vstack((fiber[1][0].channels, fiber[1][1].channels)))
    ]
    x_labels = ['nu', 't', 'nu', 't']
    y_labels = ['P_nu', 'P_t', 'P_nu', 'P_t']

    plot.plot2d(x_datas,
                y_datas,
                x_labels=x_labels,
                y_labels=y_labels,
                plot_groups=[0, 0, 1, 1, 2, 3],
示例#6
0
    center_lambda = [1552.0, 1549.0, 1596.0]
    position = [0.5, 0.3, 0.5]
    width = [2.0, 5.3, 6]
    peak_power = [1e-3, 2e-3, 6e-3]
    bit_rate = [0.0, 0.03, 0.04]
    offset_nu = [0.0, 1.56, -1.6]
    order = [1, 2, 1]
    chirp = [0.0, 0.5, 0.1]
    init_phi = [0.0, 1.0, 0.0]

    gssn = Gaussian(channels=channels,
                    center_lambda=center_lambda,
                    position=position,
                    width=width,
                    peak_power=peak_power,
                    bit_rate=bit_rate,
                    offset_nu=offset_nu,
                    order=order,
                    chirp=chirp,
                    init_phi=init_phi,
                    save=True)

    lt.run(gssn)

    plot.plot([gssn.fields[0].time, gssn.fields[0].nu], [
        temporal_power(gssn.fields[0].channels),
        spectral_power(gssn.fields[0].channels)
    ], ["t", "nu"], ["P_t", "P_nu"],
              plot_titles=["Gaussian pulse"],
              split=True)
示例#7
0
    order = [1, 2, 1]
    chirp = [0.0, 0.5, 0.1]
    init_phi = [0.0, 1.0, 0.0]

    gssn = Gaussian(channels=channels,
                    center_lambda=center_lambda,
                    position=position,
                    width=width,
                    peak_power=peak_power,
                    bit_rate=bit_rate,
                    offset_nu=offset_nu,
                    order=order,
                    chirp=chirp,
                    init_phi=init_phi,
                    save=True)

    lt.run(gssn)

    x_datas = [gssn[0][0].time, gssn[0][0].nu]
    y_datas = [
        temporal_power(gssn[0][0].channels),
        spectral_power(gssn[0][0].channels)
    ]

    plot.plot2d(x_datas,
                y_datas,
                x_labels=["t", "nu"],
                y_labels=["P_t", "P_nu"],
                plot_titles=["Gaussian pulse"],
                split=True)
示例#8
0
    init_phi = [1.0, 0.0]
    beta_2 = [-19.0, -17.0]
    gamma = [4.3, 4.6]

    soli = Soliton(channels=channels,
                   center_lambda=center_lambda,
                   position=position,
                   width=width,
                   bit_rate=bit_rate,
                   offset_nu=offset_nu,
                   order=order,
                   init_phi=init_phi,
                   beta_2=beta_2,
                   gamma=gamma,
                   save=True)

    lt.run(soli)

    x_datas = [soli[0][0].time, soli[0][0].nu]
    y_datas = [
        temporal_power(soli[0][0].channels),
        spectral_power(soli[0][0].channels)
    ]

    plot.plot2d(x_datas,
                y_datas,
                x_labels=["t", "nu"],
                y_labels=["P_t", "P_nu"],
                plot_titles=["Soliton pulse"],
                split=True)
示例#9
0
    bit_rate = [0.03, 0.04]
    offset_nu = [1.56, -1.6]
    chirp = [0.5, 0.1]
    init_phi = [1.0, 0.0]

    sech = Sech(channels=channels,
                center_lambda=center_lambda,
                position=position,
                width=width,
                peak_power=peak_power,
                bit_rate=bit_rate,
                offset_nu=offset_nu,
                chirp=chirp,
                init_phi=init_phi,
                save=True)

    lt.run(sech)

    x_datas = [sech[0][0].time, sech[0][0].nu]
    y_datas = [
        temporal_power(sech[0][0].channels),
        spectral_power(sech[0][0].channels)
    ]

    plot.plot2d(x_datas,
                y_datas,
                x_labels=["t", "nu"],
                y_labels=["P_t", "P_nu"],
                plot_titles=["Sech pulse"],
                split=True)
示例#10
0
    cw = CW(channels=channels,
            center_lambda=center_lambda,
            peak_power=peak_power,
            offset_nu=offset_nu,
            init_phi=init_phi,
            save=True)

    lt.run(cw)

    plot_titles = [
        "CW pulse temporal power", "CW pulse spectral power", "CW pulse phase"
    ]
    x_datas = [cw[0][0].time, cw[0][0].nu, cw[0][0].time]
    y_datas = [
        temporal_power(cw[0][0].channels),
        spectral_power(cw[0][0].channels),
        phase(cw[0][0].channels)
    ]

    #plot.plot2d(x_datas, y_datas, x_labels=["t","nu","t"],
    #            y_labels=["P_t", "P_nu", "phi"], plot_titles=plot_titles,
    #            split=True, opacity=0.2)

    samples = int(2**(10))
    bit_width = 3.
    lt = layout.Layout(Domain(samples_per_bit=samples, bit_width=bit_width))

    channels = 1
    center_lambda = [1552.0, 1549.0, 1596.0]
    peak_power = [1e-3, 2e-3, 6e-3]
    total_power = [1e-3]
示例#11
0
    center_lambda = [1552.0, 1549.0, 976.0]
    position = [0.3, 0.5, 0.4]
    width = [5.3, 6]
    bit_rate = [0.03, 0.04]
    offset_nu = [1.56, -1.6]
    order = [2, 1]
    init_phi = [1.0, 0.0]
    beta_2 = [-19.0, -17.0]
    gamma = [4.3, 4.6]

    soli = Soliton(channels=channels,
                   center_lambda=center_lambda,
                   position=position,
                   width=width,
                   bit_rate=bit_rate,
                   offset_nu=offset_nu,
                   order=order,
                   init_phi=init_phi,
                   beta_2=beta_2,
                   gamma=gamma,
                   save=True)

    lt.run(soli)

    plot.plot([soli.fields[0].time, soli.fields[0].nu], [
        temporal_power(soli.fields[0].channels),
        spectral_power(soli.fields[0].channels)
    ], ["t", "nu"], ["P_t", "P_nu"],
              plot_titles=["Soliton pulse"],
              split=True)
示例#12
0
        CSVFit


    lt = layout.Layout(domain.Domain(samples_per_bit=512,bit_width=20.0))
    pulse = gaussian.Gaussian(channels=2, peak_power=[10.0, 10e-1],
                              width=[1.0, 5.0], center_lambda=[1050.0, 1048.0])
    gamma_data = CSVFit('./data/gamma_test.txt')
    fiber = Fiber(length=.10, method="ssfm_symmetric", alpha=[0.046],
                  alpha_order=4, beta_order=4, gamma=1.5,
                  nl_approx=False, ATT=True, DISP=True,
                  SPM=True, XPM=False, SS=False, RS=False, approx_type=1,
                  steps=1000, medium='sio2')
    lt.link((pulse[0], fiber[0]))
    lt.run(pulse)

    x_datas = [pulse[0][0].nu, fiber[1][0].nu,
               pulse[0][0].time, fiber[1][0].time]

    y_datas = [spectral_power(pulse[0][0].channels),
               spectral_power(fiber[1][0].channels),
               temporal_power(pulse[0][0].channels),
               temporal_power(fiber[1][0].channels)]

    x_labels = ['nu', 'nu', 't', 't']
    y_labels = ['P_nu', 'P_nu', 'P_t', 'P_t']
    plot_titles = ["Original Pulse", "Pulse at the end of the fiber"]
    plot_titles.extend(plot_titles)

    plot.plot2d(x_datas, y_datas, x_labels=x_labels, y_labels=y_labels,
                plot_titles=plot_titles, plot_groups=[0,1,2,3], opacity=0.3)