data = {
    "uid": "amp_id",
    "type": "Edfa",
    "type_variety": "simple edfa",
    "operational": params
}

# write json data into a file
with open("Amp_Parameters2.json", "w") as write_file:
    js.dump(data, write_file, indent=4)

# 4. instantiate an EDFA using the json file you just created.

Edfa_par = ut.get_edfa_parameters(
    "Amp_Parameters2.json",
    "/Users/Tuna/PycharmProjects/OpenOptical/Lesson_4-Amplifiers/eqp2.json")

EDFA = gnel.Edfa(**Edfa_par)

#print(Edfa)

# 5. instantiate a noiseless WDM comb according to the parameters described
# in eqpt.json file

# read json data from a file
with open("eqp2.json", "r") as read_file:
    data = js.load(read_file)

# From the json data, extract only the values needed for the spectral info (SI)
si_data = data['SI'][0]
Exemplo n.º 2
0
print("The loss is: ", loss)


# 7. Instantiate the amplifier, as in Exercise 1.4 Lesson 4, in such a way it
# recovers the loss.

params = {"gain_target": loss, "tilt_target": 0, "out_voa": 0}

data = {"uid" : "amp_id", "type": "Edfa", "type_variety" : "simple edfa", "operational": params}

# write json data into a file
with open("Amp_Parameters.json", "w") as write_file:
    js.dump(data, write_file, indent=4)

Edfa_par = ut.get_edfa_parameters("Amp_Parameters.json",
                                  "/Users/Tuna/PycharmProjects/OpenOptical/Lesson_6-OpticalLineSystems/eqp.json")

EDFA = gnel.Edfa(**Edfa_par)

# propagate the WDM comb through the EDFA.

amplified_si = EDFA(propagated_si)

# 8. Plot the input and output signal power for each channel and verified the
# are the same.

ml.plot_signal(si)

ml.plot_signal(propagated_si)

ml.plot_signal(amplified_si)
Exemplo n.º 3
0
    "out_voa": 0
}  # Exercise 2: "gain_target": 17

data = {
    "uid": "amp_id",
    "type": "Edfa",
    "type_variety": "simple edfa",
    "operational": params
}

# write json data into a file
with open("Amp_Parameters.json", "w") as write_file:
    js.dump(data, write_file, indent=4)

Edfa_par = ut.get_edfa_parameters(
    "Amp_Parameters.json",
    "/Users/Tuna/PycharmProjects/OpenOptical/Lesson_7-Control_Plan/eqp.json")

EDFA = gnel.Edfa(**Edfa_par)

# 4. Instantiate the fiber from the JSON file.
with open("Fiber_Parameters.json", "r") as read_file:
    data = js.load(read_file)
fiber = gnel.Fiber(**data)

# 5. Build a line composed of 10 span (fiber - amplifier). The line has to
# be a vector of tuples, each containing a fiber and an amplifier with the
# configuration of Exercise 1.
num_span = 10
line_system = [{}] * 10
tupla_i = dict()
Exemplo n.º 4
0
    "out_voa": 0
}  # Exercise 2: "gain_target": 17

data = {
    "uid": "amp_id",
    "type": "Edfa",
    "type_variety": "simple edfa",
    "operational": params
}

# write json data into a file
with open("Amp_Parameters.json", "w") as write_file:
    js.dump(data, write_file, indent=4)

Edfa_par = ut.get_edfa_parameters(
    "Amp_Parameters.json",
    "/Users/Tuna/PycharmProjects/OpenOptical/Lesson_6/eqp.json"
)  # Exercise 2: ../eqp2.json"

EDFA = gnel.Edfa(**Edfa_par)

# propagate the WDM comb through the EDFA.

ml.plot_signal(propagated_si)

amplified_si = EDFA(propagated_si)

# 8. Plot the input and output signal power for each channel and verified the
# are the same.

ml.plot_signal(amplified_si)