Only propagates carriers that belong to Amp bandwidth

The commit introduces mux/demux functions in amps and ensures that the
propagation is only done on carriers that are in the Amp bandwitdh, ie
with all their spectrum including slot width is in bandwidth.

For consistency, default amp f_min is changed:
Objective is to use amplifiers' band to bound the possible frequencies
to be propagated. Since the current default f_min of Amp in json_io.py is
higher than the SI one, this would result in a different nb of channels
than currently used in tests, and a change in all tests. In order to
avoid this, I preferred to change this value and have consistency
between SI f_min and Amp f_min.

The commits adds a set of functions to make amps band the useable
spectrum on each OMS. Thee OMS generation is changed to use the amp band.

The commit adds filtering functions (demux and mux) to filter out spectrum
which is not in the amplifier band.

Spectrum assignment is also corrected to correctly match the amp bandwidth
constraint with guardband: center frequency index must be within the
usable part of the amp band. This changes a bit the notion of freq_index
and guardband in the functions, but this is transparent to user:
f_min, f_max represent the amp band, while self.freq_index_min/max
represent the center frequency boundary for a reference 50GHz channel.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I225b2b2dc0e1f1992c0460f6e08fa9c9bc641edf
This commit is contained in:
EstherLerouzic
2022-01-06 15:07:20 +01:00
committed by Esther Le Rouzic
parent 5277ae2005
commit ac8fd770ab
13 changed files with 286 additions and 73 deletions

View File

