mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-02 02:57:52 +00:00
The option is only set for gnpy-transmission-main. The spectrum file is a list of spectrum objects, each defining f_min, f_max and spectrum attributes using the same meaning as SI in eqpt_config.json for baud_rate, roll_off, tx_osnr. slot_width is used for the occupation of each carrier around their central frequency, so slot_width corresponds to spacing of SI. Unlike SI, the frequencies are defined includint f_min and f_max. The partitions must be contiguous not overlapping. Pref.p_span0 object records the req_power, while ref_carrier records info that will be useful for equalization ie baud_rate. For now, I have not integrated the possibility to directly use transceivers type and mode in the list. User can define sets of contiguous channels and a label to identify the spectrum bands. If no label are defined, the program justs uses the index + baud rate of the spectrum bands as label. Print results per spectrum label If propagated spectrum has mixed rates, then prints results (GSNR and OSNR) for each propagated spectrum type according to its label. Print per label channel power of elements Per channel power prints were previously only showing the noiseless reference channel power and only an average power. With this change, we add a new information on the print: the average total power (signal + noise + non-linear noise). If there are several spectrum types propagating, the average per spectrum is displayed using the label. For this purpose, label and total power are recorded in each element upon propagation Note that the difference between this total power and the existing channel power represents the added noise for the considered OMS. Indeed ROADMs equalize per channel total power, so that power displayed in 'actual pch (dBm)' may contain some noise contribution accumulated with previous propagation. Because 'reference pch out (dBm)' is for the noiseless reference, it is exactly set to the target power and 'actual pch (dBm)' is always matching 'reference pch out (dBm)' in ROADM prints. Add examples and tests for -spectrum option initial_spectrum1.json reproduces exactly the case of SI initial_spectrum2.json sets half of the spectrum with 50GHz 32Gbauds and half with 75GHz 64 Gbauds. Power setting is not set for the second half, So that equalization will depend on ROADM settings. Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com> Change-Id: Ibc01e59e461e5e933e95d23dacbc5289e275ccf7
73 lines
3.3 KiB
Python
73 lines
3.3 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
'''
|
|
gnpy.core.equipment
|
|
===================
|
|
|
|
This module contains functionality for specifying equipment.
|
|
'''
|
|
|
|
from gnpy.core.utils import automatic_nch, db2lin
|
|
from gnpy.core.exceptions import EquipmentConfigError
|
|
|
|
|
|
def trx_mode_params(equipment, trx_type_variety='', trx_mode='', error_message=False):
|
|
"""return the trx and SI parameters from eqpt_config for a given type_variety and mode (ie format)"""
|
|
trx_params = {}
|
|
default_si_data = equipment['SI']['default']
|
|
|
|
try:
|
|
trxs = equipment['Transceiver']
|
|
# if called from path_requests_run.py, trx_mode is filled with None when not specified by user
|
|
# if called from transmission_main.py, trx_mode is ''
|
|
if trx_mode is not None:
|
|
mode_params = next(mode for trx in trxs
|
|
if trx == trx_type_variety
|
|
for mode in trxs[trx].mode
|
|
if mode['format'] == trx_mode)
|
|
trx_params = {**mode_params}
|
|
# sanity check: spacing baudrate must be smaller than min spacing
|
|
if trx_params['baud_rate'] > trx_params['min_spacing']:
|
|
raise EquipmentConfigError(f'Inconsistency in equipment library:\n Transpoder "{trx_type_variety}" mode "{trx_params["format"]}" ' +
|
|
f'has baud rate {trx_params["baud_rate"]*1e-9} GHz greater than min_spacing {trx_params["min_spacing"]*1e-9}.')
|
|
else:
|
|
mode_params = {"format": "undetermined",
|
|
"baud_rate": None,
|
|
"OSNR": None,
|
|
"penalties": None,
|
|
"bit_rate": None,
|
|
"roll_off": None,
|
|
"tx_osnr": None,
|
|
"min_spacing": None,
|
|
"cost": None}
|
|
trx_params = {**mode_params}
|
|
trx_params['f_min'] = equipment['Transceiver'][trx_type_variety].frequency['min']
|
|
trx_params['f_max'] = equipment['Transceiver'][trx_type_variety].frequency['max']
|
|
|
|
# TODO: novel automatic feature maybe unwanted if spacing is specified
|
|
# trx_params['spacing'] = _automatic_spacing(trx_params['baud_rate'])
|
|
# temp = trx_params['spacing']
|
|
# print(f'spacing {temp}')
|
|
except StopIteration:
|
|
if error_message:
|
|
raise EquipmentConfigError(f'Could not find transponder "{trx_type_variety}" with mode "{trx_mode}" in equipment library')
|
|
else:
|
|
# default transponder charcteristics
|
|
# mainly used with transmission_main_example.py
|
|
trx_params['f_min'] = default_si_data.f_min
|
|
trx_params['f_max'] = default_si_data.f_max
|
|
trx_params['baud_rate'] = default_si_data.baud_rate
|
|
trx_params['spacing'] = default_si_data.spacing
|
|
trx_params['OSNR'] = None
|
|
trx_params['penalties'] = {}
|
|
trx_params['bit_rate'] = None
|
|
trx_params['cost'] = None
|
|
trx_params['roll_off'] = default_si_data.roll_off
|
|
trx_params['tx_osnr'] = default_si_data.tx_osnr
|
|
trx_params['min_spacing'] = None
|
|
|
|
trx_params['power'] = db2lin(default_si_data.power_dbm) * 1e-3
|
|
|
|
return trx_params
|