From 00e7f4ed615ea9258a277664cc5067e0e010e737 Mon Sep 17 00:00:00 2001 From: EstherLerouzic Date: Fri, 28 Apr 2023 16:04:30 +0200 Subject: [PATCH] feat: separate span power from tx power gnpy currently uses the same parameter for tx output power and span input power: this prevents from modelling low tx power effect. This patch introduces a new tx-cannel-power and uses it to propagate in ROADM. Signed-off-by: EstherLerouzic Change-Id: Id3ac75e2cb617b513bdb38b51a52e05d15af46f5 --- gnpy/core/elements.py | 59 ++++++--- gnpy/core/info.py | 33 +++-- gnpy/core/network.py | 12 +- gnpy/core/utils.py | 19 ++- gnpy/example-data/eqpt_config.json | 1 + gnpy/tools/cli_examples.py | 5 +- gnpy/tools/json_io.py | 66 +++++---- gnpy/topology/request.py | 14 +- tests/data/eqpt_config.json | 6 +- tests/invocation/logs_path_request | 10 +- .../logs_path_requests_run_CD_PMD_PDL_missing | 10 +- tests/invocation/logs_power_sweep_example | 10 +- tests/invocation/logs_transmission_saturated | 10 +- .../openroadm-v4-Stockholm-Gothenburg | 56 ++++---- .../openroadm-v5-Stockholm-Gothenburg | 56 ++++---- tests/invocation/path_requests_run | 7 + .../path_requests_run_CD_PMD_PDL_missing | 1 + tests/invocation/power_sweep_example | 13 ++ .../spectrum1_transmission_main_example | 20 +-- .../spectrum2_transmission_main_example | 20 +-- tests/invocation/transmission_long_pow | 47 ++++--- tests/invocation/transmission_long_psd | 47 ++++--- tests/invocation/transmission_long_psw | 47 ++++--- tests/invocation/transmission_main_example | 2 + .../transmission_main_example__raman | 2 + .../invocation/transmission_main_example_long | 47 ++++--- tests/invocation/transmission_saturated | 20 +-- tests/test_amplifier.py | 10 +- tests/test_disjunction.py | 8 +- tests/test_equalization.py | 125 ++++++++++++++++-- tests/test_gain_mode.py | 3 +- tests/test_info.py | 12 +- tests/test_logger.py | 2 +- tests/test_network_functions.py | 1 + tests/test_parser.py | 1 + tests/test_propagation.py | 5 +- tests/test_roadm_restrictions.py | 10 +- tests/test_science_utils.py | 11 +- tests/test_spectrum_assignment.py | 1 + tests/test_trx_mode_params.py | 2 +- 40 files changed, 559 insertions(+), 272 deletions(-) diff --git a/gnpy/core/elements.py b/gnpy/core/elements.py index af3bc295c..d5383f965 100644 --- a/gnpy/core/elements.py +++ b/gnpy/core/elements.py @@ -29,7 +29,7 @@ from logging import getLogger from gnpy.core.utils import lin2db, db2lin, arrange_frequencies, snr_sum, per_label_average, pretty_summary_print, \ - watt2dbm, psd2powerdbm + watt2dbm, psd2powerdbm, calculate_absolute_min_or_zero from gnpy.core.parameters import RoadmParams, FusedParams, FiberParams, PumpParams, EdfaParams, EdfaOperational, \ RoadmPath, RoadmImpairment from gnpy.core.science_utils import NliSolver, RamanSolver @@ -95,6 +95,7 @@ def __init__(self, *args, **kwargs): self.penalties = {} self.total_penalty = 0 self.propagated_labels = [""] + self.tx_power = None def _calc_cd(self, spectral_info): """Updates the Transceiver property with the CD of the received channels. CD in ps/nm. @@ -194,6 +195,7 @@ def __str__(self): osnr_ase = per_label_average(self.osnr_ase, self.propagated_labels) osnr_ase_01nm = per_label_average(self.osnr_ase_01nm, self.propagated_labels) snr_01nm = per_label_average(self.snr_01nm, self.propagated_labels) + tx_power_dbm = per_label_average(watt2dbm(self.tx_power), self.propagated_labels) cd = mean(self.chromatic_dispersion) pmd = mean(self.pmd) pdl = mean(self.pdl) @@ -207,7 +209,8 @@ def __str__(self): f' CD (ps/nm): {cd:.2f}', f' PMD (ps): {pmd:.2f}', f' PDL (dB): {pdl:.2f}', - f' Latency (ms): {latency:.2f}']) + f' Latency (ms): {latency:.2f}', + f' Actual pch out (dBm): {pretty_summary_print(tx_power_dbm)}']) cd_penalty = self.penalties.get('chromatic_dispersion') if cd_penalty is not None: @@ -222,6 +225,7 @@ def __str__(self): return result def __call__(self, spectral_info): + self.tx_power = spectral_info.tx_power self._calc_snr(spectral_info) self._calc_cd(spectral_info) self._calc_pmd(spectral_info) @@ -244,6 +248,7 @@ def __init__(self, *args, params=None, **kwargs): # on the path, since it depends on the equalization definition on the degree. self.ref_pch_out_dbm = None self.loss = 0 # auto-design interest + self.loss_pch_db = None # Optical power of carriers are equalized by the ROADM, so that the experienced loss is not the same for # different carriers. The ref_effective_loss records the loss for a reference carrier. @@ -316,11 +321,13 @@ def __str__(self): return f'{type(self).__name__} {self.uid}' total_pch = pretty_summary_print(per_label_average(self.pch_out_dbm, self.propagated_labels)) + total_loss = pretty_summary_print(per_label_average(self.loss_pch_db, self.propagated_labels)) return '\n'.join([f'{type(self).__name__} {self.uid}', - f' type_variety: {self.type_variety}', - f' effective loss (dB): {self.ref_effective_loss:.2f}', - f' reference pch out (dBm): {self.ref_pch_out_dbm:.2f}', - f' actual pch out (dBm): {total_pch}']) + f' Type_variety: {self.type_variety}', + f' Reference loss (dB): {self.ref_effective_loss:.2f}', + f' Actual loss (dB): {total_loss}', + f' Reference pch out (dBm): {self.ref_pch_out_dbm:.2f}', + f' Actual pch out (dBm): {total_pch}']) def get_roadm_target_power(self, spectral_info: SpectralInformation = None) -> Union[float, ndarray]: """Computes the power in dBm for a reference carrier or for a spectral information. @@ -381,9 +388,13 @@ def propagate(self, spectral_info, degree, from_degree): There is no difference for add or express : the same target is applied. For the moment propagate operates with spectral info carriers all having the same source or destination. """ + # record input powers to compute the actual loss at the end of the process + input_power_dbm = watt2dbm(spectral_info.signal + spectral_info.nli + spectral_info.ase) # apply min ROADM loss if it exists roadm_maxloss_db = self.get_roadm_path(from_degree, degree).impairment.maxloss spectral_info.apply_attenuation_db(roadm_maxloss_db) + # records the total power after applying minimum loss + net_input_power_dbm = watt2dbm(spectral_info.signal + spectral_info.nli + spectral_info.ase) # find the target power for the reference carrier ref_per_degree_pch = self.get_per_degree_ref_power(degree) # find the target powers for each signal carrier @@ -393,15 +404,19 @@ def propagate(self, spectral_info, degree, from_degree): # Depending on propagation upstream from this ROADM, the input power might be smaller than # the target power out configured for this ROADM degree's egress. Since ROADM does not amplify, # the power out of the ROADM for the ref channel is the min value between target power and input power. - # (TODO add a minimum loss for the ROADM crossing) - self.ref_pch_out_dbm = min(self.ref_pch_in_dbm[from_degree] - roadm_maxloss_db, ref_per_degree_pch) + ref_pch_in_dbm = self.ref_pch_in_dbm[from_degree] + # Calculate the output power for the reference channel (only for visualization) + self.ref_pch_out_dbm = min(ref_pch_in_dbm - roadm_maxloss_db, ref_per_degree_pch) + # Definition of effective_loss: # Optical power of carriers are equalized by the ROADM, so that the experienced loss is not the same for # different carriers. effective_loss records the loss for the reference carrier. - self.ref_effective_loss = self.ref_pch_in_dbm[from_degree] - self.ref_pch_out_dbm - input_power = spectral_info.signal + spectral_info.nli + spectral_info.ase + # Calculate the effective loss for the reference channel + self.ref_effective_loss = ref_pch_in_dbm - self.ref_pch_out_dbm + + # Calculate the target power per channel according to the equalization policy target_power_per_channel = per_degree_pch + spectral_info.delta_pdb_per_channel - # Computation of the per channel target power according to equalization policy + # Computation of the correction according to equalization policy # If target_power_per_channel has some channels power above input power, then the whole target is reduced. # For example, if user specifies delta_pdb_per_channel: # freq1: 1dB, freq2: 3dB, freq3: -3dB, and target is -20dBm out of the ROADM, @@ -416,17 +431,25 @@ def propagate(self, spectral_info, degree, from_degree): # that had the min power. # This change corresponds to a discussion held during coders call. Please look at this document for # a reference: https://telecominfraproject.atlassian.net/wiki/spaces/OOPT/pages/669679645/PSE+Meeting+Minutes - correction = (abs(watt2dbm(input_power) - target_power_per_channel) - - (watt2dbm(input_power) - target_power_per_channel)) / 2 + correction = calculate_absolute_min_or_zero(net_input_power_dbm - target_power_per_channel) new_target = target_power_per_channel - correction - delta_power = watt2dbm(input_power) - new_target + delta_power = net_input_power_dbm - new_target spectral_info.apply_attenuation_db(delta_power) - spectral_info.pmd = sqrt(spectral_info.pmd ** 2 - + self.get_roadm_path(from_degree=from_degree, to_degree=degree).impairment.pmd ** 2) - spectral_info.pdl = sqrt(spectral_info.pdl ** 2 - + self.get_roadm_path(from_degree=from_degree, to_degree=degree).impairment.pdl ** 2) + + # Update the PMD information + pmd_impairment = self.get_roadm_path(from_degree=from_degree, to_degree=degree).impairment.pmd + spectral_info.pmd = sqrt(spectral_info.pmd ** 2 + pmd_impairment ** 2) + + # Update the PMD information + pdl_impairment = self.get_roadm_path(from_degree=from_degree, to_degree=degree).impairment.pdl + spectral_info.pdl = sqrt(spectral_info.pdl ** 2 + pdl_impairment ** 2) + + # Update the per channel power with the result of propagation self.pch_out_dbm = watt2dbm(spectral_info.signal + spectral_info.nli + spectral_info.ase) + + # Update the loss per channel and the labels + self.loss_pch_db = input_power_dbm - self.pch_out_dbm self.propagated_labels = spectral_info.label def set_roadm_paths(self, from_degree, to_degree, path_type, impairment_id=None): diff --git a/gnpy/core/info.py b/gnpy/core/info.py index 711c7c137..08e970423 100644 --- a/gnpy/core/info.py +++ b/gnpy/core/info.py @@ -52,7 +52,7 @@ class SpectralInformation(object): def __init__(self, frequency: array, baud_rate: array, slot_width: array, signal: array, nli: array, ase: array, roll_off: array, chromatic_dispersion: array, pmd: array, pdl: array, latency: array, - delta_pdb_per_channel: array, tx_osnr: array, label: array): + delta_pdb_per_channel: array, tx_osnr: array, tx_power: array, label: array): indices = argsort(frequency) self._frequency = frequency[indices] self._df = outer(ones(frequency.shape), frequency) - outer(frequency, ones(frequency.shape)) @@ -80,6 +80,7 @@ def __init__(self, frequency: array, baud_rate: array, slot_width: array, signal self._latency = latency[indices] self._delta_pdb_per_channel = delta_pdb_per_channel[indices] self._tx_osnr = tx_osnr[indices] + self._tx_power = tx_power[indices] self._label = label[indices] @property @@ -188,6 +189,14 @@ def tx_osnr(self): def tx_osnr(self, tx_osnr): self._tx_osnr = tx_osnr + @property + def tx_power(self): + return self._tx_power + + @tx_power.setter + def tx_power(self, tx_power): + self._tx_power = tx_power + @property def channel_number(self): return self._channel_number @@ -232,6 +241,7 @@ def __add__(self, other: SpectralInformation): delta_pdb_per_channel=append(self.delta_pdb_per_channel, other.delta_pdb_per_channel), tx_osnr=append(self.tx_osnr, other.tx_osnr), + tx_power=append(self.tx_power, other.tx_power), label=append(self.label, other.label)) except SpectrumError: raise SpectrumError('Spectra cannot be summed: channels overlapping.') @@ -251,6 +261,7 @@ def create_arbitrary_spectral_information(frequency: Union[ndarray, Iterable, fl signal: Union[float, ndarray, Iterable], baud_rate: Union[float, ndarray, Iterable], tx_osnr: Union[float, ndarray, Iterable], + tx_power: Union[float, ndarray, Iterable] = None, delta_pdb_per_channel: Union[float, ndarray, Iterable] = 0., slot_width: Union[float, ndarray, Iterable] = None, roll_off: Union[float, ndarray, Iterable] = 0., @@ -277,6 +288,7 @@ def create_arbitrary_spectral_information(frequency: Union[ndarray, Iterable, fl ase = zeros(number_of_channels) delta_pdb_per_channel = full(number_of_channels, delta_pdb_per_channel) tx_osnr = full(number_of_channels, tx_osnr) + tx_power = full(number_of_channels, tx_power) label = full(number_of_channels, label) return SpectralInformation(frequency=frequency, slot_width=slot_width, signal=signal, nli=nli, ase=ase, @@ -284,7 +296,7 @@ def create_arbitrary_spectral_information(frequency: Union[ndarray, Iterable, fl chromatic_dispersion=chromatic_dispersion, pmd=pmd, pdl=pdl, latency=latency, delta_pdb_per_channel=delta_pdb_per_channel, - tx_osnr=tx_osnr, label=label) + tx_osnr=tx_osnr, tx_power=tx_power, label=label) except ValueError as e: if 'could not broadcast' in str(e): raise SpectrumError('Dimension mismatch in input fields.') @@ -292,45 +304,47 @@ def create_arbitrary_spectral_information(frequency: Union[ndarray, Iterable, fl raise -def create_input_spectral_information(f_min, f_max, roll_off, baud_rate, power, spacing, tx_osnr, delta_pdb=0): +def create_input_spectral_information(f_min, f_max, roll_off, baud_rate, spacing, tx_osnr, tx_power, + delta_pdb=0): """Creates a fixed slot width spectral information with flat power. all arguments are scalar values""" number_of_channels = automatic_nch(f_min, f_max, spacing) frequency = [(f_min + spacing * i) for i in range(1, number_of_channels + 1)] delta_pdb_per_channel = delta_pdb * ones(number_of_channels) label = [f'{baud_rate * 1e-9 :.2f}G' for i in range(number_of_channels)] - return create_arbitrary_spectral_information(frequency, slot_width=spacing, signal=power, baud_rate=baud_rate, + return create_arbitrary_spectral_information(frequency, slot_width=spacing, signal=tx_power, baud_rate=baud_rate, roll_off=roll_off, delta_pdb_per_channel=delta_pdb_per_channel, - tx_osnr=tx_osnr, label=label) + tx_osnr=tx_osnr, tx_power=tx_power, label=label) def carriers_to_spectral_information(initial_spectrum: dict[float, Carrier], power: float) -> SpectralInformation: """Initial spectrum is a dict with key = carrier frequency, and value a Carrier object. :param initial_spectrum: indexed by frequency in Hz, with power offset (delta_pdb), baudrate, slot width, - tx_osnr and roll off. + tx_osnr, tx_power and roll off. :param power: power of the request """ frequency = list(initial_spectrum.keys()) - signal = [power * db2lin(c.delta_pdb) for c in initial_spectrum.values()] + signal = [c.tx_power for c in initial_spectrum.values()] roll_off = [c.roll_off for c in initial_spectrum.values()] baud_rate = [c.baud_rate for c in initial_spectrum.values()] delta_pdb_per_channel = [c.delta_pdb for c in initial_spectrum.values()] slot_width = [c.slot_width for c in initial_spectrum.values()] tx_osnr = [c.tx_osnr for c in initial_spectrum.values()] + tx_power = [c.tx_power for c in initial_spectrum.values()] label = [c.label for c in initial_spectrum.values()] p_span0 = watt2dbm(power) return create_arbitrary_spectral_information(frequency=frequency, signal=signal, baud_rate=baud_rate, slot_width=slot_width, roll_off=roll_off, delta_pdb_per_channel=delta_pdb_per_channel, tx_osnr=tx_osnr, - label=label) + tx_power=tx_power, label=label) @dataclass class Carrier: """One channel in the initial mixed-type spectrum definition, each type being defined by its delta_pdb (power offset with respect to reference power), baud rate, slot_width, roll_off - and tx_osnr. delta_pdb offset is applied to target power out of Roadm. + tx_power, and tx_osnr. delta_pdb offset is applied to target power out of Roadm. Label is used to group carriers which belong to the same partition when printing results. """ delta_pdb: float @@ -338,6 +352,7 @@ class Carrier: slot_width: float roll_off: float tx_osnr: float + tx_power: float label: str diff --git a/gnpy/core/network.py b/gnpy/core/network.py index fd4abe925..b5dfc0e85 100644 --- a/gnpy/core/network.py +++ b/gnpy/core/network.py @@ -217,8 +217,8 @@ def estimate_raman_gain(node, equipment): # 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) + baud_rate=baud_rate, spacing=spacing, + tx_osnr=tx_osnr, tx_power=power) 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 @@ -294,9 +294,11 @@ def set_egress_amplifier(network, this_node, equipment, pref_ch_db, pref_total_d prev_node = this_node node = oms if isinstance(this_node, elements.Transceiver): - # for the time being use the same power for the target of roadms and for transceivers - # TODO: This should be changed when introducing a power parameter dedicated to transceivers - this_node_out_power = pref_ch_db + # todo change pref to a ref channel + if equipment['SI']['default'].tx_power_dbm is not None: + this_node_out_power = equipment['SI']['default'].tx_power_dbm + else: + this_node_out_power = pref_ch_db if isinstance(this_node, elements.Roadm): # get target power out from ROADM for the reference carrier based on equalization settings this_node_out_power = this_node.get_per_degree_ref_power(degree=node.uid) diff --git a/gnpy/core/utils.py b/gnpy/core/utils.py index bb9fe8d8d..5fc7b9d15 100644 --- a/gnpy/core/utils.py +++ b/gnpy/core/utils.py @@ -9,7 +9,7 @@ """ from csv import writer -from numpy import pi, cos, sqrt, log10, linspace, zeros, shape, where, logical_and, mean +from numpy import pi, cos, sqrt, log10, linspace, zeros, shape, where, logical_and, mean, array from scipy import constants from copy import deepcopy @@ -452,3 +452,20 @@ def restore_order(elements, order): [3, 2, 7] """ return [elements[i[0]] for i in sorted(enumerate(order), key=lambda x:x[1]) if elements[i[0]] is not None] + + +def calculate_absolute_min_or_zero(x: array) -> array: + """Calculates the element-wise absolute minimum between the x and zero. + + Parameters: + x (array): The first input array. + + Returns: + array: The element-wise absolute minimum between x and zero. + + Example: + >>> x = array([-1, 2, -3]) + >>> calculate_absolute_min_or_zero(x) + array([1., 0., 3.]) + """ + return (abs(x) - x) / 2 diff --git a/gnpy/example-data/eqpt_config.json b/gnpy/example-data/eqpt_config.json index bfc3ddf27..d612764b1 100644 --- a/gnpy/example-data/eqpt_config.json +++ b/gnpy/example-data/eqpt_config.json @@ -290,6 +290,7 @@ "spacing": 50e9, "power_dbm": 0, "power_range_db": [0, 0, 1], + "tx_power_dbm": 0, "roll_off": 0.15, "tx_osnr": 40, "sys_margins": 2 diff --git a/gnpy/tools/cli_examples.py b/gnpy/tools/cli_examples.py index b0d632565..e87f2ac6e 100644 --- a/gnpy/tools/cli_examples.py +++ b/gnpy/tools/cli_examples.py @@ -194,8 +194,10 @@ def transmission_main_example(args=None): params['effective_freq_slot'] = None trx_params = trx_mode_params(equipment) trx_params['power'] = dbm2watt(equipment['SI']['default'].power_dbm) + trx_params['tx_power'] = dbm2watt(equipment['SI']['default'].power_dbm) if args.power: trx_params['power'] = dbm2watt(float(args.power)) + trx_params['tx_power'] = dbm2watt(float(args.power)) params.update(trx_params) initial_spectrum = None params['nb_channel'] = automatic_nch(trx_params['f_min'], trx_params['f_max'], trx_params['spacing']) @@ -372,7 +374,8 @@ def path_requests_run(args=None): 'effective_freq_slot': None, 'nb_channel': automatic_nch(equipment['SI']['default'].f_min, equipment['SI']['default'].f_max, equipment['SI']['default'].spacing), - 'power': dbm2watt(equipment['SI']['default'].power_dbm) + 'power': dbm2watt(equipment['SI']['default'].power_dbm), + 'tx_power': dbm2watt(equipment['SI']['default'].power_dbm) } trx_params = trx_mode_params(equipment) params.update(trx_params) diff --git a/gnpy/tools/json_io.py b/gnpy/tools/json_io.py index 8854ae692..757887694 100644 --- a/gnpy/tools/json_io.py +++ b/gnpy/tools/json_io.py @@ -51,9 +51,10 @@ def update_attr(self, default_values, kwargs, name): clean_kwargs = {k: v for k, v in kwargs.items() if v != ''} for k, v in default_values.items(): setattr(self, k, clean_kwargs.get(k, v)) - if k not in clean_kwargs and name != 'Amp': - msg = f'\n WARNING missing {k} attribute in eqpt_config.json[{name}]' \ - + f'\n default value is {k} = {v}' + if k not in clean_kwargs and name != 'Amp' and v is not None: + # do not show this warning if the default value is None + msg = f'\n\tWARNING missing {k} attribute in eqpt_config.json[{name}]' \ + + f'\n\tdefault value is {k} = {v}\n' _logger.warning(msg) @@ -67,7 +68,8 @@ class SI(_JsonThing): "power_range_db": [0, 0, 0.5], "roll_off": 0.15, "tx_osnr": 45, - "sys_margins": 0 + "sys_margins": 0, + "tx_power_dbm": None # optional value in SI } def __init__(self, **kwargs): @@ -268,7 +270,7 @@ def _spectrum_from_json(json_data): label should be different for each partition >>> json_data = {'spectrum': \ [{'f_min': 193.2e12, 'f_max': 193.4e12, 'slot_width': 50e9, 'baud_rate': 32e9, 'roll_off': 0.15, \ - 'delta_pdb': 1, 'tx_osnr': 45},\ + 'delta_pdb': 1, 'tx_osnr': 45, 'tx_power_dbm': -7},\ {'f_min': 193.4625e12, 'f_max': 193.9875e12, 'slot_width': 75e9, 'baud_rate': 64e9, 'roll_off': 0.15},\ {'f_min': 194.075e12, 'f_max': 194.075e12, 'slot_width': 100e9, 'baud_rate': 90e9, 'roll_off': 0.15},\ {'f_min': 194.2e12, 'f_max': 194.35e12, 'slot_width': 50e9, 'baud_rate': 32e9, 'roll_off': 0.15}]} @@ -276,24 +278,24 @@ def _spectrum_from_json(json_data): >>> for k, v in spectrum.items(): ... print(f'{k}: {v}') ... - 193200000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, label='0-32.00G') - 193250000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, label='0-32.00G') - 193300000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, label='0-32.00G') - 193350000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, label='0-32.00G') - 193400000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, label='0-32.00G') - 193462500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, label='1-64.00G') - 193537500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, label='1-64.00G') - 193612500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, label='1-64.00G') - 193687500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, label='1-64.00G') - 193762500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, label='1-64.00G') - 193837500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, label='1-64.00G') - 193912500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, label='1-64.00G') - 193987500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, label='1-64.00G') - 194075000000000.0: Carrier(delta_pdb=0, baud_rate=90000000000.0, slot_width=100000000000.0, roll_off=0.15, tx_osnr=40, label='2-90.00G') - 194200000000000.0: Carrier(delta_pdb=0, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=40, label='3-32.00G') - 194250000000000.0: Carrier(delta_pdb=0, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=40, label='3-32.00G') - 194300000000000.0: Carrier(delta_pdb=0, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=40, label='3-32.00G') - 194350000000000.0: Carrier(delta_pdb=0, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=40, label='3-32.00G') + 193200000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, tx_power=0.00019952623149688798, label='0-32.00G') + 193250000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, tx_power=0.00019952623149688798, label='0-32.00G') + 193300000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, tx_power=0.00019952623149688798, label='0-32.00G') + 193350000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, tx_power=0.00019952623149688798, label='0-32.00G') + 193400000000000.0: Carrier(delta_pdb=1, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=45, tx_power=0.00019952623149688798, label='0-32.00G') + 193462500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='1-64.00G') + 193537500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='1-64.00G') + 193612500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='1-64.00G') + 193687500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='1-64.00G') + 193762500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='1-64.00G') + 193837500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='1-64.00G') + 193912500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='1-64.00G') + 193987500000000.0: Carrier(delta_pdb=0, baud_rate=64000000000.0, slot_width=75000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='1-64.00G') + 194075000000000.0: Carrier(delta_pdb=0, baud_rate=90000000000.0, slot_width=100000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='2-90.00G') + 194200000000000.0: Carrier(delta_pdb=0, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='3-32.00G') + 194250000000000.0: Carrier(delta_pdb=0, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='3-32.00G') + 194300000000000.0: Carrier(delta_pdb=0, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='3-32.00G') + 194350000000000.0: Carrier(delta_pdb=0, baud_rate=32000000000.0, slot_width=50000000000.0, roll_off=0.15, tx_osnr=40, tx_power=0.001, label='3-32.00G') """ spectrum = {} json_data = sorted(json_data, key=lambda x: x['f_min']) @@ -309,6 +311,9 @@ def _spectrum_from_json(json_data): # default tx_osnr is set to 40 dB if 'tx_osnr' not in part: part['tx_osnr'] = 40 + # default tx_power_dbm is set to 0 dBn + if 'tx_power_dbm' not in part: + part['tx_power_dbm'] = 0 # starting freq is exactly f_min to be consistent with utils.automatic_nch # first partition min occupation is f_min - slot_width / 2 (central_frequency is f_min) # supposes that carriers are centered on frequency @@ -327,7 +332,8 @@ def _spectrum_from_json(json_data): part['slot_width']): spectrum[current_freq] = Carrier(delta_pdb=part['delta_pdb'], baud_rate=part['baud_rate'], slot_width=part['slot_width'], roll_off=part['roll_off'], - tx_osnr=part['tx_osnr'], label=part['label']) + tx_osnr=part['tx_osnr'], tx_power=dbm2watt(part['tx_power_dbm']), + label=part['label']) previous_part_max_freq = current_freq + part['slot_width'] / 2 return spectrum @@ -410,6 +416,9 @@ def _equipment_from_json(json_data, filename): elif key == 'Roadm': equipment[key][subkey] = Roadm(**entry) elif key == 'SI': + # use power_dbm value for tx_power_dbm if the key is not in 'SI' + # if 'tx_power_dbm' not in entry.keys(): + # entry['tx_power_dbm'] = entry['power_dbm'] equipment[key][subkey] = SI(**entry) elif key == 'Transceiver': equipment[key][subkey] = Transceiver(**entry) @@ -576,7 +585,6 @@ def requests_from_json(json_data, equipment): params['nodes_list'] = [n['num-unnum-hop']['node-id'] for n in nd_list] params['loose_list'] = [n['num-unnum-hop']['hop-type'] for n in nd_list] # recover trx physical param (baudrate, ...) from type and mode - # in trx_mode_params optical power is read from equipment['SI']['default'] and # nb_channel is computed based on min max frequency and spacing try: trx_params = trx_mode_params(equipment, params['trx_type'], params['trx_mode'], True) @@ -608,6 +616,14 @@ def requests_from_json(json_data, equipment): params['path_bandwidth'] = req['path-constraints']['te-bandwidth']['path_bandwidth'] except KeyError: pass + params['tx_power'] = req['path-constraints']['te-bandwidth'].get('tx_power') + default_tx_power_dbm = equipment['SI']['default'].tx_power_dbm + if params['tx_power'] is None: + # use request's input power in span instead + params['tx_power'] = params['power'] + if default_tx_power_dbm is not None: + # use default tx power + params['tx_power'] = dbm2watt(default_tx_power_dbm) _check_one_request(params, f_max_from_si) requests_list.append(PathRequest(**params)) return requests_list diff --git a/gnpy/topology/request.py b/gnpy/topology/request.py index c69170668..da00c99d1 100644 --- a/gnpy/topology/request.py +++ b/gnpy/topology/request.py @@ -36,7 +36,7 @@ ' trx_mode nodes_list loose_list spacing power nb_channel f_min' ' f_max format baud_rate OSNR penalties bit_rate' ' roll_off tx_osnr min_spacing cost path_bandwidth effective_freq_slot' - ' equalization_offset_db') + ' equalization_offset_db, tx_power') DisjunctionParams = namedtuple('DisjunctionParams', 'disjunction_id relaxable link_diverse' ' node_diverse disjunctions_req') @@ -65,6 +65,7 @@ def __init__(self, *args, **params): self.bit_rate = params.bit_rate self.roll_off = params.roll_off self.tx_osnr = params.tx_osnr + self.tx_power = params.tx_power self.min_spacing = params.min_spacing self.cost = params.cost self.path_bandwidth = params.path_bandwidth @@ -95,7 +96,8 @@ def __repr__(self): f'baud_rate:\t{temp} Gbaud', f'bit_rate:\t{temp2} Gb/s', f'spacing:\t{self.spacing * 1e-9} GHz', - f'power: \t{round(lin2db(self.power)+30, 2)} dBm', + f'power: \t{round(lin2db(self.power) + 30, 2)} dBm', + f'tx_power_dbm: \t{round(lin2db(self.tx_power) + 30, 2)} dBm', f'nb channels: \t{self.nb_channel}', f'path_bandwidth: \t{round(self.path_bandwidth * 1e-9, 2)} Gbit/s', f'nodes-list:\t{self.nodes_list}', @@ -337,7 +339,7 @@ def propagate(path, req, equipment): else: si = create_input_spectral_information( f_min=req.f_min, f_max=req.f_max, roll_off=req.roll_off, baud_rate=req.baud_rate, - power=req.power, spacing=req.spacing, tx_osnr=req.tx_osnr, delta_pdb=req.offset_db) + spacing=req.spacing, tx_osnr=req.tx_osnr, tx_power=req.tx_power, delta_pdb=req.offset_db) roadm_osnr = [] for i, el in enumerate(path): if isinstance(el, Roadm): @@ -380,8 +382,9 @@ def propagate_and_optimize_mode(path, req, equipment): raise ServiceError(msg) spc_info = create_input_spectral_information(f_min=req.f_min, f_max=req.f_max, roll_off=equipment['SI']['default'].roll_off, - baud_rate=this_br, power=req.power, spacing=req.spacing, - delta_pdb=this_offset, tx_osnr=req.tx_osnr) + baud_rate=this_br, spacing=req.spacing, + delta_pdb=this_offset, tx_osnr=req.tx_osnr, + tx_power=req.tx_power) roadm_osnr = [] for i, el in enumerate(path): if isinstance(el, Roadm): @@ -968,6 +971,7 @@ def compare_reqs(req1, req2, disjlist): req1.format == req2.format and \ req1.OSNR == req2.OSNR and \ req1.roll_off == req2.roll_off and \ + req1.tx_power == req2.tx_power and \ same_disj: return True else: diff --git a/tests/data/eqpt_config.json b/tests/data/eqpt_config.json index aaff78ac7..abe9b4189 100644 --- a/tests/data/eqpt_config.json +++ b/tests/data/eqpt_config.json @@ -170,9 +170,9 @@ "roll_off": 0.15, "tx_osnr": 100, "sys_margins": 0 - } - ], - "Transceiver": [{ + }], + "Transceiver":[ + { "type_variety": "vendorA_trx-type1", "frequency": { "min": 191.35e12, diff --git a/tests/invocation/logs_path_request b/tests/invocation/logs_path_request index 91a218199..a97202482 100644 --- a/tests/invocation/logs_path_request +++ b/tests/invocation/logs_path_request @@ -1,10 +1,12 @@ INFO gnpy.tools.cli_examples:cli_examples.py Computing path requests meshTopologyExampleV2.xls into JSON format WARNING gnpy.tools.json_io:json_io.py - WARNING missing type_variety attribute in eqpt_config.json[Roadm] - default value is type_variety = default + WARNING missing type_variety attribute in eqpt_config.json[Roadm] + default value is type_variety = default + WARNING gnpy.tools.json_io:json_io.py - WARNING missing roadm-path-impairments attribute in eqpt_config.json[Roadm] - default value is roadm-path-impairments = [] + WARNING missing roadm-path-impairments attribute in eqpt_config.json[Roadm] + default value is roadm-path-impairments = [] + INFO gnpy.tools.json_io:json_io.py Automatically converting requests from XLS to JSON INFO gnpy.topology.request:request.py request 0 diff --git a/tests/invocation/logs_path_requests_run_CD_PMD_PDL_missing b/tests/invocation/logs_path_requests_run_CD_PMD_PDL_missing index d74d34b92..ec43f23a8 100644 --- a/tests/invocation/logs_path_requests_run_CD_PMD_PDL_missing +++ b/tests/invocation/logs_path_requests_run_CD_PMD_PDL_missing @@ -1,10 +1,12 @@ INFO gnpy.tools.cli_examples:cli_examples.py Computing path requests CORONET_services.json into JSON format WARNING gnpy.tools.json_io:json_io.py - WARNING missing type_variety attribute in eqpt_config.json[Roadm] - default value is type_variety = default + WARNING missing type_variety attribute in eqpt_config.json[Roadm] + default value is type_variety = default + WARNING gnpy.tools.json_io:json_io.py - WARNING missing roadm-path-impairments attribute in eqpt_config.json[Roadm] - default value is roadm-path-impairments = [] + WARNING missing roadm-path-impairments attribute in eqpt_config.json[Roadm] + default value is roadm-path-impairments = [] + INFO gnpy.topology.request:request.py request 0 Computing path from trx Abilene to trx Albany diff --git a/tests/invocation/logs_power_sweep_example b/tests/invocation/logs_power_sweep_example index a56a9c6e1..a38ee412b 100644 --- a/tests/invocation/logs_power_sweep_example +++ b/tests/invocation/logs_power_sweep_example @@ -1,9 +1,11 @@ WARNING gnpy.tools.json_io:json_io.py - WARNING missing type_variety attribute in eqpt_config.json[Roadm] - default value is type_variety = default + WARNING missing type_variety attribute in eqpt_config.json[Roadm] + default value is type_variety = default + WARNING gnpy.tools.json_io:json_io.py - WARNING missing roadm-path-impairments attribute in eqpt_config.json[Roadm] - default value is roadm-path-impairments = [] + WARNING missing roadm-path-impairments attribute in eqpt_config.json[Roadm] + default value is roadm-path-impairments = [] + INFO gnpy.tools.cli_examples:cli_examples.py source = 'brest' INFO gnpy.tools.cli_examples:cli_examples.py destination = 'rennes' WARNING gnpy.core.network:network.py diff --git a/tests/invocation/logs_transmission_saturated b/tests/invocation/logs_transmission_saturated index 07f93ef59..a14ddfe6e 100644 --- a/tests/invocation/logs_transmission_saturated +++ b/tests/invocation/logs_transmission_saturated @@ -1,9 +1,11 @@ WARNING gnpy.tools.json_io:json_io.py - WARNING missing type_variety attribute in eqpt_config.json[Roadm] - default value is type_variety = default + WARNING missing type_variety attribute in eqpt_config.json[Roadm] + default value is type_variety = default + WARNING gnpy.tools.json_io:json_io.py - WARNING missing roadm-path-impairments attribute in eqpt_config.json[Roadm] - default value is roadm-path-impairments = [] + WARNING missing roadm-path-impairments attribute in eqpt_config.json[Roadm] + default value is roadm-path-impairments = [] + INFO gnpy.tools.cli_examples:cli_examples.py source = 'lannion' INFO gnpy.tools.cli_examples:cli_examples.py destination = 'lorient' WARNING gnpy.core.network:network.py diff --git a/tests/invocation/openroadm-v4-Stockholm-Gothenburg b/tests/invocation/openroadm-v4-Stockholm-Gothenburg index 66d7395a8..f46ff698d 100644 --- a/tests/invocation/openroadm-v4-Stockholm-Gothenburg +++ b/tests/invocation/openroadm-v4-Stockholm-Gothenburg @@ -16,11 +16,13 @@ Transceiver trx_Stockholm PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): 2.00 Roadm roadm_Stockholm - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.00 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Stockholm_to_fiber (Stockholm → Norrköping)_(1/2) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -79,10 +81,11 @@ Edfa Edfa_preamp_roadm_Norrköping_from_fiber (Stockholm → Norrköping)_(2/2) actual pch out (dBm): 2.03 output VOA (dB): 0.00 Roadm roadm_Norrköping - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.03 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Norrköping_to_fiber (Norrköping → Linköping) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -119,10 +122,11 @@ Edfa Edfa_preamp_roadm_Linköping_from_fiber (Norrköping → Linköping) actual pch out (dBm): 2.01 output VOA (dB): 0.00 Roadm roadm_Linköping - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.01 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Linköping_to_fiber (Linköping → Jönköping) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -159,10 +163,11 @@ Edfa Edfa_preamp_roadm_Jönköping_from_fiber (Linköping → Jönköping) actual pch out (dBm): 2.05 output VOA (dB): 0.00 Roadm roadm_Jönköping - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.05 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Jönköping_to_fiber (Jönköping → Borås) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -199,10 +204,11 @@ Edfa Edfa_preamp_roadm_Borås_from_fiber (Jönköping → Borås) actual pch out (dBm): 2.02 output VOA (dB): 0.00 Roadm roadm_Borås - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.02 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Borås_to_fiber (Borås → Gothenburg) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -239,10 +245,11 @@ Edfa Edfa_preamp_roadm_Gothenburg_from_fiber (Borås → Gothenburg) actual pch out (dBm): 2.02 output VOA (dB): 0.00 Roadm roadm_Gothenburg - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.02 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Transceiver trx_Gothenburg GSNR (0.1nm, dB): 18.89 GSNR (signal bw, dB): 14.86 @@ -252,6 +259,7 @@ Transceiver trx_Gothenburg PMD (ps): 7.99 PDL (dB): 3.74 Latency (ms): 2.45 + Actual pch out (dBm): 2.00 Transmission result for input power = 2.00 dBm: Final GSNR (0.1 nm): 18.89 dB diff --git a/tests/invocation/openroadm-v5-Stockholm-Gothenburg b/tests/invocation/openroadm-v5-Stockholm-Gothenburg index 090b51ff3..3bbbfd8df 100644 --- a/tests/invocation/openroadm-v5-Stockholm-Gothenburg +++ b/tests/invocation/openroadm-v5-Stockholm-Gothenburg @@ -16,11 +16,13 @@ Transceiver trx_Stockholm PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): 2.00 Roadm roadm_Stockholm - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.00 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Stockholm_to_fiber (Stockholm → Norrköping)_(1/2) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -79,10 +81,11 @@ Edfa Edfa_preamp_roadm_Norrköping_from_fiber (Stockholm → Norrköping)_(2/2) actual pch out (dBm): 2.03 output VOA (dB): 0.00 Roadm roadm_Norrköping - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.03 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Norrköping_to_fiber (Norrköping → Linköping) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -119,10 +122,11 @@ Edfa Edfa_preamp_roadm_Linköping_from_fiber (Norrköping → Linköping) actual pch out (dBm): 2.01 output VOA (dB): 0.00 Roadm roadm_Linköping - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.01 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Linköping_to_fiber (Linköping → Jönköping) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -159,10 +163,11 @@ Edfa Edfa_preamp_roadm_Jönköping_from_fiber (Linköping → Jönköping) actual pch out (dBm): 2.04 output VOA (dB): 0.00 Roadm roadm_Jönköping - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.04 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Jönköping_to_fiber (Jönköping → Borås) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -199,10 +204,11 @@ Edfa Edfa_preamp_roadm_Borås_from_fiber (Jönköping → Borås) actual pch out (dBm): 2.02 output VOA (dB): 0.00 Roadm roadm_Borås - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.02 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa Edfa_booster_roadm_Borås_to_fiber (Borås → Gothenburg) type_variety: openroadm_mw_mw_booster effective gain(dB): 22.00 @@ -239,10 +245,11 @@ Edfa Edfa_preamp_roadm_Gothenburg_from_fiber (Borås → Gothenburg) actual pch out (dBm): 2.02 output VOA (dB): 0.00 Roadm roadm_Gothenburg - type_variety: default - effective loss (dB): 22.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 22.00 + Actual loss (dB): 22.02 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Transceiver trx_Gothenburg GSNR (0.1nm, dB): 19.25 GSNR (signal bw, dB): 15.23 @@ -252,6 +259,7 @@ Transceiver trx_Gothenburg PMD (ps): 7.99 PDL (dB): 3.74 Latency (ms): 2.45 + Actual pch out (dBm): 2.00 Transmission result for input power = 2.00 dBm: Final GSNR (0.1 nm): 19.25 dB diff --git a/tests/invocation/path_requests_run b/tests/invocation/path_requests_run index a6d89d64c..b29fe6744 100644 --- a/tests/invocation/path_requests_run +++ b/tests/invocation/path_requests_run @@ -21,6 +21,7 @@ bit_rate: None Gb/s spacing: 50.0 GHz power: 1.0 dBm + tx_power_dbm: 0.0 dBm nb channels: 80 path_bandwidth: 100.0 Gbit/s nodes-list: [] @@ -34,6 +35,7 @@ bit_rate: 100.0 Gb/s spacing: 50.0 GHz power: 1.0 dBm + tx_power_dbm: 0.0 dBm nb channels: 95 path_bandwidth: 200.0 Gbit/s nodes-list: ['roadm Brest_KLA', 'roadm Lannion_CAS', 'roadm Lorient_KMA', 'roadm Vannes_KBE'] @@ -47,6 +49,7 @@ bit_rate: 100.0 Gb/s spacing: 50.0 GHz power: 0.0 dBm + tx_power_dbm: 0.0 dBm nb channels: 95 path_bandwidth: 60.0 Gbit/s nodes-list: [] @@ -60,6 +63,7 @@ bit_rate: None Gb/s spacing: 75.0 GHz power: 3.0 dBm + tx_power_dbm: 0.0 dBm nb channels: 63 path_bandwidth: 150.0 Gbit/s nodes-list: [] @@ -73,6 +77,7 @@ bit_rate: 200.0 Gb/s spacing: 75.0 GHz power: 3.0 dBm + tx_power_dbm: 0.0 dBm nb channels: 63 path_bandwidth: 20.0 Gbit/s nodes-list: [] @@ -86,6 +91,7 @@ bit_rate: 100.0 Gb/s spacing: 50.0 GHz power: 0.0 dBm + tx_power_dbm: 0.0 dBm nb channels: 76 path_bandwidth: 700.0 Gbit/s nodes-list: [] @@ -99,6 +105,7 @@ bit_rate: 100.0 Gb/s spacing: 75.0 GHz power: 0.0 dBm + tx_power_dbm: 0.0 dBm nb channels: 50 path_bandwidth: 400.0 Gbit/s nodes-list: [] diff --git a/tests/invocation/path_requests_run_CD_PMD_PDL_missing b/tests/invocation/path_requests_run_CD_PMD_PDL_missing index 4fc1dcc21..8b409a650 100644 --- a/tests/invocation/path_requests_run_CD_PMD_PDL_missing +++ b/tests/invocation/path_requests_run_CD_PMD_PDL_missing @@ -11,6 +11,7 @@ bit_rate: 300.0 Gb/s spacing: 62.50000000000001 GHz power: 0.0 dBm + tx_power_dbm: 0.0 dBm nb channels: 76 path_bandwidth: 100.0 Gbit/s nodes-list: [] diff --git a/tests/invocation/power_sweep_example b/tests/invocation/power_sweep_example index c54309431..d1889661d 100644 --- a/tests/invocation/power_sweep_example +++ b/tests/invocation/power_sweep_example @@ -16,6 +16,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = -2.50 dBm: Transceiver trx Rennes_STA @@ -27,6 +28,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = -2.00 dBm: Transceiver trx Rennes_STA @@ -38,6 +40,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = -1.50 dBm: Transceiver trx Rennes_STA @@ -49,6 +52,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = -1.00 dBm: Transceiver trx Rennes_STA @@ -60,6 +64,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = -0.50 dBm: Transceiver trx Rennes_STA @@ -71,6 +76,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = -0.00 dBm: Transceiver trx Rennes_STA @@ -82,6 +88,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = 0.50 dBm: Transceiver trx Rennes_STA @@ -93,6 +100,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = 1.00 dBm: Transceiver trx Rennes_STA @@ -104,6 +112,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = 1.50 dBm: Transceiver trx Rennes_STA @@ -115,6 +124,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = 2.00 dBm: Transceiver trx Rennes_STA @@ -126,6 +136,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = 2.50 dBm: Transceiver trx Rennes_STA @@ -137,6 +148,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 Propagating with input power = 3.00 dBm: Transceiver trx Rennes_STA @@ -148,6 +160,7 @@ Transceiver trx Rennes_STA PMD (ps): 0.57 PDL (dB): 0.00 Latency (ms): 0.98 + Actual pch out (dBm): 3.00 (Invalid source node 'brest' replaced with trx Brest_KLA) diff --git a/tests/invocation/spectrum1_transmission_main_example b/tests/invocation/spectrum1_transmission_main_example index f699f794b..b7d1970c8 100644 --- a/tests/invocation/spectrum1_transmission_main_example +++ b/tests/invocation/spectrum1_transmission_main_example @@ -17,11 +17,13 @@ Transceiver trx Lannion_CAS PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): 0.00 Roadm roadm Lannion_CAS - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): 20.00 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa east edfa in Lannion_CAS to Corlay type_variety: std_medium_gain effective gain(dB): 21.00 @@ -80,10 +82,11 @@ Edfa west edfa in Lorient_KMA to Loudeac actual pch out (dBm): 1.05 output VOA (dB): 0.00 Roadm roadm Lorient_KMA - type_variety: default - effective loss (dB): 21.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 21.00 + Actual loss (dB): 21.05 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Transceiver trx Lorient_KMA GSNR (0.1nm, dB): 23.61 GSNR (signal bw, dB): 19.53 @@ -93,6 +96,7 @@ Transceiver trx Lorient_KMA PMD (ps): 0.46 PDL (dB): 0.00 Latency (ms): 0.64 + Actual pch out (dBm): 0.00 Transmission result for input power = 0.00 dBm: Final GSNR (0.1 nm): 23.61 dB diff --git a/tests/invocation/spectrum2_transmission_main_example b/tests/invocation/spectrum2_transmission_main_example index c5442838f..ced0a43da 100644 --- a/tests/invocation/spectrum2_transmission_main_example +++ b/tests/invocation/spectrum2_transmission_main_example @@ -17,11 +17,13 @@ Transceiver trx Lannion_CAS PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): mode_1: 0.00, mode_2: 0.00 Roadm roadm Lannion_CAS - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.00, mode_2: 20.00 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 Edfa east edfa in Lannion_CAS to Corlay type_variety: std_medium_gain effective gain(dB): 21.00 @@ -80,10 +82,11 @@ Edfa west edfa in Lorient_KMA to Loudeac actual pch out (dBm): mode_1: 1.04, mode_2: 1.09 output VOA (dB): 0.00 Roadm roadm Lorient_KMA - type_variety: default - effective loss (dB): 21.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 + Type_variety: default + Reference loss (dB): 21.00 + Actual loss (dB): mode_1: 21.04, mode_2: 21.09 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 Transceiver trx Lorient_KMA GSNR (0.1nm, dB): mode_1: 23.66, mode_2: 23.81 GSNR (signal bw, dB): mode_1: 19.58, mode_2: 16.72 @@ -93,6 +96,7 @@ Transceiver trx Lorient_KMA PMD (ps): 0.46 PDL (dB): 0.00 Latency (ms): 0.64 + Actual pch out (dBm): mode_1: 0.00, mode_2: 0.00 Transmission result for input power = 0.00 dBm: Final GSNR (0.1 nm): 23.72 dB diff --git a/tests/invocation/transmission_long_pow b/tests/invocation/transmission_long_pow index 4b4aca9cf..07296eb80 100644 --- a/tests/invocation/transmission_long_pow +++ b/tests/invocation/transmission_long_pow @@ -17,11 +17,13 @@ Transceiver Site_A PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): mode_1: 0.00, mode_2: 0.00 Roadm roadm Site A - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.00, mode_2: 20.00 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 Edfa booster A type_variety: std_medium_gain effective gain(dB): 20.00 @@ -146,10 +148,11 @@ Edfa Edfa5 actual pch out (dBm): mode_1: 0.05, mode_2: 0.08 output VOA (dB): 0.00 Roadm roadm Site C - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.05, mode_2: 20.08 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 Edfa booster C type_variety: std_medium_gain effective gain(dB): 20.00 @@ -274,10 +277,11 @@ Edfa Edfa10 actual pch out (dBm): mode_1: 0.05, mode_2: 0.08 output VOA (dB): 0.00 Roadm roadm Site D - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.05, mode_2: 20.08 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 Edfa booster D type_variety: std_medium_gain effective gain(dB): 20.00 @@ -336,10 +340,11 @@ Edfa Edfa12 actual pch out (dBm): mode_1: 0.03, mode_2: 0.04 output VOA (dB): 0.00 Roadm roadm Site E - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.03, mode_2: 20.04 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 Edfa booster E type_variety: std_medium_gain effective gain(dB): 20.00 @@ -420,10 +425,11 @@ Edfa Edfa15 actual pch out (dBm): mode_1: 0.03, mode_2: 0.05 output VOA (dB): 0.00 Roadm roadm Site B - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.03, mode_2: 20.05 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -20.00 Transceiver Site_B GSNR (0.1nm, dB): mode_1: 18.11, mode_2: 19.18 GSNR (signal bw, dB): mode_1: 14.02, mode_2: 12.09 @@ -433,6 +439,7 @@ Transceiver Site_B PMD (ps): 1.39 PDL (dB): 0.00 Latency (ms): 5.88 + Actual pch out (dBm): mode_1: 0.00, mode_2: 0.00 Transmission result for input power = 0.00 dBm: Final GSNR (0.1 nm): 18.56 dB diff --git a/tests/invocation/transmission_long_psd b/tests/invocation/transmission_long_psd index 7b54bb2db..948d65680 100644 --- a/tests/invocation/transmission_long_psd +++ b/tests/invocation/transmission_long_psd @@ -17,11 +17,13 @@ Transceiver Site_A PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): mode_1: 0.00, mode_2: 0.00 Roadm roadm Site A - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.00, mode_2: 16.99 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 Edfa booster A type_variety: std_medium_gain effective gain(dB): 20.00 @@ -146,10 +148,11 @@ Edfa Edfa5 actual pch out (dBm): mode_1: 0.06, mode_2: 3.07 output VOA (dB): 0.00 Roadm roadm Site C - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.06, mode_2: 20.06 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 Edfa booster C type_variety: std_medium_gain effective gain(dB): 20.00 @@ -274,10 +277,11 @@ Edfa Edfa10 actual pch out (dBm): mode_1: 0.06, mode_2: 3.07 output VOA (dB): 0.00 Roadm roadm Site D - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.06, mode_2: 20.06 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 Edfa booster D type_variety: std_medium_gain effective gain(dB): 20.00 @@ -336,10 +340,11 @@ Edfa Edfa12 actual pch out (dBm): mode_1: 0.03, mode_2: 3.04 output VOA (dB): 0.00 Roadm roadm Site E - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.03, mode_2: 20.03 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 Edfa booster E type_variety: std_medium_gain effective gain(dB): 20.00 @@ -420,10 +425,11 @@ Edfa Edfa15 actual pch out (dBm): mode_1: 0.04, mode_2: 3.05 output VOA (dB): 0.00 Roadm roadm Site B - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.04, mode_2: 20.04 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -16.99 Transceiver Site_B GSNR (0.1nm, dB): mode_1: 17.91, mode_2: 20.37 GSNR (signal bw, dB): mode_1: 13.83, mode_2: 13.28 @@ -433,6 +439,7 @@ Transceiver Site_B PMD (ps): 1.39 PDL (dB): 0.00 Latency (ms): 5.88 + Actual pch out (dBm): mode_1: 0.00, mode_2: 0.00 Transmission result for input power = 0.00 dBm: Final GSNR (0.1 nm): 18.94 dB diff --git a/tests/invocation/transmission_long_psw b/tests/invocation/transmission_long_psw index e4d8803c6..f1281dfe1 100644 --- a/tests/invocation/transmission_long_psw +++ b/tests/invocation/transmission_long_psw @@ -17,11 +17,13 @@ Transceiver Site_A PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): mode_1: 0.00, mode_2: 0.00 Roadm roadm Site A - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.00, mode_2: 18.24 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 Edfa booster A type_variety: std_medium_gain effective gain(dB): 20.00 @@ -146,10 +148,11 @@ Edfa Edfa5 actual pch out (dBm): mode_1: 0.05, mode_2: 1.82 output VOA (dB): 0.00 Roadm roadm Site C - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.05, mode_2: 20.06 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 Edfa booster C type_variety: std_medium_gain effective gain(dB): 20.00 @@ -274,10 +277,11 @@ Edfa Edfa10 actual pch out (dBm): mode_1: 0.05, mode_2: 1.82 output VOA (dB): 0.00 Roadm roadm Site D - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.05, mode_2: 20.06 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 Edfa booster D type_variety: std_medium_gain effective gain(dB): 20.00 @@ -336,10 +340,11 @@ Edfa Edfa12 actual pch out (dBm): mode_1: 0.03, mode_2: 1.79 output VOA (dB): 0.00 Roadm roadm Site E - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.03, mode_2: 20.03 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 Edfa booster E type_variety: std_medium_gain effective gain(dB): 20.00 @@ -420,10 +425,11 @@ Edfa Edfa15 actual pch out (dBm): mode_1: 0.03, mode_2: 1.80 output VOA (dB): 0.00 Roadm roadm Site B - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): mode_1: 20.03, mode_2: 20.04 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): mode_1: -20.00, mode_2: -18.24 Transceiver Site_B GSNR (0.1nm, dB): mode_1: 18.02, mode_2: 20.22 GSNR (signal bw, dB): mode_1: 13.94, mode_2: 13.12 @@ -433,6 +439,7 @@ Transceiver Site_B PMD (ps): 1.39 PDL (dB): 0.00 Latency (ms): 5.88 + Actual pch out (dBm): mode_1: 0.00, mode_2: 0.00 Transmission result for input power = 0.00 dBm: Final GSNR (0.1 nm): 18.94 dB diff --git a/tests/invocation/transmission_main_example b/tests/invocation/transmission_main_example index 01a46fa8a..71b330e05 100644 --- a/tests/invocation/transmission_main_example +++ b/tests/invocation/transmission_main_example @@ -16,6 +16,7 @@ Transceiver Site_A PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): 0.00 Fiber Span1 type_variety: SSMF length (km): 80.00 @@ -47,6 +48,7 @@ Transceiver Site_B PMD (ps): 0.36 PDL (dB): 0.00 Latency (ms): 0.39 + Actual pch out (dBm): 0.00 Transmission result for input power = 0.00 dBm: Final GSNR (0.1 nm): 31.18 dB diff --git a/tests/invocation/transmission_main_example__raman b/tests/invocation/transmission_main_example__raman index 0dc242d35..f59619b4b 100644 --- a/tests/invocation/transmission_main_example__raman +++ b/tests/invocation/transmission_main_example__raman @@ -16,6 +16,7 @@ Transceiver Site_A PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): 0.00 RamanFiber Span1 type_variety: SSMF length (km): 80.00 @@ -49,6 +50,7 @@ Transceiver Site_B PMD (ps): 0.36 PDL (dB): 0.00 Latency (ms): 0.39 + Actual pch out (dBm): 0.00 Transmission result for input power = 0.00 dBm: Final GSNR (0.1 nm): 31.42 dB diff --git a/tests/invocation/transmission_main_example_long b/tests/invocation/transmission_main_example_long index e31e19c75..d018e685e 100644 --- a/tests/invocation/transmission_main_example_long +++ b/tests/invocation/transmission_main_example_long @@ -16,11 +16,13 @@ Transceiver Site_A PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): 0.00 Roadm roadm Site A - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): 20.00 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa booster A type_variety: std_medium_gain effective gain(dB): 20.00 @@ -145,10 +147,11 @@ Edfa Edfa5 actual pch out (dBm): 0.06 output VOA (dB): 0.00 Roadm roadm Site C - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): 20.06 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa booster C type_variety: std_medium_gain effective gain(dB): 20.00 @@ -273,10 +276,11 @@ Edfa Edfa10 actual pch out (dBm): 0.06 output VOA (dB): 0.00 Roadm roadm Site D - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): 20.06 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa booster D type_variety: std_medium_gain effective gain(dB): 20.00 @@ -335,10 +339,11 @@ Edfa Edfa12 actual pch out (dBm): 0.03 output VOA (dB): 0.00 Roadm roadm Site E - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): 20.03 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa booster E type_variety: std_medium_gain effective gain(dB): 20.00 @@ -419,10 +424,11 @@ Edfa Edfa15 actual pch out (dBm): 0.04 output VOA (dB): 0.00 Roadm roadm Site B - type_variety: default - effective loss (dB): 20.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 20.00 + Actual loss (dB): 20.04 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Transceiver Site_B GSNR (0.1nm, dB): 17.84 GSNR (signal bw, dB): 13.76 @@ -432,6 +438,7 @@ Transceiver Site_B PMD (ps): 1.39 PDL (dB): 0.00 Latency (ms): 5.88 + Actual pch out (dBm): 0.00 Transmission result for input power = 0.00 dBm: Final GSNR (0.1 nm): 17.84 dB diff --git a/tests/invocation/transmission_saturated b/tests/invocation/transmission_saturated index 2cb4e0182..6b375541d 100644 --- a/tests/invocation/transmission_saturated +++ b/tests/invocation/transmission_saturated @@ -16,11 +16,13 @@ Transceiver trx Lannion_CAS PMD (ps): 0.00 PDL (dB): 0.00 Latency (ms): 0.00 + Actual pch out (dBm): 3.00 Roadm roadm Lannion_CAS - type_variety: default - effective loss (dB): 23.00 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 23.00 + Actual loss (dB): 23.00 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Edfa east edfa in Lannion_CAS to Corlay type_variety: test effective gain(dB): 21.18 @@ -79,10 +81,11 @@ Edfa west edfa in Lorient_KMA to Loudeac actual pch out (dBm): 1.21 output VOA (dB): 0.00 Roadm roadm Lorient_KMA - type_variety: default - effective loss (dB): 21.18 - reference pch out (dBm): -20.00 - actual pch out (dBm): -20.00 + Type_variety: default + Reference loss (dB): 21.18 + Actual loss (dB): 21.21 + Reference pch out (dBm): -20.00 + Actual pch out (dBm): -20.00 Transceiver trx Lorient_KMA GSNR (0.1nm, dB): 23.77 GSNR (signal bw, dB): 19.69 @@ -92,6 +95,7 @@ Transceiver trx Lorient_KMA PMD (ps): 0.46 PDL (dB): 0.00 Latency (ms): 0.64 + Actual pch out (dBm): 3.00 Transmission result for input power = 3.00 dBm: Final GSNR (0.1 nm): 23.77 dB diff --git a/tests/test_amplifier.py b/tests/test_amplifier.py index 4bc65c0c6..05e1113eb 100644 --- a/tests/test_amplifier.py +++ b/tests/test_amplifier.py @@ -74,8 +74,8 @@ def si(nch_and_spacing, bw): nb_channel, spacing = nch_and_spacing f_min = 191.3e12 f_max = automatic_fmax(f_min, spacing, nb_channel) - return create_input_spectral_information(f_min=f_min, f_max=f_max, roll_off=0.15, baud_rate=bw, power=1e-3, - spacing=spacing, tx_osnr=40.0) + return create_input_spectral_information(f_min=f_min, f_max=f_max, roll_off=0.15, baud_rate=bw, + spacing=spacing, tx_osnr=40.0, tx_power=1e-3) @pytest.mark.parametrize("gain, nf_expected", [(10, 15), (15, 10), (25, 5.8)]) @@ -232,8 +232,8 @@ def test_amp_behaviour(tilt_target, delta_p): fiber.params.con_in = 0 fiber.params.con_out = 0 fiber.ref_pch_in_dbm = 0.0 - si = create_input_spectral_information(f_min=191.3e12, f_max=196.05e12, roll_off=0.15, baud_rate=64e9, power=0.001, - spacing=75e9, tx_osnr=None) + si = create_input_spectral_information(f_min=191.3e12, f_max=196.05e12, roll_off=0.15, baud_rate=64e9, + spacing=75e9, tx_osnr=None, tx_power=1e-3) si = fiber(si) total_sig_powerin = sum(si.signal) sig_in = lin2db(si.signal) @@ -320,7 +320,7 @@ def test_amp_saturation(delta_pdb_per_channel, base_power, delta_p): si = create_arbitrary_spectral_information(frequency=frequency, slot_width=slot_width, signal=signal, baud_rate=baud_rate, roll_off=0.15, delta_pdb_per_channel=delta_pdb_per_channel, - tx_osnr=None) + tx_osnr=None, tx_power=None) total_sig_powerin = sum(si.signal) sig_in = lin2db(si.signal) si = edfa(si) diff --git a/tests/test_disjunction.py b/tests/test_disjunction.py index a48ebb681..4ba96a23c 100644 --- a/tests/test_disjunction.py +++ b/tests/test_disjunction.py @@ -119,8 +119,9 @@ def create_rq(equipment, srce, dest, bdir, node_list, loose_list, rqid='test_req 'nodes_list': node_list, 'loose_list': loose_list, 'path_bandwidth': 100.0e9, - 'power': 1.0, - 'effective_freq_slot': None, + 'power': 1.0e-3, + 'tx_power': 1.0e-3, + 'effective_freq_slot': None } params['format'] = params['trx_mode'] trx_params = trx_mode_params(equipment, params['trx_type'], params['trx_mode'], True) @@ -258,7 +259,8 @@ def request_set(): 'f_min': 191.1e12, 'f_max': 196.3e12, 'nb_channel': None, - 'power': 0.001, + 'power': 1e-3, + 'tx_power': 1e-3, 'path_bandwidth': 200e9} diff --git a/tests/test_equalization.py b/tests/test_equalization.py index 89606b047..206e0c8cb 100644 --- a/tests/test_equalization.py +++ b/tests/test_equalization.py @@ -17,12 +17,14 @@ from gnpy.core.utils import lin2db, automatic_nch, dbm2watt, power_dbm_to_psd_mw_ghz, watt2dbm, psd2powerdbm from gnpy.core.network import build_network from gnpy.core.elements import Roadm -from gnpy.core.info import create_input_spectral_information, create_arbitrary_spectral_information, ReferenceCarrier +from gnpy.core.info import create_input_spectral_information, create_arbitrary_spectral_information, ReferenceCarrier, \ + carriers_to_spectral_information from gnpy.core.equipment import trx_mode_params from gnpy.core.exceptions import ConfigurationError from gnpy.tools.json_io import network_from_json, load_equipment, load_network, _spectrum_from_json, load_json, \ Transceiver, requests_from_json from gnpy.topology.request import PathRequest, compute_constrained_path, propagate, propagate_and_optimize_mode +from gnpy.topology.spectrum_assignment import build_oms_list TEST_DIR = Path(__file__).parent @@ -330,10 +332,11 @@ def create_voyager_req(equipment, source, dest, bidir, nodes_list, loose_list, m 'nodes_list': nodes_list, 'loose_list': loose_list, 'path_bandwidth': 100.0e9, - 'effective_freq_slot': None} + 'effective_freq_slot': None, + 'power': 1e-3, + 'tx_power': 1e-3} trx_params = trx_mode_params(equipment, params['trx_type'], params['trx_mode'], True) params.update(trx_params) - params['power'] = dbm2watt(power_dbm) if power_dbm else dbm2watt(equipment['SI']['default'].power_dbm) f_min = params['f_min'] f_max_from_si = params['f_max'] params['nb_channel'] = automatic_nch(f_min, f_max_from_si, params['spacing']) @@ -368,9 +371,9 @@ def test_initial_spectrum(mode, slot_width, power_dbm): assert_array_equal(infos_expected.frequency, infos_actual.frequency) assert_array_equal(infos_expected.baud_rate, infos_actual.baud_rate) assert_array_equal(infos_expected.slot_width, infos_actual.slot_width) - assert_array_equal(infos_expected.signal, infos_actual.signal) - assert_array_equal(infos_expected.nli, infos_actual.nli) - assert_array_equal(infos_expected.ase, infos_actual.ase) + assert_allclose(infos_expected.signal, infos_actual.signal, rtol=1e-10) + assert_allclose(infos_expected.nli, infos_actual.nli, rtol=1e-10) + assert_allclose(infos_expected.ase, infos_actual.ase, rtol=1e-10) assert_array_equal(infos_expected.roll_off, infos_actual.roll_off) assert_array_equal(infos_expected.chromatic_dispersion, infos_actual.chromatic_dispersion) assert_array_equal(infos_expected.pmd, infos_actual.pmd) @@ -539,8 +542,8 @@ def test_equalization(case, deltap, target, mode, slot_width, equalization): assert getattr(roadm, equalization) == target_psd path = compute_constrained_path(network, req) si = create_input_spectral_information( - f_min=req.f_min, f_max=req.f_max, roll_off=req.roll_off, baud_rate=req.baud_rate, power=req.power, - spacing=req.spacing, tx_osnr=req.tx_osnr) + f_min=req.f_min, f_max=req.f_max, roll_off=req.roll_off, baud_rate=req.baud_rate, + spacing=req.spacing, tx_osnr=req.tx_osnr, tx_power=req.power) for i, el in enumerate(path): if isinstance(el, Roadm): si = el(si, degree=path[i + 1].uid, from_degree=path[i - 1].uid) @@ -583,9 +586,9 @@ def test_power_option(req_power): infos_actual = propagate(path2, req, equipment) assert_array_equal(infos_expected.baud_rate, infos_actual.baud_rate) assert_array_equal(infos_expected.slot_width, infos_actual.slot_width) - assert_array_equal(infos_expected.signal, infos_actual.signal) - assert_array_equal(infos_expected.nli, infos_actual.nli) - assert_array_equal(infos_expected.ase, infos_actual.ase) + assert_allclose(infos_expected.signal, infos_actual.signal, rtol=1e-10) + assert_allclose(infos_expected.nli, infos_actual.nli, rtol=1e-10) + assert_allclose(infos_expected.ase, infos_actual.ase, rtol=1e-10) assert_array_equal(infos_expected.roll_off, infos_actual.roll_off) assert_array_equal(infos_expected.chromatic_dispersion, infos_actual.chromatic_dispersion) assert_array_equal(infos_expected.pmd, infos_actual.pmd) @@ -841,3 +844,103 @@ def test_power_offset_automatic_mode_selection(slot_width, value, equalization, _, mode = propagate_and_optimize_mode(path, free_req, equipment) assert mode['format'] == expected_mode assert_allclose(path_expected[-1].snr_01nm, path[-1].snr_01nm, rtol=1e-5) + + +@pytest.mark.parametrize('tx_power_dbm', [-10, -8, 0, 10]) +def test_tx_power(tx_power_dbm): + """If carrier add power is below equalization target + ROADM add max loss, then equalizatio + can not be applied. + """ + json_data = load_json(NETWORK_FILENAME) + for el in json_data['elements']: + if el['uid'] == 'roadm Lannion_CAS': + el['type_variety'] = 'example_detailed_impairments' + equipment = load_equipment(EQPT_FILENAME) + network = network_from_json(json_data, equipment) + default_spectrum = equipment['SI']['default'] + p_db = default_spectrum.power_dbm + p_total_db = p_db + lin2db(automatic_nch(default_spectrum.f_min, default_spectrum.f_max, default_spectrum.spacing)) + build_network(network, equipment, p_db, p_total_db) + build_oms_list(network, equipment) + expected_roadm_lannion = { + "uid": "roadm Lannion_CAS", + "type": "Roadm", + "type_variety": "example_detailed_impairments", + "params": { + "restrictions": { + "preamp_variety_list": [], + "booster_variety_list": [] + }, + 'per_degree_pch_out_db': {'east edfa in Lannion_CAS to Corlay': -20, + 'east edfa in Lannion_CAS to Morlaix': -20, + 'east edfa in Lannion_CAS to Stbrieuc': -20}, + "target_pch_out_db": -20 + }, + 'metadata': { + 'location': { + 'city': 'Lannion_CAS', + 'latitude': 2.0, + 'longitude': 0.0, + 'region': 'RLD' + } + } + } + roadm = next(n for n in network.nodes() if n.uid == 'roadm Lannion_CAS') + assert roadm.to_json == expected_roadm_lannion + spectrum = _spectrum_from_json([ + { + "f_min": 191.35e12, + "f_max": 191.35e12, + "baud_rate": 32e9, + "slot_width": 50e9, + "power_dbm": 0, + "roll_off": 0.15, + "tx_osnr": 40 + }, + { + "f_min": 193.15e12, + "f_max": 193.15e12, + "baud_rate": 32e9, + "slot_width": 50e9, + "power_dbm": 0, + "roll_off": 0.15, + "tx_osnr": 40, + "tx_power_dbm": tx_power_dbm + }, + { + "f_min": 193.2e12, + "f_max": 193.2e12, + "baud_rate": 32e9, + "slot_width": 50e9, + "power_dbm": 0, + "roll_off": 0.15, + "tx_osnr": 40}]) + power = 1.0e-3 + si = carriers_to_spectral_information(initial_spectrum=spectrum, + power=power) + si = roadm(si, "east edfa in Lannion_CAS to Corlay", "trx Lannion_CAS") + # Checks that if tx_power on add port is below min required power, its equalization target can not be met + add_max_loss = next(e for e in getattr(equipment['Roadm']['example_detailed_impairments'], 'roadm-path-impairments') + if 'roadm-add-path' in e)['roadm-add-path']['roadm-maxloss'] + min_required_add_power = -20 + add_max_loss + power_reduction = max(0, min_required_add_power - tx_power_dbm) + assert_allclose(si.signal, dbm2watt(array([-20, -20 - power_reduction, -20])), rtol=1e-5) + path = ['trx Lannion_CAS', + 'roadm Lannion_CAS', + 'east edfa in Lannion_CAS to Stbrieuc', + 'fiber (Lannion_CAS → Stbrieuc)-F056', + 'east edfa in Stbrieuc to Rennes_STA', + 'fiber (Stbrieuc → Rennes_STA)-F057', + 'west edfa in Rennes_STA to Stbrieuc', + 'roadm Rennes_STA', + 'trx Rennes_STA'] + + si = carriers_to_spectral_information(initial_spectrum=spectrum, + power=power) + for i, uid in enumerate(path): + node = next(n for n in network.nodes() if n.uid == uid) + if isinstance(node, Roadm): + si = node(si, path[i + 1], path[i - 1]) + else: + si = node(si) + assert_allclose(watt2dbm(si.signal + si.ase + si.nli), array([-20, -20, -20]), rtol=1e-5) diff --git a/tests/test_gain_mode.py b/tests/test_gain_mode.py index 5b57035e8..5d88e742c 100644 --- a/tests/test_gain_mode.py +++ b/tests/test_gain_mode.py @@ -53,7 +53,8 @@ def create_rq(equipment, srce, dest, bdir, nd_list, ls_list, mode, power_dbm): 'effective_freq_slot': None, 'path_bandwidth': 100000000000.0, 'spacing': 50e9 if mode == 'mode 1' else 75e9, - 'power': dbm2watt(power_dbm) + 'power': dbm2watt(power_dbm), + 'tx_power': dbm2watt(power_dbm) } trx_params = trx_mode_params(equipment, params['trx_type'], params['trx_mode'], True) params.update(trx_params) diff --git a/tests/test_info.py b/tests/test_info.py index cceaeae27..5c504e1f0 100644 --- a/tests/test_info.py +++ b/tests/test_info.py @@ -12,7 +12,7 @@ def test_create_arbitrary_spectral_information(): si = create_arbitrary_spectral_information(frequency=[193.25e12, 193.3e12, 193.35e12], baud_rate=32e9, signal=[1, 1, 1], delta_pdb_per_channel=[1, 1, 1], - tx_osnr=40.0) + tx_osnr=40.0, tx_power=[1, 1, 1]) assert_array_equal(si.baud_rate, array([32e9, 32e9, 32e9])) assert_array_equal(si.slot_width, array([37.5e9, 37.5e9, 37.5e9])) assert_array_equal(si.signal, ones(3)) @@ -33,7 +33,7 @@ def test_create_arbitrary_spectral_information(): si = create_arbitrary_spectral_information(frequency=array([193.35e12, 193.3e12, 193.25e12]), slot_width=array([50e9, 50e9, 50e9]), baud_rate=32e9, signal=array([1, 2, 3]), - tx_osnr=40.0) + tx_osnr=40.0, tx_power=array([1, 2, 3])) assert_array_equal(si.signal, array([3, 2, 1])) @@ -41,16 +41,16 @@ def test_create_arbitrary_spectral_information(): r'larger than the slot width for channels: \[1, 3\].'): create_arbitrary_spectral_information(frequency=[193.25e12, 193.3e12, 193.35e12], signal=1, baud_rate=[64e9, 32e9, 64e9], slot_width=50e9, - tx_osnr=40.0) + tx_osnr=40.0, tx_power=1) with pytest.raises(SpectrumError, match='Spectrum required slot widths larger than the frequency spectral ' r'distances between channels: \[\(1, 2\), \(3, 4\)\].'): create_arbitrary_spectral_information(frequency=[193.26e12, 193.3e12, 193.35e12, 193.39e12], signal=1, - tx_osnr=40.0, baud_rate=32e9, slot_width=50e9) + tx_osnr=40.0, baud_rate=32e9, slot_width=50e9, tx_power=1) with pytest.raises(SpectrumError, match='Spectrum required slot widths larger than the frequency spectral ' r'distances between channels: \[\(1, 2\), \(2, 3\)\].'): create_arbitrary_spectral_information(frequency=[193.25e12, 193.3e12, 193.35e12], signal=1, baud_rate=49e9, - tx_osnr=40.0, roll_off=0.1) + tx_osnr=40.0, roll_off=0.1, tx_power=1) with pytest.raises(SpectrumError, match='Dimension mismatch in input fields.'): create_arbitrary_spectral_information(frequency=[193.25e12, 193.3e12, 193.35e12], signal=[1, 2], baud_rate=49e9, - tx_osnr=40.0) + tx_osnr=40.0, tx_power=1) diff --git a/tests/test_logger.py b/tests/test_logger.py index 0e671c30e..e1f02d440 100644 --- a/tests/test_logger.py +++ b/tests/test_logger.py @@ -34,7 +34,7 @@ def test_jsonthing(caplog): "sys_margins": 2 } _ = SI(**json_data) - expected_msg = 'WARNING missing f_min attribute in eqpt_config.json[SI]\n ' \ + expected_msg = 'WARNING missing f_min attribute in eqpt_config.json[SI]\n\t' \ + 'default value is f_min = 191350000000000.0' assert expected_msg in caplog.text diff --git a/tests/test_network_functions.py b/tests/test_network_functions.py index a970af994..e98c4f0fc 100644 --- a/tests/test_network_functions.py +++ b/tests/test_network_functions.py @@ -228,6 +228,7 @@ def test_design_non_amplified_link(elem1, elem2, expected_gain, expected_delta_p equipment = load_equipment(EQPT_FILENAME) equipment['Span']['default'].power_mode = power_mode equipment['SI']['default'].power_dbm = p_db + equipment['SI']['default'].tx_power_dbm = p_db network = network_from_json(json_data, equipment) edfa = next(a for a in network.nodes() if a.uid == 'edfa') edfa.params.out_voa_auto = True diff --git a/tests/test_parser.py b/tests/test_parser.py index f26806c7b..b1c9060d5 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -352,6 +352,7 @@ def test_excel_ila_constraints(source, destination, route_list, hoptype, expecte 'cost': None, 'roll_off': 0, 'tx_osnr': 0, + 'tx_power': 0, 'penalties': None, 'min_spacing': None, 'nb_channel': 0, diff --git a/tests/test_propagation.py b/tests/test_propagation.py index abdb841fc..4503d19dc 100644 --- a/tests/test_propagation.py +++ b/tests/test_propagation.py @@ -52,7 +52,8 @@ def propagation(input_power, con_in, con_out, dest): p = db2lin(p) * 1e-3 spacing = 50e9 # THz si = create_input_spectral_information(f_min=191.3e12, f_max=191.3e12 + 79 * spacing, roll_off=0.15, - baud_rate=32e9, power=p, spacing=spacing, tx_osnr=None) + baud_rate=32e9, spacing=spacing, tx_osnr=None, + tx_power=p) source = next(transceivers[uid] for uid in transceivers if uid == 'trx A') sink = next(transceivers[uid] for uid in transceivers if uid == dest) path = dijkstra_path(network, source, sink) @@ -181,7 +182,7 @@ def test_json_element(error, json_data, expected_msg): network = network_from_json(json_data, equipment) elem = next(e for e in network.nodes() if e.uid == 'Elem') si = create_input_spectral_information(f_min=191.3e12, f_max=196.1e12, roll_off=0.15, - baud_rate=32e9, power=1.0e-3, spacing=50.0e9, tx_osnr=45) + baud_rate=32e9, tx_power=1.0e-3, spacing=50.0e9, tx_osnr=45) with pytest.raises(error, match=re.escape(expected_msg)): _ = elem(si) diff --git a/tests/test_roadm_restrictions.py b/tests/test_roadm_restrictions.py index 0a2568913..44519fb8e 100644 --- a/tests/test_roadm_restrictions.py +++ b/tests/test_roadm_restrictions.py @@ -255,7 +255,8 @@ def test_roadm_target_power(prev_node_type, effective_pch_out_db, power_dbm, roa 'path_bandwidth': 100e9, 'effective_freq_slot': None, 'nb_channel': nb_channel, - 'power': dbm2watt(power_dbm) + 'power': dbm2watt(power_dbm), + 'tx_power': dbm2watt(power_dbm) } trx_params = trx_mode_params(equipment) params.update(trx_params) @@ -264,7 +265,7 @@ def test_roadm_target_power(prev_node_type, effective_pch_out_db, power_dbm, roa path = compute_constrained_path(network, req) si = create_input_spectral_information( f_min=req.f_min, f_max=req.f_max, roll_off=req.roll_off, baud_rate=req.baud_rate, - power=req.power, spacing=req.spacing, tx_osnr=req.tx_osnr) + spacing=req.spacing, tx_osnr=req.tx_osnr, tx_power=req.tx_power) for i, el in enumerate(path): if isinstance(el, Roadm): power_in_roadm = si.signal + si.ase + si.nli @@ -311,7 +312,8 @@ def create_per_oms_request(network, eqpt, req_power): 'path_bandwidth': 100e9, 'effective_freq_slot': None, 'nb_channel': nb_channel, - 'power': dbm2watt(req_power) + 'power': dbm2watt(req_power), + 'tx_power': dbm2watt(req_power) } trx_params = trx_mode_params(eqpt) params.update(trx_params) @@ -339,6 +341,7 @@ def create_per_oms_request(network, eqpt, req_power): carrier['label'] = "" carrier['slot_width'] = req.spacing carrier['delta_pdb'] = 0 + carrier['tx_power'] = 1e-3 req.initial_spectrum = {(req.f_min + req.spacing * f): Carrier(**carrier) for f in range(1, req.nb_channel + 1)} req_list.append(req) @@ -353,6 +356,7 @@ def create_per_oms_request(network, eqpt, req_power): carrier['label'] = "" carrier['slot_width'] = req.spacing carrier['delta_pdb'] = 0 + carrier['tx_power'] = 1e-3 req.initial_spectrum = {(req.f_min + req.spacing * f): Carrier(**carrier) for f in range(1, req.nb_channel + 1)} req_list.append(req) return req_list diff --git a/tests/test_science_utils.py b/tests/test_science_utils.py index 7bc7d1236..fdf0a80af 100644 --- a/tests/test_science_utils.py +++ b/tests/test_science_utils.py @@ -28,7 +28,8 @@ def test_fiber(): fiber.ref_pch_in_dbm = 0.0 # fix grid spectral information generation spectral_info_input = create_input_spectral_information(f_min=191.3e12, f_max=196.1e12, roll_off=0.15, - baud_rate=32e9, power=1e-3, spacing=50e9, tx_osnr=40.0) + baud_rate=32e9, spacing=50e9, tx_osnr=40.0, + tx_power=1e-3) # propagation spectral_info_out = fiber(spectral_info_input) @@ -48,7 +49,7 @@ def test_fiber(): spectral_info_input = create_arbitrary_spectral_information(frequency=frequency, slot_width=slot_width, signal=signal, baud_rate=baud_rate, roll_off=0.15, delta_pdb_per_channel=delta_pdb_per_channel, - tx_osnr=40.0) + tx_osnr=40.0, tx_power=1e-3) # propagation spectral_info_out = fiber(spectral_info_input) @@ -66,7 +67,8 @@ def test_raman_fiber(): """Test the accuracy of propagating the RamanFiber.""" # spectral information generation spectral_info_input = create_input_spectral_information(f_min=191.3e12, f_max=196.1e12, roll_off=0.15, - baud_rate=32e9, power=1e-3, spacing=50e9, tx_osnr=40.0) + baud_rate=32e9, spacing=50e9, tx_osnr=40.0, + tx_power=1e-3) SimParams.set_params(load_json(TEST_DIR / 'data' / 'sim_params.json')) fiber = RamanFiber(**load_json(TEST_DIR / 'data' / 'test_science_utils_fiber_config.json')) fiber.ref_pch_in_dbm = 0.0 @@ -103,7 +105,8 @@ def test_fiber_lumped_losses_srs(set_sim_params): """Test the accuracy of Fiber with lumped losses propagation.""" # spectral information generation spectral_info_input = create_input_spectral_information(f_min=191.3e12, f_max=196.1e12, roll_off=0.15, - baud_rate=32e9, power=1e-3, spacing=50e9, tx_osnr=40.0) + baud_rate=32e9, spacing=50e9, tx_osnr=40.0, + tx_power=1e-3) SimParams.set_params(load_json(TEST_DIR / 'data' / 'sim_params.json')) fiber = Fiber(**load_json(TEST_DIR / 'data' / 'test_lumped_losses_raman_fiber_config.json')) diff --git a/tests/test_spectrum_assignment.py b/tests/test_spectrum_assignment.py index a5e4b408a..d74f4d09d 100644 --- a/tests/test_spectrum_assignment.py +++ b/tests/test_spectrum_assignment.py @@ -288,6 +288,7 @@ def request_set(): 'cost': 1, 'roll_off': 0.15, 'tx_osnr': 38, + 'tx_power': 0.001, 'penalties': {}, 'min_spacing': 37.5e9, 'nb_channel': None, diff --git a/tests/test_trx_mode_params.py b/tests/test_trx_mode_params.py index e319cdb91..29fe09bd9 100644 --- a/tests/test_trx_mode_params.py +++ b/tests/test_trx_mode_params.py @@ -61,7 +61,7 @@ def test_trx_mode_params(trx_type, trx_mode, error_message, no_error, expected_r 'penalties': {}, 'roll_off': 0.15, 'spacing': 50000000000.0, - 'tx_osnr': 100 + 'tx_osnr': 100, } possible_results["mode 2"] = { 'format': 'mode 2',