@@ -1,6 +1,6 @@
{
"f_min": 191.35e12,
"f_max": 196.1e12,
"f_min": 191.275e12,
"f_max": 196.125e12,
"nf_ripple": [
0.0,
0.0,

View File

@@ -1,4 +1,7 @@
{ "nf_fit_coeff": [
{
"f_min": 191.275e12,
"f_max": 196.125e12,
"nf_fit_coeff": [
0.000168241,
0.0469961,
0.0359549,

View File

@@ -251,35 +251,35 @@ def test_amp_behaviour(tilt_target, delta_p):
else:
if delta_p != 2:
expected_sig_out = [
-32.00529182, -31.93540907, -31.86554231, -31.79417979, -31.71903263,
-31.6424009, -31.56531159, -31.48775435, -31.41468382, -31.35973323,
-31.32286555, -31.28602346, -31.2472908, -31.20086569, -31.14671746,
-31.08702653, -31.01341963, -30.93430243, -30.87791656, -30.84413339,
-30.81605918, -30.78824936, -30.76071036, -30.73319161, -30.70494101,
-30.67368479, -30.63941012, -30.60178381, -30.55585766, -30.5066561,
-30.43426575, -30.33848379, -30.24471112, -30.18220815, -30.15076699,
-30.11934744, -30.08776718, -30.05548097, -30.02250068, -29.98954302,
-29.95661362, -29.92370274, -29.8854762, -29.84193785, -29.79238328,
-29.72452662, -29.6385071, -29.54788144, -29.44581202, -29.33924103,
-29.23276107, -29.10289365, -28.91425473, -28.70204648, -28.50670713,
-28.3282514, -28.15895225, -28.009065, -27.87864672, -27.76315964,
-27.68523133, -27.62260405, -27.58076622]
-31.95025022, -31.88168886, -31.81178634, -31.73838831, -31.66318631,
-31.58762141, -31.51156294, -31.43760161, -31.38124626, -31.34245197,
-31.30629475, -31.26970711, -31.22566555, -31.17412914, -31.11806869,
-31.05122228, -30.97358131, -30.90658619, -30.86616148, -30.83854197,
-30.81115028, -30.78403337, -30.7570206, -30.73002834, -30.70088634,
-30.66844432, -30.63427939, -30.59364514, -30.54659009, -30.49180643,
-30.41406352, -30.31434813, -30.22984104, -30.18249387, -30.1516453,
-30.12082034, -30.08970494, -30.05779424, -30.02543415, -29.99309889,
-29.96078803, -29.92798594, -29.89002127, -29.84689015, -29.79726968,
-29.72927112, -29.64485972, -29.55578693, -29.45569694, -29.35111795,
-29.24662471, -29.12148491, -28.94244964, -28.73421833, -28.53930479,
-28.36231261, -28.19361236, -28.04376778, -27.91280403, -27.79433658,
-27.7065072, -27.64495288, -27.59798975]
else:
expected_sig_out = [
-30.00529182, -29.93540907, -29.86554231, -29.79417979, -29.71903263,
-29.6424009, -29.56531159, -29.48775435, -29.41468382, -29.35973323,
-29.32286555, -29.28602346, -29.2472908, -29.20086569, -29.14671746,
-29.08702653, -29.01341963, -28.93430243, -28.87791656, -28.84413339,
-28.81605918, -28.78824936, -28.76071036, -28.73319161, -28.70494101,
-28.67368479, -28.63941012, -28.60178381, -28.55585766, -28.5066561,
-28.43426575, -28.33848379, -28.24471112, -28.18220815, -28.15076699,
-28.11934744, -28.08776718, -28.05548097, -28.02250068, -27.98954302,
-27.95661362, -27.92370274, -27.8854762, -27.84193785, -27.79238328,
-27.72452662, -27.6385071, -27.54788144, -27.44581202, -27.33924103,
-27.23276107, -27.10289365, -26.91425473, -26.70204648, -26.50670713,
-26.3282514, -26.15895225, -26.009065, -25.87864672, -25.76315964,
-25.68523133, -25.62260405, -25.58076622]
-29.95025022, -29.88168886, -29.81178634, -29.73838831, -29.66318631,
-29.58762141, -29.51156294, -29.43760161, -29.38124626, -29.34245197,
-29.30629475, -29.26970711, -29.22566555, -29.17412914, -29.11806869,
-29.05122228, -28.97358131, -28.90658619, -28.86616148, -28.83854197,
-28.81115028, -28.78403337, -28.7570206, -28.73002834, -28.70088634,
-28.66844432, -28.63427939, -28.59364514, -28.54659009, -28.49180643,
-28.41406352, -28.31434813, -28.22984104, -28.18249387, -28.1516453,
-28.12082034, -28.08970494, -28.05779424, -28.02543415, -27.99309889,
-27.96078803, -27.92798594, -27.89002127, -27.84689015, -27.79726968,
-27.72927112, -27.64485972, -27.55578693, -27.45569694, -27.35111795,
-27.24662471, -27.12148491, -26.94244964, -26.73421833, -26.53930479,
-26.36231261, -26.19361236, -26.04376778, -25.91280403, -25.79433658,
-25.7065072, -25.64495288, -25.59798975]
print(sig_out)
assert_allclose(sig_out, expected_sig_out, rtol=1e-9)

View File

@@ -33,7 +33,7 @@ SERVICE_FILENAME = DATA_DIR / 'testTopology_services_expected.json'
grid = 0.00625e12
slot = 0.0125e12
guardband = 0.15e12
guardband = 25.0e9
cband_freq_min = 191.3e12
cband_freq_max = 196.1e12
@@ -101,14 +101,15 @@ def test_wrong_values(nval, mval, setup):
def test_aligned(nmin, nmax, setup):
"""Checks that the OMS grid is correctly aligned
Note that bitmap index uses guardband on both ends so that if nmin, nmax = -200, +200,
Note that bitmap index uses guardband on both ends so that if center frequencies nmin, nmax = -200, +200,
min/max navalue in bitmap are -224, +223, which makes 223 -(-224) +1 frequencies.
"""
network, oms_list = setup
nguard = guardband / grid
center = 193.1e12
freq_min = center + nmin * grid
freq_max = center + nmax * grid
# amplification band
freq_min = center + nmin * grid - guardband
freq_max = center + nmax * grid + guardband
random_oms = oms_list[10]
# We're always starting with full C-band
@@ -116,9 +117,9 @@ def test_aligned(nmin, nmax, setup):
assert pytest.approx(nvalue_to_frequency(random_oms.spectrum_bitmap.freq_index_max) * 1e-12, abs=1e-12) == 196.1
ind_max = len(random_oms.spectrum_bitmap.bitmap) - 1
# "inner" frequencies, without the guard baand
# "inner" frequencies, without the guard band
inner_n_min = random_oms.spectrum_bitmap.getn(0) + nguard
inner_n_max = random_oms.spectrum_bitmap.getn(ind_max) - nguard + 1
inner_n_max = random_oms.spectrum_bitmap.getn(ind_max) - nguard
assert inner_n_min == random_oms.spectrum_bitmap.freq_index_min
assert inner_n_max == random_oms.spectrum_bitmap.freq_index_max
assert inner_n_min == -288
@@ -136,7 +137,7 @@ def test_aligned(nmin, nmax, setup):
ind_max = len(random_oms.spectrum_bitmap.bitmap) - 1
inner_n_min = random_oms.spectrum_bitmap.getn(0) + nguard
inner_n_max = random_oms.spectrum_bitmap.getn(ind_max) - nguard + 1
inner_n_max = random_oms.spectrum_bitmap.getn(ind_max) - nguard
assert inner_n_min == random_oms.spectrum_bitmap.freq_index_min
assert inner_n_max == random_oms.spectrum_bitmap.freq_index_max
@@ -198,18 +199,20 @@ def test_assign_and_sum(nval1, nval2, setup):
def test_bitmap_assignment(setup):
"""test that a bitmap can be assigned"""
network, oms_list = setup
_, oms_list = setup
random_oms = oms_list[2]
random_oms.assign_spectrum(13, 7)
btmp = deepcopy(random_oms.spectrum_bitmap.bitmap)
# try a first assignment that must pass
spectrum_btmp = Bitmap(cband_freq_min, cband_freq_max, grid=0.00625e12, guardband=0.15e12, bitmap=btmp)
freq_min = nvalue_to_frequency(random_oms.spectrum_bitmap.n_min)
freq_max = nvalue_to_frequency(random_oms.spectrum_bitmap.n_max)
_ = Bitmap(freq_min, freq_max, grid=0.00625e12, guardband=guardband, bitmap=btmp)
# try a wrong assignment that should not pass
btmp = btmp[1:-1]
with pytest.raises(SpectrumError):
spectrum_btmp = Bitmap(cband_freq_min, cband_freq_max, grid=0.00625e12, guardband=0.15e12, bitmap=btmp)
_ = Bitmap(cband_freq_min, cband_freq_max, grid=0.00625e12, guardband=guardband, bitmap=btmp)
@pytest.fixture()