mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-10-30 17:47:50 +00:00
read fiber con_in, con_out, EOL & max_length default values
read fiber spans default values from eqpt_config.json[Spans] =>if con_in/con_out is None or not defined in params Rename connector_loss_in/out to con_in/out for consistency update parser tests to accept the new con_in/out syntax and the new default values Signed-off-by: Jean-Luc Auge <jeanluc.auge@orange.com>
This commit is contained in:
@@ -44,8 +44,9 @@
|
||||
"length_units": "km",
|
||||
"max_loss": 28,
|
||||
"padding": 10,
|
||||
"EOL": 1,
|
||||
"con_loss": 0.5
|
||||
"EOL": 0,
|
||||
"con_in": 0,
|
||||
"con_out": 0
|
||||
}
|
||||
],
|
||||
"Roadms":[{
|
||||
|
||||
@@ -40,7 +40,7 @@ class Link(namedtuple('Link', 'from_city to_city \
|
||||
distance_units')):
|
||||
def __new__(cls, from_city, to_city,
|
||||
east_distance, east_fiber='SSMF', east_lineic=0.2,
|
||||
east_con_in=0, east_con_out=0, east_pmd=0.1, east_cable='',
|
||||
east_con_in=None, east_con_out=None, east_pmd=0.1, east_cable='',
|
||||
west_distance='', west_fiber='', west_lineic='',
|
||||
west_con_in='', west_con_out='', west_pmd='', west_cable='',
|
||||
distance_units='km'):
|
||||
@@ -48,7 +48,7 @@ class Link(namedtuple('Link', 'from_city to_city \
|
||||
east_pmd, east_cable]
|
||||
west_values = [west_distance, west_fiber, west_lineic, west_con_in, west_con_out,
|
||||
west_pmd, west_cable]
|
||||
default_values = [80,'SSMF',0.2,0,0,0.1,'']
|
||||
default_values = [80,'SSMF',0.2,None,None,0.1,'']
|
||||
east_values = [x[0] if x[0] != '' else x[1] for x in zip(east_values,default_values)]
|
||||
west_values = [x[0] if x[0] != '' else x[1] for x in zip(west_values,east_values)]
|
||||
return super().__new__(cls, from_city, to_city, *east_values, *west_values, distance_units)
|
||||
@@ -157,8 +157,8 @@ def convert_file(input_filename, filter_region=[]):
|
||||
'params': {'length': round(x.east_distance, 3),
|
||||
'length_units': x.distance_units,
|
||||
'loss_coef': x.east_lineic,
|
||||
'connector_loss_in':x.east_con_in,
|
||||
'connector_loss_out':x.east_con_out}
|
||||
'con_in':x.east_con_in,
|
||||
'con_out':x.east_con_out}
|
||||
}
|
||||
for x in links] +
|
||||
[{'uid': f'fiber ({x.to_city} → {x.from_city})-{x.west_cable}',
|
||||
@@ -169,8 +169,8 @@ def convert_file(input_filename, filter_region=[]):
|
||||
'params': {'length': round(x.west_distance, 3),
|
||||
'length_units': x.distance_units,
|
||||
'loss_coef': x.west_lineic,
|
||||
'connector_loss_in':x.west_con_in,
|
||||
'connector_loss_out':x.west_con_out}
|
||||
'con_in':x.west_con_in,
|
||||
'con_out':x.west_con_out}
|
||||
} # missing ILA construction
|
||||
for x in links] +
|
||||
[{'uid': f'egress edfa in {e.from_city} to {e.to_city}',
|
||||
|
||||
@@ -155,23 +155,25 @@ class Fused(Node):
|
||||
print('pi',pref.pi)
|
||||
return spectral_info.update(carriers=carriers, pref=pref)
|
||||
|
||||
FiberParams = namedtuple('FiberParams', 'type_variety length loss_coef length_units connector_loss_in connector_loss_out dispersion gamma')
|
||||
FiberParams = namedtuple('FiberParams', 'type_variety length loss_coef length_units con_in con_out dispersion gamma')
|
||||
|
||||
class Fiber(Node):
|
||||
def __init__(self, *args, params=None, **kwargs):
|
||||
if params is None:
|
||||
params = {}
|
||||
if 'connector_loss_in' not in params :
|
||||
# test added to ensure backward compatibility in case loss was not in the json
|
||||
params['connector_loss_in'] = 0.0
|
||||
params['connector_loss_out'] = 0.0
|
||||
if 'con_in' not in params :
|
||||
# if not defined in the network json
|
||||
# the None value will be updated in network.py[build_network]
|
||||
# with default values from eqpt_config.json[Spans]
|
||||
params['con_in'] = None
|
||||
params['con_out'] = None
|
||||
super().__init__(*args, params=FiberParams(**params), **kwargs)
|
||||
self.type_variety = self.params.type_variety
|
||||
self.length = self.params.length * UNITS[self.params.length_units] # in m
|
||||
self.loss_coef = self.params.loss_coef * 1e-3 # lineic loss dB/m
|
||||
self.lin_loss_coef = self.params.loss_coef / (20 * log10(exp(1)))
|
||||
self.connector_loss_in = self.params.connector_loss_in
|
||||
self.connector_loss_out = self.params.connector_loss_out
|
||||
self.con_in = self.params.con_in
|
||||
self.con_out = self.params.con_out
|
||||
self.dispersion = self.params.dispersion # s/m/m
|
||||
self.gamma = self.params.gamma # 1/W/m
|
||||
self.pch_out = None
|
||||
@@ -186,12 +188,13 @@ class Fiber(Node):
|
||||
f' type_variety: {self.type_variety}',
|
||||
f' length (m): {self.length:.2f}',
|
||||
f' loss (dB): {self.loss:.2f}',
|
||||
f' (includes conn loss (dB) in: {self.connector_loss_in:.2f} out: {self.connector_loss_out:.2f})'])
|
||||
f' (includes conn loss (dB) in: {self.con_in:.2f} out: {self.con_out:.2f})',
|
||||
f' (conn loss out includes EOL margin defined in eqpt_config.json)'])
|
||||
|
||||
@property
|
||||
def loss(self):
|
||||
# dB loss: useful for polymorphism (roadm, fiber, att)
|
||||
return self.loss_coef * self.length + self.connector_loss_in + self.connector_loss_out
|
||||
return self.loss_coef * self.length + self.con_in + self.con_out
|
||||
|
||||
@property
|
||||
def passive(self):
|
||||
@@ -273,7 +276,7 @@ class Fiber(Node):
|
||||
def propagate(self, *carriers):
|
||||
|
||||
# apply connector_att_in on all carriers before computing gn analytics premiere partie pas bonne
|
||||
attenuation = db2lin(self.connector_loss_in)
|
||||
attenuation = db2lin(self.con_in)
|
||||
|
||||
chan = []
|
||||
for carrier in carriers:
|
||||
@@ -287,7 +290,7 @@ class Fiber(Node):
|
||||
carriers = tuple(f for f in chan)
|
||||
|
||||
# propagate in the fiber and apply attenuation out
|
||||
attenuation = db2lin(self.connector_loss_out)
|
||||
attenuation = db2lin(self.con_out)
|
||||
for carrier in carriers:
|
||||
pwr = carrier.power
|
||||
carrier_nli = self._gn_analytic(carrier, *carriers)
|
||||
|
||||
@@ -18,7 +18,7 @@ from collections import namedtuple
|
||||
Model_vg = namedtuple('Model_vg', 'nf1 nf2 delta_p')
|
||||
Model_fg = namedtuple('Model_fg', 'nf0')
|
||||
Fiber = namedtuple('Fiber', 'type_variety dispersion gamma')
|
||||
Spans = namedtuple('Spans', 'power_mode max_length length_units max_loss padding EOL con_loss')
|
||||
Spans = namedtuple('Spans', 'power_mode max_length length_units max_loss padding EOL con_in con_out')
|
||||
Transceiver = namedtuple('Transceiver', 'type_variety frequency mode')
|
||||
Roadms = namedtuple('Roadms', 'gain_mode_default_loss power_mode_pref')
|
||||
SI = namedtuple('SI', 'f_min f_max baud_rate spacing roll_off \
|
||||
|
||||
@@ -186,13 +186,18 @@ def split_fiber(network, fiber, bounds, target, equipment):
|
||||
network.remove_edge(fiber, next_node)
|
||||
network.remove_edge(prev_node, fiber)
|
||||
network.remove_node(fiber)
|
||||
# update connector loss parameter with default values
|
||||
fiber_params = fiber.params._asdict()
|
||||
fiber_params['con_in'] = fiber.con_in
|
||||
fiber_params['con_out'] = fiber.con_out
|
||||
new_spans = [
|
||||
Fiber(
|
||||
uid = f'{fiber.uid}_({span}/{n_spans})',
|
||||
metadata = fiber.metadata,
|
||||
params = fiber.params._asdict()
|
||||
params = fiber_params
|
||||
) for span in range(n_spans)
|
||||
]
|
||||
|
||||
new_spans[0].length = new_length
|
||||
network.add_node(new_spans[0])
|
||||
network.add_edge(prev_node, new_spans[0])
|
||||
@@ -206,8 +211,21 @@ def split_fiber(network, fiber, bounds, target, equipment):
|
||||
network.add_edge(prev_node, next_node)
|
||||
add_egress_amplifier(network, prev_node, equipment)
|
||||
|
||||
def build_network(network, equipment, bounds=range(75_000, 150_000), target=100_000):
|
||||
def add_connector_loss(fibers, con_in, con_out):
|
||||
for fiber in fibers:
|
||||
if fiber.con_in is None: fiber.con_in = con_in
|
||||
if fiber.con_out is None: fiber.con_out = con_out
|
||||
|
||||
def build_network(network, equipment):
|
||||
default_span_data = equipment['Spans']['default']
|
||||
max_length = int(default_span_data.max_length * UNITS[default_span_data.length_units])
|
||||
bounds = range(75_000, max_length)
|
||||
target = 100_000
|
||||
con_in = default_span_data.con_in
|
||||
con_out = default_span_data.con_out + default_span_data.EOL
|
||||
|
||||
fibers = [f for f in network.nodes() if isinstance(f, Fiber)]
|
||||
add_connector_loss(fibers, con_in, con_out)
|
||||
for fiber in fibers:
|
||||
split_fiber(network, fiber, bounds, target, equipment)
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
"length": 80.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 1.00,
|
||||
"connector_loss_out": 1.00
|
||||
"con_in": 1.00,
|
||||
"con_out": 1.00
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -68,8 +68,8 @@
|
||||
"length": 80.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 1.00,
|
||||
"connector_loss_out": 1.00
|
||||
"con_in": 1.00,
|
||||
"con_out": 1.00
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -86,8 +86,8 @@
|
||||
"length": 80.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 1.00,
|
||||
"connector_loss_out": 1.00
|
||||
"con_in": 1.00,
|
||||
"con_out": 1.00
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -104,8 +104,8 @@
|
||||
"length": 80.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 1.00,
|
||||
"connector_loss_out": 1.00
|
||||
"con_in": 1.00,
|
||||
"con_out": 1.00
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -122,8 +122,8 @@
|
||||
"length": 80.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 1.00,
|
||||
"connector_loss_out": 1.00
|
||||
"con_in": 1.00,
|
||||
"con_out": 1.00
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,13 +40,14 @@
|
||||
}
|
||||
],
|
||||
"Spans":[{
|
||||
"power_mode": true,
|
||||
"power_mode": false,
|
||||
"max_length": 150,
|
||||
"length_units": "km",
|
||||
"max_loss": 28,
|
||||
"padding": 10,
|
||||
"EOL": 1,
|
||||
"con_loss": 0.5
|
||||
"EOL": 0,
|
||||
"con_in": 0,
|
||||
"con_out": 0
|
||||
}
|
||||
],
|
||||
"Roadms":[{
|
||||
@@ -75,14 +76,14 @@
|
||||
{
|
||||
"format": "PS_SP64_1",
|
||||
"baud_rate": 32e9,
|
||||
"OSNR": 9,
|
||||
"OSNR": 11,
|
||||
"bit_rate": 100e9,
|
||||
"roll_off": 0.15
|
||||
},
|
||||
{
|
||||
"format": "PS_SP64_2",
|
||||
"baud_rate": 66e9,
|
||||
"OSNR": 10,
|
||||
"baud_rate": 64e9,
|
||||
"OSNR": 15,
|
||||
"bit_rate": 200e9,
|
||||
"roll_off": 0.15
|
||||
}
|
||||
@@ -98,7 +99,7 @@
|
||||
{
|
||||
"format": "16QAM",
|
||||
"baud_rate": 32e9,
|
||||
"OSNR": 15,
|
||||
"OSNR": 19,
|
||||
"bit_rate": 200e9,
|
||||
"roll_off": 0.15
|
||||
}
|
||||
|
||||
@@ -182,8 +182,8 @@
|
||||
"length": 20.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -200,8 +200,8 @@
|
||||
"length": 50.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -218,8 +218,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -236,8 +236,8 @@
|
||||
"length": 10.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -254,8 +254,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -272,8 +272,8 @@
|
||||
"length": 65.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -290,8 +290,8 @@
|
||||
"length": 40.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -308,8 +308,8 @@
|
||||
"length": 35.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -326,8 +326,8 @@
|
||||
"length": 20.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -344,8 +344,8 @@
|
||||
"length": 50.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -362,8 +362,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -380,8 +380,8 @@
|
||||
"length": 10.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -398,8 +398,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -416,8 +416,8 @@
|
||||
"length": 65.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -434,8 +434,8 @@
|
||||
"length": 40.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -452,8 +452,8 @@
|
||||
"length": 35.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -254,8 +254,8 @@
|
||||
"length": 20.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -272,8 +272,8 @@
|
||||
"length": 50.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -290,8 +290,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -308,8 +308,8 @@
|
||||
"length": 10.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -326,8 +326,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -344,8 +344,8 @@
|
||||
"length": 65.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -362,8 +362,8 @@
|
||||
"length": 40.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -380,8 +380,8 @@
|
||||
"length": 35.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -398,8 +398,8 @@
|
||||
"length": 80.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -416,8 +416,8 @@
|
||||
"length": 20.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -434,8 +434,8 @@
|
||||
"length": 50.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -452,8 +452,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -470,8 +470,8 @@
|
||||
"length": 10.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -488,8 +488,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -506,8 +506,8 @@
|
||||
"length": 65.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -524,8 +524,8 @@
|
||||
"length": 40.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -542,8 +542,8 @@
|
||||
"length": 35.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -560,8 +560,8 @@
|
||||
"length": 80.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -254,8 +254,8 @@
|
||||
"length": 20.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -272,8 +272,8 @@
|
||||
"length": 50.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -290,8 +290,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -308,8 +308,8 @@
|
||||
"length": 10.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -326,8 +326,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -344,8 +344,8 @@
|
||||
"length": 65.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -362,8 +362,8 @@
|
||||
"length": 40.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -380,8 +380,8 @@
|
||||
"length": 35.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -398,8 +398,8 @@
|
||||
"length": 80.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -416,8 +416,8 @@
|
||||
"length": 20.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -434,8 +434,8 @@
|
||||
"length": 50.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -452,8 +452,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -470,8 +470,8 @@
|
||||
"length": 10.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -488,8 +488,8 @@
|
||||
"length": 60.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -506,8 +506,8 @@
|
||||
"length": 65.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -524,8 +524,8 @@
|
||||
"length": 40.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -542,8 +542,8 @@
|
||||
"length": 35.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -560,8 +560,8 @@
|
||||
"length": 80.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2,
|
||||
"connector_loss_in": 0.5,
|
||||
"connector_loss_out": 0.5
|
||||
"con_in": null,
|
||||
"con_out": null
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@@ -28,7 +28,7 @@ def nch_and_spacing(request):
|
||||
"""parametrize channel count vs channel spacing (Hz)"""
|
||||
yield request.param
|
||||
|
||||
def propagation(input_power, connector_loss_in, connector_loss_out,dest):
|
||||
def propagation(input_power, con_in, con_out,dest):
|
||||
equipment = load_equipment(eqpt_library_name)
|
||||
network = load_network(network_file_name,equipment)
|
||||
|
||||
@@ -37,10 +37,10 @@ def propagation(input_power, connector_loss_in, connector_loss_out,dest):
|
||||
for e in network.nodes():
|
||||
if isinstance(e, Fiber):
|
||||
loss = e.loss_coef * e.length
|
||||
e.connector_loss_in = connector_loss_in
|
||||
e.connector_loss_out = connector_loss_out
|
||||
e.con_in = con_in
|
||||
e.con_out = con_out
|
||||
if isinstance(e, Edfa):
|
||||
e.operational.gain_target = loss + connector_loss_in + connector_loss_out
|
||||
e.operational.gain_target = loss + con_in + con_out
|
||||
|
||||
transceivers = {n.uid: n for n in network.nodes() if isinstance(n, Transceiver)}
|
||||
|
||||
@@ -65,7 +65,7 @@ def propagation(input_power, connector_loss_in, connector_loss_out,dest):
|
||||
edfa_sample = next(el for el in path if isinstance(el, Edfa))
|
||||
nf = mean(edfa_sample.nf)
|
||||
|
||||
print(f'pw: {input_power} conn in: {connector_loss_in} con out: {connector_loss_out} ' +
|
||||
print(f'pw: {input_power} conn in: {con_in} con out: {con_out} ' +
|
||||
f'OSNR@0.1nm: {round(mean(sink.osnr_ase_01nm),2)} SNR@bandwitdth: {round(mean(sink.snr),2)}')
|
||||
return sink , nf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user