mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-10-29 17:22:42 +00:00
Use design delta_p and gains instead of p_spani
Remove the visualisation of the effective_pch in amp because actual and target are the relevant ones. effective_pch was artificially related to a mix of reference channel and noisy channel (mixed between on the fly redesign but using actual ROADM equalisation which includes noise in its actual loss). the change does no more rely on the target power (which is rounded) but on the designed gain, which is not rounded. Propagations are slightly changed for openroadm simulations because of that. (I verified) The gain of amp was estimated on the fly with p_spni also in case of RamanFiber preceding elements. removing p_spani requies that an estimation of Raman gain be done during design. This commit also adds this estimation. Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com> Change-Id: I960b85e99f85a7d168ac5349e325c4928fa5673b
This commit is contained in:
@@ -838,9 +838,10 @@ class Edfa(_Node):
|
||||
f' pad att_in (dB): {self.att_in:.2f}',
|
||||
f' Power In (dBm): {self.pin_db:.2f}',
|
||||
f' Power Out (dBm): {self.pout_db:.2f}',
|
||||
f' Delta_P (dB): ' + (f'{self.delta_p:.2f}' if self.delta_p is not None else 'None'),
|
||||
f' target pch (dBm): ' + (f'{self.target_pch_out_db:.2f}' if self.target_pch_out_db is not None else 'None'),
|
||||
f' effective pch (dBm): {self.effective_pch_out_db:.2f}',
|
||||
' Delta_P (dB): ' + (f'{self.delta_p:.2f}'
|
||||
if self.delta_p is not None else 'None'),
|
||||
' target pch (dBm): ' + (f'{self.target_pch_out_db:.2f}'
|
||||
if self.target_pch_out_db is not None else 'None'),
|
||||
f' actual pch out (dBm): {total_pch}',
|
||||
f' output VOA (dB): {self.out_voa:.2f}'])
|
||||
|
||||
@@ -869,16 +870,14 @@ class Edfa(_Node):
|
||||
self.slot_width = self.channel_freq[1] - self.channel_freq[0]
|
||||
|
||||
"""in power mode: delta_p is defined and can be used to calculate the power target
|
||||
This power target is used calculate the amplifier gain"""
|
||||
This power target correspond to the channel used for design"""
|
||||
pref = spectral_info.pref
|
||||
if self.delta_p is not None and self.operational.delta_p is not None:
|
||||
# use the user defined target
|
||||
self.target_pch_out_db = round(self.operational.delta_p + pref.p_span0, 2)
|
||||
self.effective_gain = self.target_pch_out_db - pref.p_spani
|
||||
elif self.delta_p is not None:
|
||||
# use the design target if no target were set
|
||||
self.target_pch_out_db = round(self.delta_p + pref.p_span0, 2)
|
||||
self.effective_gain = self.target_pch_out_db - pref.p_spani
|
||||
|
||||
"""check power saturation and correct effective gain & power accordingly:"""
|
||||
# Compute the saturation accounting for actual power at the input of the amp
|
||||
@@ -886,7 +885,6 @@ class Edfa(_Node):
|
||||
self.effective_gain,
|
||||
self.params.p_max - self.pin_db
|
||||
)
|
||||
self.effective_pch_out_db = round(pref.p_spani + self.effective_gain, 2)
|
||||
|
||||
"""check power saturation and correct target_gain accordingly:"""
|
||||
self.nf = self._calc_nf()
|
||||
|
||||
@@ -8,15 +8,17 @@ gnpy.core.network
|
||||
Working with networks which consist of network elements
|
||||
"""
|
||||
|
||||
from copy import deepcopy
|
||||
from operator import attrgetter
|
||||
from collections import namedtuple
|
||||
from logging import getLogger
|
||||
|
||||
from gnpy.core import elements
|
||||
from gnpy.core.exceptions import ConfigurationError, NetworkTopologyError
|
||||
from gnpy.core.utils import round2float, convert_length, psd2powerdbm, lin2db, watt2dbm
|
||||
from gnpy.core.info import ReferenceCarrier
|
||||
from gnpy.tools.json_io import Amp
|
||||
from gnpy.core.utils import round2float, convert_length, psd2powerdbm, lin2db, watt2dbm, dbm2watt
|
||||
from gnpy.core.info import ReferenceCarrier, create_input_spectral_information
|
||||
from gnpy.tools import json_io
|
||||
from gnpy.core.parameters import SimParams
|
||||
|
||||
|
||||
logger = getLogger(__name__)
|
||||
@@ -134,7 +136,7 @@ def target_power(network, node, equipment): # get_fiber_dp
|
||||
SPAN_LOSS_REF = 20
|
||||
POWER_SLOPE = 0.3
|
||||
dp_range = list(equipment['Span']['default'].delta_power_range_db)
|
||||
node_loss = span_loss(network, node)
|
||||
node_loss = span_loss(network, node, equipment)
|
||||
|
||||
try:
|
||||
dp = round2float((node_loss - SPAN_LOSS_REF) * POWER_SLOPE, dp_range[2])
|
||||
@@ -181,12 +183,64 @@ def next_node_generator(network, node):
|
||||
yield from next_node_generator(network, next_node)
|
||||
|
||||
|
||||
def span_loss(network, node):
|
||||
def estimate_raman_gain(node, equipment):
|
||||
"""If node is RamanFiber, then estimate the possible Raman gain if any
|
||||
for this purpose propagate a fake signal in a copy.
|
||||
to be accurate the nb of channel should be the same as in SI, but this increases computation time
|
||||
"""
|
||||
f_min = equipment['SI']['default'].f_min
|
||||
f_max = equipment['SI']['default'].f_max
|
||||
roll_off = equipment['SI']['default'].roll_off
|
||||
baud_rate = equipment['SI']['default'].baud_rate
|
||||
power_dbm = equipment['SI']['default'].power_dbm
|
||||
power = dbm2watt(equipment['SI']['default'].power_dbm)
|
||||
spacing = equipment['SI']['default'].spacing
|
||||
tx_osnr = equipment['SI']['default'].tx_osnr
|
||||
|
||||
sim_params = {
|
||||
"raman_params": {
|
||||
"flag": True,
|
||||
"result_spatial_resolution": 10e3,
|
||||
"solver_spatial_resolution": 50
|
||||
},
|
||||
"nli_params": {
|
||||
"method": "ggn_spectrally_separated",
|
||||
"dispersion_tolerance": 1,
|
||||
"phase_shift_tolerance": 0.1,
|
||||
"computed_channels": [1, 18, 37, 56, 75]
|
||||
}
|
||||
}
|
||||
if isinstance(node, elements.RamanFiber):
|
||||
# in order to take into account gain generated in RamanFiber, propagate in the RamanFiber with
|
||||
# SI reference channel.
|
||||
spectral_info_input = create_input_spectral_information(f_min=f_min, f_max=f_max, roll_off=roll_off,
|
||||
baud_rate=baud_rate, power=power, spacing=spacing,
|
||||
tx_osnr=tx_osnr)
|
||||
n_copy = deepcopy(node)
|
||||
# need to set ref_pch_in_dbm in order to correctly run propagate of the element, because this
|
||||
# setting has not yet been done by autodesign
|
||||
n_copy.ref_pch_in_dbm = power_dbm
|
||||
SimParams.set_params(sim_params)
|
||||
pin = watt2dbm(sum(spectral_info_input.signal))
|
||||
spectral_info_out = n_copy(spectral_info_input)
|
||||
pout = watt2dbm(sum(spectral_info_out.signal))
|
||||
estimated_gain = pout - pin + node.loss
|
||||
return round(estimated_gain, 2)
|
||||
else:
|
||||
return 0.0
|
||||
|
||||
|
||||
def span_loss(network, node, equipment):
|
||||
"""Total loss of a span (Fiber and Fused nodes) which contains the given node"""
|
||||
loss = node.loss if node.passive else 0
|
||||
loss += sum(n.loss for n in prev_node_generator(network, node))
|
||||
loss += sum(n.loss for n in next_node_generator(network, node))
|
||||
return loss
|
||||
# add the possible Raman gain
|
||||
gain = estimate_raman_gain(node, equipment)
|
||||
gain += sum(estimate_raman_gain(n, equipment) for n in prev_node_generator(network, node))
|
||||
gain += sum(estimate_raman_gain(n, equipment) for n in next_node_generator(network, node))
|
||||
|
||||
return loss - gain
|
||||
|
||||
|
||||
def find_first_node(network, node):
|
||||
@@ -252,7 +306,7 @@ def set_egress_amplifier(network, this_node, equipment, pref_ch_db, pref_total_d
|
||||
raise NetworkTopologyError(f'Loop detected for {type(node).__name__} {node.uid}, '
|
||||
+ 'please check network topology')
|
||||
if isinstance(node, elements.Edfa):
|
||||
node_loss = span_loss(network, prev_node)
|
||||
node_loss = span_loss(network, prev_node, equipment)
|
||||
voa = node.out_voa if node.out_voa else 0
|
||||
if node.operational.delta_p is None:
|
||||
dp = target_power(network, next_node, equipment) + voa
|
||||
@@ -450,7 +504,7 @@ def add_roadm_booster(network, roadm):
|
||||
network.remove_edge(roadm, next_node)
|
||||
amp = elements.Edfa(
|
||||
uid=f'Edfa_booster_{roadm.uid}_to_{next_node.uid}',
|
||||
params=Amp.default_values,
|
||||
params=json_io.Amp.default_values,
|
||||
metadata={
|
||||
'location': {
|
||||
'latitude': roadm.lat,
|
||||
@@ -476,7 +530,7 @@ def add_roadm_preamp(network, roadm):
|
||||
network.remove_edge(prev_node, roadm)
|
||||
amp = elements.Edfa(
|
||||
uid=f'Edfa_preamp_{roadm.uid}_from_{prev_node.uid}',
|
||||
params=Amp.default_values,
|
||||
params=json_io.Amp.default_values,
|
||||
metadata={
|
||||
'location': {
|
||||
'latitude': roadm.lat,
|
||||
@@ -505,7 +559,7 @@ def add_inline_amplifier(network, fiber):
|
||||
network.remove_edge(fiber, next_node)
|
||||
amp = elements.Edfa(
|
||||
uid=f'Edfa_{fiber.uid}',
|
||||
params=Amp.default_values,
|
||||
params=json_io.Amp.default_values,
|
||||
metadata={
|
||||
'location': {
|
||||
'latitude': (fiber.lat + next_node.lat) / 2,
|
||||
@@ -607,7 +661,7 @@ def add_connector_loss(network, fibers, default_con_in, default_con_out, EOL):
|
||||
fiber.params.con_out += EOL
|
||||
|
||||
|
||||
def add_fiber_padding(network, fibers, padding):
|
||||
def add_fiber_padding(network, fibers, padding, equipment):
|
||||
"""last_fibers = (fiber for n in network.nodes()
|
||||
if not (isinstance(n, elements.Fiber) or isinstance(n, elements.Fused))
|
||||
for fiber in network.predecessors(n)
|
||||
@@ -616,7 +670,7 @@ def add_fiber_padding(network, fibers, padding):
|
||||
next_node = get_next_node(fiber, network)
|
||||
if isinstance(next_node, elements.Fused):
|
||||
continue
|
||||
this_span_loss = span_loss(network, fiber)
|
||||
this_span_loss = span_loss(network, fiber, equipment)
|
||||
if this_span_loss < padding:
|
||||
# add a padding att_in at the input of the 1st fiber:
|
||||
# address the case when several fibers are spliced together
|
||||
@@ -657,7 +711,7 @@ def add_missing_fiber_attributes(network, equipment):
|
||||
add_connector_loss(network, fibers, default_span_data.con_in, default_span_data.con_out, default_span_data.EOL)
|
||||
# don't group split fiber and add amp in the same loop
|
||||
# =>for code clarity (at the expense of speed):
|
||||
add_fiber_padding(network, fibers, default_span_data.padding)
|
||||
add_fiber_padding(network, fibers, default_span_data.padding, equipment)
|
||||
|
||||
|
||||
def build_network(network, equipment, pref_ch_db, pref_total_db, set_connector_losses=True, verbose=True):
|
||||
|
||||
@@ -24,6 +24,7 @@ from numpy import mean, argmin
|
||||
from gnpy.core.elements import Transceiver, Roadm
|
||||
from gnpy.core.utils import lin2db
|
||||
from gnpy.core.info import create_input_spectral_information, carriers_to_spectral_information, ReferenceCarrier
|
||||
from gnpy.core import network as network_module
|
||||
from gnpy.core.exceptions import ServiceError, DisjunctionError
|
||||
from copy import deepcopy
|
||||
from csv import writer
|
||||
@@ -1102,6 +1103,7 @@ def compute_path_with_disjunction(network, equipment, pathreqlist, pathlist):
|
||||
# elements to simulate performance, several demands having the same destination
|
||||
# may use the same transponder for the performance simulation. This is why
|
||||
# we use deepcopy: to ensure that each propagation is recorded and not overwritten
|
||||
network_module.design_network(pathreq, network, equipment, set_connector_losses=False, verbose=False)
|
||||
total_path = deepcopy(pathlist[i])
|
||||
msg = msg + f'\n\tComputed path (roadms):{[e.uid for e in total_path if isinstance(e, Roadm)]}'
|
||||
LOGGER.info(msg)
|
||||
|
||||
@@ -31,7 +31,6 @@ Edfa Edfa_booster_roadm_Stockholm_to_fiber (Stockholm → Norrköping)_(1/2)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Stockholm → Norrköping)_(1/2)
|
||||
@@ -54,8 +53,7 @@ Edfa Edfa_fiber (Stockholm → Norrköping)_(1/2)
|
||||
Power Out (dBm): 21.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.02
|
||||
actual pch out (dBm): 2.01
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Stockholm → Norrköping)_(2/2)
|
||||
type_variety: SSMF
|
||||
@@ -65,7 +63,7 @@ Fiber fiber (Stockholm → Norrköping)_(2/2)
|
||||
(includes conn loss (dB) in: 0.00 out: 0.00)
|
||||
(conn loss out includes EOL margin defined in eqpt_config.json)
|
||||
reference pch out (dBm): -14.33
|
||||
actual pch out (dBm): -14.29
|
||||
actual pch out (dBm): -14.30
|
||||
Edfa Edfa_preamp_roadm_Norrköping_from_fiber (Stockholm → Norrköping)_(2/2)
|
||||
type_variety: openroadm_mw_mw_preamp
|
||||
effective gain(dB): 16.33
|
||||
@@ -73,12 +71,11 @@ Edfa Edfa_preamp_roadm_Norrköping_from_fiber (Stockholm → Norrköping)_(2/2)
|
||||
noise figure (dB): 12.59
|
||||
(including att_in)
|
||||
pad att_in (dB): 0.00
|
||||
Power In (dBm): 5.53
|
||||
Power Out (dBm): 21.87
|
||||
Power In (dBm): 5.52
|
||||
Power Out (dBm): 21.86
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.04
|
||||
actual pch out (dBm): 2.03
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Norrköping
|
||||
effective loss (dB): 22.00
|
||||
@@ -95,7 +92,6 @@ Edfa Edfa_booster_roadm_Norrköping_to_fiber (Norrköping → Linköping)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Norrköping → Linköping)
|
||||
@@ -118,7 +114,6 @@ Edfa Edfa_preamp_roadm_Linköping_from_fiber (Norrköping → Linköping)
|
||||
Power Out (dBm): 21.83
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.01
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Linköping
|
||||
@@ -136,7 +131,6 @@ Edfa Edfa_booster_roadm_Linköping_to_fiber (Linköping → Jönköping)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Linköping → Jönköping)
|
||||
@@ -156,11 +150,10 @@ Edfa Edfa_preamp_roadm_Jönköping_from_fiber (Linköping → Jönköping)
|
||||
(including att_in)
|
||||
pad att_in (dB): 0.00
|
||||
Power In (dBm): -4.97
|
||||
Power Out (dBm): 21.86
|
||||
Power Out (dBm): 21.87
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.04
|
||||
actual pch out (dBm): 2.05
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Jönköping
|
||||
effective loss (dB): 22.00
|
||||
@@ -177,7 +170,6 @@ Edfa Edfa_booster_roadm_Jönköping_to_fiber (Jönköping → Borås)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Jönköping → Borås)
|
||||
@@ -200,7 +192,6 @@ Edfa Edfa_preamp_roadm_Borås_from_fiber (Jönköping → Borås)
|
||||
Power Out (dBm): 21.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.02
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Borås
|
||||
@@ -218,7 +209,6 @@ Edfa Edfa_booster_roadm_Borås_to_fiber (Borås → Gothenburg)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Borås → Gothenburg)
|
||||
@@ -241,7 +231,6 @@ Edfa Edfa_preamp_roadm_Gothenburg_from_fiber (Borås → Gothenburg)
|
||||
Power Out (dBm): 21.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.02
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Gothenburg
|
||||
|
||||
@@ -31,7 +31,6 @@ Edfa Edfa_booster_roadm_Stockholm_to_fiber (Stockholm → Norrköping)_(1/2)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Stockholm → Norrköping)_(1/2)
|
||||
@@ -54,8 +53,7 @@ Edfa Edfa_fiber (Stockholm → Norrköping)_(1/2)
|
||||
Power Out (dBm): 21.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.02
|
||||
actual pch out (dBm): 2.01
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Stockholm → Norrköping)_(2/2)
|
||||
type_variety: SSMF
|
||||
@@ -65,20 +63,19 @@ Fiber fiber (Stockholm → Norrköping)_(2/2)
|
||||
(includes conn loss (dB) in: 0.00 out: 0.00)
|
||||
(conn loss out includes EOL margin defined in eqpt_config.json)
|
||||
reference pch out (dBm): -14.33
|
||||
actual pch out (dBm): -14.29
|
||||
actual pch out (dBm): -14.30
|
||||
Edfa Edfa_preamp_roadm_Norrköping_from_fiber (Stockholm → Norrköping)_(2/2)
|
||||
type_variety: openroadm_mw_mw_preamp_worstcase_ver5
|
||||
effective gain(dB): 16.33
|
||||
(before att_in and before output VOA)
|
||||
noise figure (dB): 11.44
|
||||
noise figure (dB): 11.43
|
||||
(including att_in)
|
||||
pad att_in (dB): 0.00
|
||||
Power In (dBm): 5.53
|
||||
Power Out (dBm): 21.86
|
||||
Power In (dBm): 5.52
|
||||
Power Out (dBm): 21.85
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.04
|
||||
actual pch out (dBm): 2.03
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Norrköping
|
||||
effective loss (dB): 22.00
|
||||
@@ -95,7 +92,6 @@ Edfa Edfa_booster_roadm_Norrköping_to_fiber (Norrköping → Linköping)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Norrköping → Linköping)
|
||||
@@ -118,7 +114,6 @@ Edfa Edfa_preamp_roadm_Linköping_from_fiber (Norrköping → Linköping)
|
||||
Power Out (dBm): 21.83
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.01
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Linköping
|
||||
@@ -136,7 +131,6 @@ Edfa Edfa_booster_roadm_Linköping_to_fiber (Linköping → Jönköping)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Linköping → Jönköping)
|
||||
@@ -156,10 +150,9 @@ Edfa Edfa_preamp_roadm_Jönköping_from_fiber (Linköping → Jönköping)
|
||||
(including att_in)
|
||||
pad att_in (dB): 0.00
|
||||
Power In (dBm): -4.97
|
||||
Power Out (dBm): 21.86
|
||||
Power Out (dBm): 21.87
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.04
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Jönköping
|
||||
@@ -177,7 +170,6 @@ Edfa Edfa_booster_roadm_Jönköping_to_fiber (Jönköping → Borås)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Jönköping → Borås)
|
||||
@@ -200,8 +192,7 @@ Edfa Edfa_preamp_roadm_Borås_from_fiber (Jönköping → Borås)
|
||||
Power Out (dBm): 21.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.01
|
||||
actual pch out (dBm): 2.02
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Borås
|
||||
effective loss (dB): 22.00
|
||||
@@ -218,7 +209,6 @@ Edfa Edfa_booster_roadm_Borås_to_fiber (Borås → Gothenburg)
|
||||
Power Out (dBm): 21.82
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.00
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Borås → Gothenburg)
|
||||
@@ -241,7 +231,6 @@ Edfa Edfa_preamp_roadm_Gothenburg_from_fiber (Borås → Gothenburg)
|
||||
Power Out (dBm): 21.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 2.00
|
||||
effective pch (dBm): 2.00
|
||||
actual pch out (dBm): 2.02
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm_Gothenburg
|
||||
|
||||
@@ -108,7 +108,7 @@ Transceiver trx Rennes_STA
|
||||
Propagating with input power = [1;36;40m1.50 dBm[0m:
|
||||
Transceiver trx Rennes_STA
|
||||
GSNR (0.1nm, dB): 24.02
|
||||
GSNR (signal bw, dB): 19.94
|
||||
GSNR (signal bw, dB): 19.93
|
||||
OSNR ASE (0.1nm, dB): 26.55
|
||||
OSNR ASE (signal bw, dB): 22.47
|
||||
CD (ps/nm): 3340.00
|
||||
@@ -119,7 +119,7 @@ Transceiver trx Rennes_STA
|
||||
Propagating with input power = [1;36;40m2.00 dBm[0m:
|
||||
Transceiver trx Rennes_STA
|
||||
GSNR (0.1nm, dB): 24.02
|
||||
GSNR (signal bw, dB): 19.94
|
||||
GSNR (signal bw, dB): 19.93
|
||||
OSNR ASE (0.1nm, dB): 26.55
|
||||
OSNR ASE (signal bw, dB): 22.47
|
||||
CD (ps/nm): 3340.00
|
||||
@@ -130,7 +130,7 @@ Transceiver trx Rennes_STA
|
||||
Propagating with input power = [1;36;40m2.50 dBm[0m:
|
||||
Transceiver trx Rennes_STA
|
||||
GSNR (0.1nm, dB): 24.02
|
||||
GSNR (signal bw, dB): 19.94
|
||||
GSNR (signal bw, dB): 19.93
|
||||
OSNR ASE (0.1nm, dB): 26.55
|
||||
OSNR ASE (signal bw, dB): 22.47
|
||||
CD (ps/nm): 3340.00
|
||||
@@ -141,7 +141,7 @@ Transceiver trx Rennes_STA
|
||||
Propagating with input power = [1;36;40m3.00 dBm[0m:
|
||||
Transceiver trx Rennes_STA
|
||||
GSNR (0.1nm, dB): 24.02
|
||||
GSNR (signal bw, dB): 19.94
|
||||
GSNR (signal bw, dB): 19.93
|
||||
OSNR ASE (0.1nm, dB): 26.55
|
||||
OSNR ASE (signal bw, dB): 22.47
|
||||
CD (ps/nm): 3340.00
|
||||
|
||||
@@ -32,7 +32,6 @@ Edfa east edfa in Lannion_CAS to Corlay
|
||||
Power Out (dBm): 19.82
|
||||
Delta_P (dB): 1.00
|
||||
target pch (dBm): 1.00
|
||||
effective pch (dBm): 1.00
|
||||
actual pch out (dBm): 1.01
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Lannion_CAS → Corlay)-F061
|
||||
@@ -77,7 +76,6 @@ Edfa west edfa in Lorient_KMA to Loudeac
|
||||
Power Out (dBm): 19.85
|
||||
Delta_P (dB): 1.00
|
||||
target pch (dBm): 1.00
|
||||
effective pch (dBm): 1.00
|
||||
actual pch out (dBm): 1.05
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm Lorient_KMA
|
||||
|
||||
@@ -32,7 +32,6 @@ Edfa east edfa in Lannion_CAS to Corlay
|
||||
Power Out (dBm): 18.79
|
||||
Delta_P (dB): 1.00
|
||||
target pch (dBm): 1.00
|
||||
effective pch (dBm): 1.00
|
||||
actual pch out (dBm): mode_1: 1.01, mode_2: 1.02
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Lannion_CAS → Corlay)-F061
|
||||
@@ -77,7 +76,6 @@ Edfa west edfa in Lorient_KMA to Loudeac
|
||||
Power Out (dBm): 18.84
|
||||
Delta_P (dB): 1.00
|
||||
target pch (dBm): 1.00
|
||||
effective pch (dBm): 1.00
|
||||
actual pch out (dBm): mode_1: 1.04, mode_2: 1.09
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm Lorient_KMA
|
||||
|
||||
@@ -36,7 +36,6 @@ Edfa Edfa1
|
||||
Power Out (dBm): 16.82
|
||||
Delta_P (dB): -2.00
|
||||
target pch (dBm): -2.00
|
||||
effective pch (dBm): -2.00
|
||||
actual pch out (dBm): -1.99
|
||||
output VOA (dB): 0.00
|
||||
Transceiver Site_B
|
||||
|
||||
@@ -38,7 +38,6 @@ Edfa Edfa1
|
||||
Power Out (dBm): 16.81
|
||||
Delta_P (dB): -2.00
|
||||
target pch (dBm): -2.00
|
||||
effective pch (dBm): -2.00
|
||||
actual pch out (dBm): -2.26
|
||||
output VOA (dB): 0.00
|
||||
Transceiver Site_B
|
||||
|
||||
@@ -31,7 +31,6 @@ Edfa booster A
|
||||
Power Out (dBm): 19.83
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.01
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span1
|
||||
@@ -54,7 +53,6 @@ Edfa Edfa1
|
||||
Power Out (dBm): 19.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.02
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span2
|
||||
@@ -77,7 +75,6 @@ Edfa Edfa2
|
||||
Power Out (dBm): 19.85
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.03
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span3
|
||||
@@ -100,7 +97,6 @@ Edfa Edfa3
|
||||
Power Out (dBm): 19.86
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.04
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span4
|
||||
@@ -123,7 +119,6 @@ Edfa Edfa4
|
||||
Power Out (dBm): 19.87
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.05
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span5
|
||||
@@ -146,7 +141,6 @@ Edfa Edfa5
|
||||
Power Out (dBm): 19.88
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.06
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm Site C
|
||||
@@ -164,7 +158,6 @@ Edfa booster C
|
||||
Power Out (dBm): 19.83
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.01
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span6
|
||||
@@ -187,7 +180,6 @@ Edfa Edfa6
|
||||
Power Out (dBm): 19.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.02
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span7
|
||||
@@ -210,7 +202,6 @@ Edfa Edfa7
|
||||
Power Out (dBm): 19.85
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.03
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span8
|
||||
@@ -233,7 +224,6 @@ Edfa Edfa8
|
||||
Power Out (dBm): 19.86
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.04
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span9
|
||||
@@ -256,7 +246,6 @@ Edfa Edfa9
|
||||
Power Out (dBm): 19.87
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.05
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span10
|
||||
@@ -279,7 +268,6 @@ Edfa Edfa10
|
||||
Power Out (dBm): 19.88
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.06
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm Site D
|
||||
@@ -297,7 +285,6 @@ Edfa booster D
|
||||
Power Out (dBm): 19.83
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.01
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span11
|
||||
@@ -320,7 +307,6 @@ Edfa Edfa11
|
||||
Power Out (dBm): 19.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.02
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span12
|
||||
@@ -343,7 +329,6 @@ Edfa Edfa12
|
||||
Power Out (dBm): 19.85
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.03
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm Site E
|
||||
@@ -361,7 +346,6 @@ Edfa booster E
|
||||
Power Out (dBm): 19.83
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.01
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span13
|
||||
@@ -384,7 +368,6 @@ Edfa Edfa13
|
||||
Power Out (dBm): 19.84
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.02
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span14
|
||||
@@ -407,7 +390,6 @@ Edfa Edfa14
|
||||
Power Out (dBm): 19.85
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.03
|
||||
output VOA (dB): 0.00
|
||||
Fiber Span15
|
||||
@@ -430,7 +412,6 @@ Edfa Edfa15
|
||||
Power Out (dBm): 19.86
|
||||
Delta_P (dB): 0.00
|
||||
target pch (dBm): 0.00
|
||||
effective pch (dBm): 0.00
|
||||
actual pch out (dBm): 0.04
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm Site B
|
||||
|
||||
@@ -31,7 +31,6 @@ Edfa east edfa in Lannion_CAS to Corlay
|
||||
Power Out (dBm): 21.01
|
||||
Delta_P (dB): -1.82
|
||||
target pch (dBm): 1.18
|
||||
effective pch (dBm): 1.18
|
||||
actual pch out (dBm): 1.18
|
||||
output VOA (dB): 0.00
|
||||
Fiber fiber (Lannion_CAS → Corlay)-F061
|
||||
@@ -76,7 +75,6 @@ Edfa west edfa in Lorient_KMA to Loudeac
|
||||
Power Out (dBm): 21.03
|
||||
Delta_P (dB): -1.82
|
||||
target pch (dBm): 1.18
|
||||
effective pch (dBm): 1.17
|
||||
actual pch out (dBm): 1.21
|
||||
output VOA (dB): 0.00
|
||||
Roadm roadm Lorient_KMA
|
||||
|
||||
@@ -88,6 +88,7 @@ def test_variable_gain_nf(gain, nf_expected, setup_edfa_variable_gain, si):
|
||||
si.nli /= db2lin(gain)
|
||||
si.ase /= db2lin(gain)
|
||||
edfa.operational.gain_target = gain
|
||||
edfa.effective_gain = gain
|
||||
si.pref = si.pref._replace(p_span0=0, p_spani=-gain)
|
||||
edfa.interpol_params(si)
|
||||
result = edfa.nf
|
||||
@@ -102,6 +103,7 @@ def test_fixed_gain_nf(gain, nf_expected, setup_edfa_fixed_gain, si):
|
||||
si.nli /= db2lin(gain)
|
||||
si.ase /= db2lin(gain)
|
||||
edfa.operational.gain_target = gain
|
||||
edfa.effective_gain = gain
|
||||
si.pref = si.pref._replace(p_span0=0, p_spani=-gain)
|
||||
edfa.interpol_params(si)
|
||||
assert pytest.approx(nf_expected, abs=0.01) == edfa.nf[0]
|
||||
@@ -126,6 +128,7 @@ def test_compare_nf_models(gain, setup_edfa_variable_gain, si):
|
||||
si.nli /= db2lin(gain)
|
||||
si.ase /= db2lin(gain)
|
||||
edfa.operational.gain_target = gain
|
||||
edfa.effective_gain = gain
|
||||
# edfa is variable gain type
|
||||
si.pref = si.pref._replace(p_span0=0, p_spani=-gain)
|
||||
edfa.interpol_params(si)
|
||||
@@ -212,7 +215,7 @@ def test_amp_behaviour(tilt_target, delta_p):
|
||||
"type_variety": "test",
|
||||
"operational": {
|
||||
"delta_p": delta_p,
|
||||
"gain_target": 20,
|
||||
"gain_target": 20 + delta_p if delta_p else 20,
|
||||
"tilt_target": tilt_target,
|
||||
"out_voa": 0
|
||||
}
|
||||
|
||||
@@ -303,11 +303,11 @@ def test_2low_input_power(target_out, delta_pdb_per_channel, correction):
|
||||
assert_allclose(watt2dbm(si.signal), target - correction, rtol=1e-5)
|
||||
|
||||
|
||||
def net_setup(equipment):
|
||||
def net_setup(equipment, deltap=0):
|
||||
"""common setup for tests: builds network, equipment and oms only once"""
|
||||
network = load_network(NETWORK_FILENAME, equipment)
|
||||
spectrum = equipment['SI']['default']
|
||||
p_db = spectrum.power_dbm
|
||||
p_db = spectrum.power_dbm + deltap
|
||||
p_total_db = p_db + lin2db(automatic_nch(spectrum.f_min, spectrum.f_max, spectrum.spacing))
|
||||
build_network(network, equipment, p_db, p_total_db)
|
||||
return network
|
||||
@@ -450,14 +450,14 @@ def ref_network():
|
||||
return network
|
||||
|
||||
|
||||
@pytest.mark.parametrize('deltap', [0, +1.2, -0.5])
|
||||
@pytest.mark.parametrize('deltap', [0, +1.18, -0.5])
|
||||
def test_target_psd_out_mwperghz_deltap(deltap):
|
||||
"""checks that if target_psd_out_mWperGHz is defined, delta_p of amps is correctly updated
|
||||
|
||||
Power over 1.2dBm saturate amp with this test: TODO add a test on this saturation
|
||||
Power over 1.18dBm saturate amp with this test: TODO add a test on this saturation
|
||||
"""
|
||||
equipment = load_equipment(EQPT_FILENAME)
|
||||
network = net_setup(equipment)
|
||||
network = net_setup(equipment, deltap)
|
||||
req = create_voyager_req(equipment, 'trx Brest_KLA', 'trx Vannes_KBE', False, ['trx Vannes_KBE'], ['STRICT'],
|
||||
'mode 1', 50e9, deltap)
|
||||
temp = [{
|
||||
|
||||
@@ -49,7 +49,7 @@ def test_span_loss(node, attenuation):
|
||||
network = load_network(NETWORK_FILENAME, equipment)
|
||||
for x in network.nodes():
|
||||
if x.uid == node:
|
||||
assert attenuation == span_loss(network, x)
|
||||
assert attenuation == span_loss(network, x, equipment)
|
||||
return
|
||||
assert not f'node "{node}" referenced from test but not found in the topology' # pragma: no cover
|
||||
|
||||
@@ -61,4 +61,4 @@ def test_span_loss_unconnected(node):
|
||||
network = load_network(NETWORK_FILENAME, equipment)
|
||||
x = next(x for x in network.nodes() if x.uid == node)
|
||||
with pytest.raises(NetworkTopologyError):
|
||||
span_loss(network, x)
|
||||
span_loss(network, x, equipment)
|
||||
|
||||
@@ -110,6 +110,7 @@ def test_auto_design_generation_fromjson(tmpdir, json_input, power_mode):
|
||||
p_db = equipment['SI']['default'].power_dbm
|
||||
p_total_db = p_db + lin2db(automatic_nch(equipment['SI']['default'].f_min,
|
||||
equipment['SI']['default'].f_max, equipment['SI']['default'].spacing))
|
||||
add_missing_elements_in_network(network, equipment)
|
||||
build_network(network, equipment, p_db, p_total_db)
|
||||
actual_json_output = tmpdir / json_input.with_name(json_input.stem + '_auto_design').with_suffix('.json').name
|
||||
save_network(network, actual_json_output)
|
||||
|
||||
@@ -28,7 +28,6 @@ def nch_and_spacing(request):
|
||||
def propagation(input_power, con_in, con_out, dest):
|
||||
equipment = load_equipment(eqpt_library_name)
|
||||
network = load_network(network_file_name, equipment)
|
||||
build_network(network, equipment, 0, 20)
|
||||
|
||||
# parametrize the network elements with the con losses and adapt gain
|
||||
# (assumes all spans are identical)
|
||||
@@ -40,6 +39,8 @@ def propagation(input_power, con_in, con_out, dest):
|
||||
if isinstance(e, Edfa):
|
||||
e.operational.gain_target = loss + con_in + con_out
|
||||
|
||||
build_network(network, equipment, 0, 20)
|
||||
|
||||
transceivers = {n.uid: n for n in network.nodes() if isinstance(n, Transceiver)}
|
||||
|
||||
p = input_power
|
||||
|
||||
@@ -13,12 +13,12 @@ checks that restrictions in roadms are correctly applied during autodesign
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
from numpy.testing import assert_allclose
|
||||
from numpy import ndarray
|
||||
from numpy import ndarray, mean
|
||||
from copy import deepcopy
|
||||
from gnpy.core.utils import lin2db, automatic_nch
|
||||
from gnpy.core.elements import Fused, Roadm, Edfa, Transceiver, EdfaOperational, EdfaParams, Fiber
|
||||
from gnpy.core.parameters import FiberParams, RoadmParams, FusedParams
|
||||
from gnpy.core.network import build_network
|
||||
from gnpy.core.network import build_network, design_network
|
||||
from gnpy.tools.json_io import network_from_json, load_equipment, load_json, Amp
|
||||
from gnpy.core.equipment import trx_mode_params
|
||||
from gnpy.topology.request import PathRequest, compute_constrained_path, ref_carrier, propagate
|
||||
@@ -455,9 +455,8 @@ def test_compare_design_propagation_settings(power_dbm, req_power, amp_with_delt
|
||||
p_total_db = p_db + lin2db(automatic_nch(eqpt['SI']['default'].f_min,
|
||||
eqpt['SI']['default'].f_max,
|
||||
eqpt['SI']['default'].spacing))
|
||||
build_network(network, eqpt, p_db, p_total_db)
|
||||
build_network(network, eqpt, p_db, p_total_db, verbose=False)
|
||||
# record network settings before propagating
|
||||
network_copy = deepcopy(network)
|
||||
# propagate on each oms
|
||||
req_list = create_per_oms_request(network, eqpt, req_power)
|
||||
paths = [compute_constrained_path(network, r) for r in req_list]
|
||||
@@ -468,10 +467,10 @@ def test_compare_design_propagation_settings(power_dbm, req_power, amp_with_delt
|
||||
for path, req in zip(paths, req_list):
|
||||
# check all elements except source and destination trx
|
||||
# in order to have clean initialization, use deecopy of paths
|
||||
design_network(req, network, eqpt, verbose=False)
|
||||
network_copy = deepcopy(network)
|
||||
pth = deepcopy(path)
|
||||
_ = propagate(pth, req, eqpt)
|
||||
previous_power = None
|
||||
previous_deltap = None
|
||||
for i, element in enumerate(pth[1:-1]):
|
||||
element_is_first_amp = False
|
||||
# index of previous element in path is i
|
||||
@@ -494,23 +493,26 @@ def test_compare_design_propagation_settings(power_dbm, req_power, amp_with_delt
|
||||
assert getattr(element, key) == getattr(element_copy, key)
|
||||
else:
|
||||
dp = element.out_voa if element.uid not in amp_with_deltap_one else element.out_voa + 1
|
||||
if element_is_first_amp:
|
||||
assert element.effective_gain - element_copy.effective_gain ==\
|
||||
pytest.approx(min(pch_max, req_power + max(element.delta_p, dp))
|
||||
- min(pch_max, power_dbm + dp), abs=1e-2)
|
||||
# if target power is above pch_max then gain should be saturated during propagation
|
||||
assert element.effective_pch_out_db ==\
|
||||
pytest.approx(min(pch_max, req_power + max(element.delta_p, dp)), abs=1e-2)
|
||||
# check that target power is correctly set
|
||||
assert element.target_pch_out_db == req_power + dp
|
||||
# check that designed gain is exactly applied except if target power exceeds max power, then
|
||||
# gain is slightly less than the one computed during design for the noiseless reference,
|
||||
# because during propagation, noise has accumulated, additing to signal.
|
||||
# check that delta_p is unchanged unless for saturation
|
||||
if element.target_pch_out_db > pch_max:
|
||||
assert element.effective_gain == pytest.approx(element_copy.effective_gain, abs=2e-2)
|
||||
else:
|
||||
assert element.effective_gain - element_copy.effective_gain ==\
|
||||
pytest.approx(min(pch_max, req_power + max(element.delta_p, dp))
|
||||
- min(pch_max, previous_power)
|
||||
- min(pch_max, power_dbm + element.delta_p)
|
||||
+ min(pch_max, power_dbm + previous_deltap), abs=2e-2)
|
||||
assert element.delta_p == pytest.approx(min(power_dbm + dp, pch_max) - power_dbm, abs=1e-2)
|
||||
|
||||
previous_deltap = element.delta_p
|
||||
previous_power = min(pch_max, req_power + max(element.delta_p, dp))
|
||||
assert element.effective_gain == element_copy.effective_gain
|
||||
# check that delta_p is unchanged unless for saturation
|
||||
assert element.delta_p == element_copy.delta_p
|
||||
if element_is_first_amp:
|
||||
# if element is first amp on path, then it is the one that will saturate if req_power is
|
||||
# too high
|
||||
assert mean(element.pch_out_dbm) ==\
|
||||
pytest.approx(min(pch_max, req_power + element.delta_p - element.out_voa), abs=2e-2)
|
||||
# check that delta_p is unchanged unless due to saturation
|
||||
assert element.delta_p == pytest.approx(min(req_power + dp, pch_max) - req_power, abs=1e-2)
|
||||
# check that delta_p is unchanged unless for saturation
|
||||
else:
|
||||
# for all subkeys, before and after design should be the same
|
||||
for subkey in list_element_attr(getattr(element, key)):
|
||||
|
||||
Reference in New Issue
Block a user