Computes reference input power in ROADM during design

input power is computed at design time: so let's record it and
use it instead of p_span_i for ROADM reference channel loss computation.
Note that this loss parameter is only used for visualisation purpose.
No impact on propagation.

Since this loss is computed for the reference channel used for
design, we need to record input power based on input degrees,
and indicate this information within the call function.

Note that this will be also usefull later on to implement ROADM
parameters

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I64d510fc20df72f07158f400964d592d76dc0ce4
This commit is contained in:
EstherLerouzic
2022-10-19 15:01:01 +02:00
parent 7c60b000b5
commit 07fd89351b
6 changed files with 85 additions and 16 deletions

View File

@@ -73,6 +73,7 @@ def test_equalization_combination_degree(delta_pdb_per_channel, degree, equaliza
}
}
roadm = Roadm(**roadm_config)
roadm.ref_pch_in_dbm['tata'] = 0
frequency = 191e12 + array([0, 50e9, 150e9, 225e9, 275e9])
slot_width = array([37.5e9, 50e9, 75e9, 50e9, 37.5e9])
baud_rate = array([32e9, 42e9, 64e9, 42e9, 32e9])
@@ -98,7 +99,7 @@ def test_equalization_combination_degree(delta_pdb_per_channel, degree, equaliza
'metadata': {'location': {'latitude': 0, 'longitude': 0, 'city': None, 'region': None}}
}
assert roadm.to_json == to_json_before_propagation
si = roadm(si, degree)
si = roadm(si, degree=degree, from_degree='tata')
assert roadm.ref_pch_out_dbm == pytest.approx(expected_pch_out_dbm, rel=1e-4)
assert_allclose(expected_si, roadm.get_per_degree_power(degree, spectral_info=si), rtol=1e-3)
@@ -244,7 +245,8 @@ def test_low_input_power(target_out, delta_pdb_per_channel, correction):
}
}
roadm = Roadm(**roadm_config)
si = roadm(si, 'toto')
roadm.ref_pch_in_dbm['tata'] = 0
si = roadm(si, degree='toto', from_degree='tata')
assert_allclose(watt2dbm(si.signal), target - correction, rtol=1e-5)
# in other words check that if target is below input power, target is applied else power is unchanged
assert_allclose((watt2dbm(signal) >= target) * target + (watt2dbm(signal) < target) * watt2dbm(signal),
@@ -296,7 +298,8 @@ def test_2low_input_power(target_out, delta_pdb_per_channel, correction):
}
}
roadm = Roadm(**roadm_config)
si = roadm(si, 'toto')
roadm.ref_pch_in_dbm['tata'] = 0
si = roadm(si, degree='toto', from_degree='tata')
assert_allclose(watt2dbm(si.signal), target - correction, rtol=1e-5)
@@ -537,7 +540,7 @@ def test_equalization(case, deltap, target, mode, slot_width, equalization):
spacing=req.spacing, tx_osnr=req.tx_osnr, ref_carrier=ref)
for i, el in enumerate(path):
if isinstance(el, Roadm):
si = el(si, degree=path[i + 1].uid)
si = el(si, degree=path[i + 1].uid, from_degree=path[i - 1].uid)
if case in ['SI', 'nodes', 'degrees']:
if equalization == 'target_psd_out_mWperGHz':
assert_allclose(power_dbm_to_psd_mw_ghz(watt2dbm(si.signal + si.ase + si.nli), si.baud_rate),