Skip to content

Commit

Permalink
restore initial power sweep behaviour
Browse files Browse the repository at this point in the history
if user define a delta_p that is reduced because of saturation,
then this initial setting is still kept for power sweep to be sure
that the full amplitude of sweep is used.

SI power = 0 dBm
max power amp1 = 20 dBm,
user_defined_delta_p set by user = 3
80 channels, so pch_max = 20 - 10log10(80) = 0.96 dBm
power_sweep -> power range [-3, 0] dBm

then for initial design,
   pref = 0 dBm
   computed_delta_p =
      min(pch_max, pref + user_defined_delta_p) - pref = 0.96

but for -3 power sweep
   pref = -3 dBm
   computed_delta_p =
      min(pch_max, pref + user_defined_delta_p) - pref =
      min(0.96,    -3 + 3) - (-3) = 3
   so the user defined delta_p is applied as much as possible

Signed-off-by: EstherLerouzic <[email protected]>
Change-Id: I8fd459c29aa9754ff9d4868af1d8be8642a31913
  • Loading branch information
EstherLerouzic committed Nov 2, 2023
1 parent 6281b91 commit 4277f34
Show file tree
Hide file tree
Showing 5 changed files with 637 additions and 6 deletions.
9 changes: 5 additions & 4 deletions gnpy/core/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ def set_egress_amplifier(network, this_node, equipment, pref_ch_db, pref_total_d
if isinstance(node, elements.Edfa):
node_loss = span_loss(network, prev_node)
voa = node.out_voa if node.out_voa else 0
if node.delta_p is None:
if node.operational.delta_p is None:
dp = target_power(network, next_node, equipment) + voa
else:
dp = node.delta_p
dp = node.operational.delta_p
if node.effective_gain is None or power_mode:
gain_target = node_loss + dp - prev_dp + prev_voa
else: # gain mode with effective_gain
Expand Down Expand Up @@ -673,10 +673,11 @@ def build_network(network, equipment, pref_ch_db, pref_total_db, set_connector_l
set_fiber_input_power(network, fiber, equipment, pref_ch_db)


def design_network(reference_channel, network, equipment, verbose=True):
def design_network(reference_channel, network, equipment, set_connector_losses=True, verbose=True):
"""Network is designed according to reference channel. Verbose indicate if the function should
print all warnings or not
"""
pref_ch_db = watt2dbm(reference_channel.power) # reference channel power
pref_total_db = pref_ch_db + lin2db(reference_channel.nb_channel) # reference total power
build_network(network, equipment, pref_ch_db, pref_total_db, verbose)
build_network(network, equipment, pref_ch_db, pref_total_db, set_connector_losses=set_connector_losses,
verbose=verbose)
3 changes: 2 additions & 1 deletion gnpy/tools/cli_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,13 @@ def transmission_main_example(args=None):
# initial network is designed using req.power. that is that any missing information (amp gain or delta_p) is filled
# using this req.power, previous to any sweep requested later on.
decorated_design_network = decorator_network_exceptions(design_network)
decorated_design_network(req, network, equipment, verbose=True)
decorated_design_network(req, network, equipment, set_connector_losses=True, verbose=True)
print(f'\nThere are {len(spans)} fiber spans over {sum(spans)/1000:.0f} km between {source.uid} '
f'and {destination.uid}')
print(f'\nNow propagating between {source.uid} and {destination.uid}:')
for dp_db in power_range:
req.power = db2lin(pref_ch_db + dp_db) * 1e-3
design_network(req, network, equipment, set_connector_losses=False, verbose=False)
# if initial spectrum did not contain any power, now we need to use this one.
# note the initial power defines a differential wrt req.power so that if req.power is set to 2mW (3dBm)
# and initial spectrum was set to 0, this sets a initial per channel delta power to -3dB, so that
Expand Down
235 changes: 235 additions & 0 deletions tests/data/eqpt_config_sweep.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
{ "Edfa":[{
"type_variety": "CienaDB_medium_gain",
"type_def": "advanced_model",
"gain_flatmax": 25,
"gain_min": 15,
"p_max": 21,
"advanced_config_from_json": "std_medium_gain_advanced_config.json",
"out_voa_auto": false,
"allowed_for_design": true
},
{
"type_variety": "std_medium_gain",
"type_def": "variable_gain",
"gain_flatmax": 26,
"gain_min": 15,
"p_max": 21,
"nf_min": 6,
"nf_max": 10,
"out_voa_auto": false,
"allowed_for_design": true
},
{
"type_variety": "std_low_gain",
"type_def": "variable_gain",
"gain_flatmax": 16,
"gain_min": 8,
"p_max": 21,
"nf_min": 7,
"nf_max": 11,
"out_voa_auto": false,
"allowed_for_design": true
},
{
"type_variety": "test",
"type_def": "variable_gain",
"gain_flatmax": 25,
"gain_min": 15,
"p_max": 21,
"nf_min": 5.8,
"nf_max": 10,
"out_voa_auto": false,
"allowed_for_design": true
},
{
"type_variety": "test_fixed_gain",
"type_def": "fixed_gain",
"gain_flatmax": 21,
"gain_min": 20,
"p_max": 21,
"nf0": 5,
"allowed_for_design": true
},
{
"type_variety": "std_booster",
"type_def": "fixed_gain",
"gain_flatmax": 21,
"gain_min": 20,
"p_max": 21,
"nf0": 5,
"allowed_for_design": false
}
],
"Fiber":[{
"type_variety": "SSMF",
"dispersion": 1.67e-05,
"effective_area": 83e-12,
"pmd_coef": 1.265e-15
}
],
"Span":[{
"power_mode":true,
"delta_power_range_db": [0,0,0.5],
"max_fiber_lineic_loss_for_raman": 0.25,
"target_extended_gain": 2.5,
"max_length": 150,
"length_units": "km",
"max_loss": 28,
"padding": 10,
"EOL": 0,
"con_in": 0,
"con_out": 0
}
],
"Roadm":[{
"target_pch_out_db": -20,
"add_drop_osnr": 38,
"pmd": 0,
"pdl": 0,
"restrictions": {
"preamp_variety_list":[],
"booster_variety_list":[]
}
}],
"SI":[{
"f_min": 191.35e12,
"f_max":196.1e12,
"baud_rate": 32e9,
"spacing": 50e9,
"power_dbm": 0,
"power_range_db": [-6,0,0.5],
"roll_off": 0.15,
"tx_osnr": 100,
"sys_margins": 0
}],
"Transceiver":[
{
"type_variety": "vendorA_trx-type1",
"frequency":{
"min": 191.4e12,
"max": 196.1e12
},
"mode":[
{
"format": "PS_SP64_1",
"baud_rate": 32e9,
"OSNR": 11,
"bit_rate": 100e9,
"roll_off": 0.15,
"tx_osnr": 100,
"min_spacing": 50e9,
"cost":1
},
{
"format": "PS_SP64_2",
"baud_rate": 64e9,
"OSNR": 15,
"bit_rate": 200e9,
"roll_off": 0.15,
"tx_osnr": 100,
"min_spacing": 75e9,
"cost":1
},
{
"format": "mode 1",
"baud_rate": 32e9,
"OSNR": 11,
"bit_rate": 100e9,
"roll_off": 0.15,
"tx_osnr": 100,
"min_spacing": 50e9,
"cost":1
},
{
"format": "mode 2",
"baud_rate": 64e9,
"OSNR": 15,
"bit_rate": 200e9,
"roll_off": 0.15,
"tx_osnr": 100,
"min_spacing": 75e9,
"cost":1
}
]
},
{
"type_variety": "Voyager_16QAM",
"frequency":{
"min": 191.4e12,
"max": 196.1e12
},
"mode":[
{
"format": "16QAM",
"baud_rate": 32e9,
"OSNR": 19,
"bit_rate": 200e9,
"roll_off": 0.15,
"tx_osnr": 100,
"min_spacing": 50e9,
"cost":1
}
]
},
{
"type_variety": "Voyager",
"frequency":{
"min": 191.4e12,
"max": 196.1e12
},
"mode":[
{
"format": "mode 1",
"baud_rate": 32e9,
"OSNR": 12,
"bit_rate": 100e9,
"roll_off": 0.15,
"tx_osnr": 45,
"min_spacing": 50e9,
"cost":1
},
{
"format": "mode 3",
"baud_rate": 44e9,
"OSNR": 18,
"bit_rate": 300e9,
"roll_off": 0.15,
"tx_osnr": 45,
"min_spacing": 62.5e9,
"cost":1
},
{
"format": "mode 2",
"baud_rate": 66e9,
"OSNR": 21,
"bit_rate": 400e9,
"roll_off": 0.15,
"tx_osnr": 45,
"min_spacing": 75e9,
"cost":1
},
{
"format": "mode 2 - fake",
"baud_rate": 66e9,
"OSNR": 21,
"bit_rate": 400e9,
"roll_off": 0.15,
"tx_osnr": 45,
"min_spacing": 75e9,
"cost":1
},
{
"format": "mode 4",
"baud_rate": 66e9,
"OSNR": 16,
"bit_rate": 200e9,
"roll_off": 0.15,
"tx_osnr": 45,
"min_spacing": 75e9,
"cost":1
}
]
}
]

}
Loading

0 comments on commit 4277f34

Please sign in to comment.