The recent refactor removed a default pref in case of transceivers-OMS
(amplified links starting with a transceiver).
This resulted in a mismatch between input power during design
(default 0 forced in the function) and the design ref power using SI
power_dbm.
This change ensures that the same power is used for the input power
and for the design ref power, and avoid inconsistent gain computatiion.
The code has been using the same power input (SI power_dbm) to define the
power target out of a transceiver and the target out of amplifiers
(at the input of fibers). This will be changed in a future patch.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I610c8df19039bcf156a8ba77c79114b22913a538
* changes:
Add a test on EOL
add invocation test with the 3 equalization settings
Add a test on out_voa optimisation function
Clean a bit, add docstrings
Remove Pref, and move ref_carrier definition
Remove p_span0 from SI
Remove p_spani from Pref
Use design delta_p and gains instead of p_spani
restore initial power sweep behaviour
refactor cli to use a common design function
Parametrize verbose in autodesign
refactor build_network: create a separate function to add elements
Computes reference input power in fiber during design
Computes reference input power in ROADM during design
Add a variable to hold delta_p even if gain mode is selected
Add frequency range in default_edfa profile
Add a test on gain mode behaviour
Check element setting before and after propagation
Correct design: apply saturation in all cases
Add more tests on amp saturation
Finally, ref_carrier is not meant to change after design since
it is the carrier used for design. So let's move its definition
to networks function. Only ROADM need the ref_carrier baud rate
so let's define a dedicated variable in ROADM to hold it.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ida7e42dd534a04c8df8792b44980f3fd2165ecb6
reference channel is defined during design. No need to convey it
anymore during propagation.
move target_pch_out_db definition to the design phase and change
its name to be consistent with what it contains (dbm)
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I350e4557e8488a614674042de26152ab89b2d245
Remove the visualisation of the effective_pch in amp because actual
and target are the relevant ones. effective_pch was artificially
related to a mix of reference channel and noisy channel (mixed between
on the fly redesign but using actual ROADM equalisation which includes noise
in its actual loss).
the change does no more rely on the target power (which is rounded)
but on the designed gain, which is not rounded.
Propagations are slightly changed for openroadm simulations because of that.
(I verified)
The gain of amp was estimated on the fly with p_spni also in case of
RamanFiber preceding elements. removing p_spani requies that an estimation
of Raman gain be done during design.
This commit also adds this estimation.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I960b85e99f85a7d168ac5349e325c4928fa5673b
if user define a delta_p that is reduced because of saturation,
then this initial setting is still kept for power sweep to be sure
that the full amplitude of sweep is used.
SI power = 0 dBm
max power amp1 = 20 dBm,
user_defined_delta_p set by user = 3
80 channels, so pch_max = 20 - 10log10(80) = 0.96 dBm
power_sweep -> power range [-3, 0] dBm
then for initial design,
pref = 0 dBm
computed_delta_p =
min(pch_max, pref + user_defined_delta_p) - pref = 0.96
but for -3 power sweep
pref = -3 dBm
computed_delta_p =
min(pch_max, pref + user_defined_delta_p) - pref =
min(0.96, -3 + 3) - (-3) = 3
so the user defined delta_p is applied as much as possible
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I8fd459c29aa9754ff9d4868af1d8be8642a31913
separate function that adds element, from function that configure them
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ica332223bdf7fc599cb007d7513d7cd62d9c5f9c
input power is computed at design time: so let's record it and
use it instead of p_span_i for reference channel fiber loss computation.
Note that this loss parameter is only used for visualisation purpose.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I16bd792bd6079ce521aafadcf5e21922aa3b4c81
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 range is the property of amps and is independant from user propagation range.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ib89f1987910aa3121a3b8c859a0a785f7d5e27eb
This test checks that setting in gain mode forces amp to the gain settings
and ignores any power requirements. Change in SI in eqpt config and change
in req power (eg power sweep) should have no effect on the propagation.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Iad826f30010fe3110d105b5206d99f502fbf98ff
In power mode, all elements design attributes should not change except
amplifiers' gain in case of power saturation.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I2fec00232c80dd395e4dec20ec531c9c2e127760
Previously saturation was not checked during design if amp type was set.
This commit also applies saturation for these amplifiers.
This changes some of the autodesign result (since range for selection
is changed). For example, this changes some of the gains, or type variety
of amplifier of test files.
The commit also removes one of the rounding in the design phase, and
applies rounding only for printing purpose.
It also adds minor refactor on a function
In order to keep power sweep behaviour in case of saturation, the saturation
check in amplifier element uses initial power targets set by user instead
of a possible autodesign delta_p result.
Note that gain_mode is unchanged: design in gain mode means that delta_p
is set to None during the build process, even if the user defined a value
in operational.delta_p.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Idc5cfc8263cf678473acb6ec490207d9d6ba5c0a
Check that amp correctly applies saturation, when there is tilt.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I3e7623e9d5b28bdc12eae24766588645781c2827
Add the call to the function, and creates additional test cases to raise the
different situations related to spectrum slots:
- M value too small
- total nb of channels too small
- overlapping
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I7ab3923deef2ff154ee1be21dcaeb3d9e4b84375
Cut some functions into smaller pieces to be easily re-used afterwards.
This step to prepare multiple slots assignment.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: If0fa2df7f6174e54405f92a57d60289d560c1166
Prepare for the next step, to be able to handle lists of candidate assignment
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I2bd78606ce4502f68efb60f85892df5f76d52bb5
line numbers are useful for debugging, but the benefit does not
compensate for the painful update of lines in files at each commit
that changes line numbers.
So I have removed those lines only for the test_invocation logs case.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ic1f628d80b204a9a098f3902ebdfd10b480c7613
The parameters of the EDFA are explicitely retrieved in the EDFAParams class.
All the defaults are set instead in the gnpy.tool.json_io.AMP class.
Where required, the AMP.default_values are used instead of an empty dictionary.
Change-Id: Iba80a6a56bc89feb7e959b54b9bd424ec9b0bf06
Co-authored-by: Vittorio Gatto <vittoriogatto98@gmail.com>
The nonlinear coefficient can be expressed at the reference frequency and will be scaled in frequency using the scaling rule of the effective area
Change-Id: Id103b227472702776bda17ab0a2a120ecfbf7473
1. Effective area scaling along frequency is implemented by means of a technological model.
2. Raman gain coefficient is extended coherently, including the scaling due to the pump frequency.
Change-Id: I4e8b79697500ef0f73ba2f969713d9bdb3e9949c
Co-authored-by: Giacomo Borraccini <giacomo.borraccini@polito.it>
There are no binary wheels for Python 3.12 prior to pandas v2.1.1. Our
previous pin requested the 1.x branch, and that resulted in building
Pandas from source, which takes time. We cannot pin to 2.1.1 because
they removed support of Python 3.8 in 2.1, so 2.0.3 it is.
Change-Id: Ia9a567e54f4dda19a0a6b67d0c295a9a079892de
add cases of wrong sheets that were not captured and
generate errors later in propagation:
- if the eqpt line is duplicated
- if the eqpt contains a link that is not present in Links sheet,
but Nodes are OK
- if the same link is defined but with opposite directions
- if the ila is defined twice with opposite directions
- if the service type or mode are not in the library
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I4715886e19f07380bf02ed0e664559972bb39b71
Offset power is used for equalization purpose to correct for the
generic equalization target set in ROADM for this particular transceiver.
This is usefull to handle exception to the general equalization rule.
For example in the case of constant power equalization, the user might
want to apply particular power offsets unrelated to slot width or baudrate.
or in constant PSW, the user might want to have a given mode equalized for
a different value than the one computed based on the request bandwidth.
For example consider that a transceiver mode is meant to be equalized with
75 GHz whatever the spacing specified in request. then the user may specify
2 flavours depending on used spacing:
service 1 : mode 3, spacing 75GHz
service 2 : mode 4, spacing 87.5Ghz
avec
{
"format": "mode 3",
"baud_rate": 64e9,
"OSNR": 18,
"bit_rate": 200e9,
"roll_off": 0.15,
"tx_osnr": 40,
"min_spacing": 75e9,
"cost": 1
}
{
"format": "mode 4",
"baud_rate": 64e9,
"OSNR": 18,
"bit_rate": 200e9,
"roll_off": 0.15,
"tx_osnr": 40,
"min_spacing": 87.5e9,
"equalization_offset_db": -0.67,
"cost": 1
}
then the same target power would be considered for mode3 and mode4
despite using a different slot width
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I437f75c42f257b88b24207260ef9ec9b1ab7066e
Fiber latency evaluated during propagation. The speed of ligth in fiber is evaluated as the vacuum speed of ligth divided by the core reflective index n1.
The latency in the transceiver is evaluated in ms.
Change-Id: I7a3638c49f346aecaf1d4897cecf96d345fdb26c
In the previous version, the position of the lumped losses were not
included in the result Raman profile. As the latter is then used to
evaluate the NLI, including the lumped loss positions is required for
accurate estimations.
Change-Id: I683f48ceb7139d1a8be03d2e7ca7e3abffecbe85
The code look as if it was trying to prevent direct instantiation of the
SimParams class. However, instance *creation* in Python is actually
handled via `__new__` which was not overridden. In addition, the
`get()` accessor was invoking `SimParams.__new__()` directly, which
meant that this class was instantiated each time it was needed.
Let's cut the boilerplate by getting rid of the extra step and just use
the regular constructor.
This patch doesn't change anything in actual observable behavior. I
still do not like this implicit singleton design pattern, but nuking
that will have to wait until some other time.
Change-Id: I3ca81bcd0042e91b4f6b7581879922611f18febe
Constant power per slot_width uses the slot width instead of
baud rate compared to PSD.
This is the equalization used in OpenROADM
add tests for constant power per slot width equalization
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Ie350e4c15cb6b54c15e418556fe33e72486cb134
flake8-html is now compatible with the v5 of this package, so let's use
it. Unfortunately, they killed the `--diff` option in v6, so we cannot
use it right now. I understand the reasoning as well as the fact that
it's easy to be broken, but I don't like broken CI that much.
Change-Id: I70dd686e097f411c39bfc53f83d519540687dd64
...mainly to be in sync with oopt-gnpy-libyang that I've been working on
recently, and to allow us to modernize this infrastructure later on.
Change-Id: Id0ed1d7620762fc204300ebe8a190de8e42ae9df
GitHub CI started failing with the following error:
assert (watt2dbm(si.signal) == target - correction).all()
assert False
+ where False = <built-in method all of numpy.ndarray object at 0x7f01c0ca94d0>()
+ where <built-in method all of numpy.ndarray object at 0x7f01c0ca94d0> = array([-25.5, -24.5, -22.5, -25. , -27.5]) == array([-25.5, -24.5, -22.5, -25. , -27.5])
+array([-25.5, -24.5, -22.5, -25. , -27.5])
-array([-25.5, -24.5, -22.5, -25. , -27.5])
Full diff:
array([-25.5, -24.5, -22.5, -25. , -27.5]).all
This is with code which has passed in the Zuul/Vexxhost CI.
It looks very similar to a regression that hit numpy 1.24.0, but the
GitHub action log shows that this happens with numpy 1.24.1. Weird, and
I'm not getting these differences locally, and also not on an ARM64
cloud VM.
Anyway, comparing floating point numbers for strict equality is futile,
so let's use this opportunity to use a proper check for these.
Change-Id: I05683f3116cad78d067bddde2780fe25b5caf768
On a ROADM, the code would previously set the same per-carrier power
regardless of the channel spectrum width. With this patch, carriers are
equalized either by their:
- absolute power (same as before),
- power spectral density (PSD).
Also, it's possible to apply a per-channel power offset (in dB) which
will be applied to a specified channel on top of the selected
power-level or PSD strategy. The same offset can be also selected
through the `--spectrum` option via the `default_pdb` parameter.
The equalization policy can be set via the ROADM model (in the equipment
config) as well as on a per-instance basis.
The PSD is defined as the absolute power over a spectral bandwidth,
where the spectral bandwidth corresponds to the actual spectrum
occupation (without any applicable guard bands), as approximated by the
symbol rate. PSD is specified in mW/GHz. As an example, for a 32 GBaud
signal at 0.01 mW, the PSD is 0.01/32 = 3.125e-4 mW/GHz.
This has some implications on the power sweep and ROADM behavior. Same
as previously (with absolute power targets), the ROADM design determines
the power set points. Target power is usually the best (highest) power
that can be supported by the ROADMs, especially the Add/Drop and express
stages' losses, with the goal to maximize the power at the booster's
input. As such, the `--power` option (or the power sweep) doesn't
manipulate with ROADM's target output power, but only with the output
power of the amplifiers. With PSD equalization, the `--power` option is
interpreted as the power of the reference channel defined in equipment
config's `SI` container, and its PSD is used for propagation. Power
sweep is interpreted in the same way, e.g.:
"SI":[{
"f_min": 191.3e12,
"baud_rate": 32e9,
"f_max":195.1e12,
"spacing": 50e9,
"power_dbm": 0,
"power_range_db": [-1,1,1],
"roll_off": 0.15,
"tx_osnr": 40,
"sys_margins": 2
}],
...and with the PSD equalization in a ROADM:
{
"uid": "roadm A",
"type": "Roadm",
"params": {
"target_psd_out_mWperGHz": 3.125e-4,
}
},
{
"uid": "edfa in roadm A to toto",
"type": "Edfa",
"type_variety": "standard_medium_gain",
"operational": {
"gain_target": 22,
"delta_p": 2,
"tilt_target": 0.0,
"out_voa": 0
}
},
then we use the power steps of the power_range_db to compute resulting
powers of each carrier out of the booster amp:
power_db = psd2powerdbm(target_psd_out_mWperGHz, baud_rate)
sweep = power_db + delta_power for delta_power in power_range_db
Assuming one 32Gbaud and one 64Gbaud carriers:
32 Gbaud 64 Gbaud
roadmA out power
(sig+ase+nli) -20dBm -17dBm
EDFA out power
range[
-1 1dBm 4dBm
0 2dBm 5dBm
1 3dBm 6dBm
]
Design case:
Design is performed based on the reference channel set defined in SI
in equipment config (independantly of equalization process):
"SI":[{
"f_min": 191.3e12,
"baud_rate": 32e9,
"f_max":195.1e12,
"spacing": 50e9,
"power_dbm": -1,
"power_range_db": [0,0,1],
"roll_off": 0.15,
"tx_osnr": 40,
"sys_margins": 2
}],
`delta_p` values of amps refer to this reference channel, but are applicable
for any baudrate during propagation, e.g.:
{
"uid": "roadm A",
"type": "Roadm",
"params": {
"target_psd_out_mWperGHz": 2.717e-4,
}
},
{
"uid": "edfa in roadm A to toto",
"type": "Edfa",
"type_variety": "standard_medium_gain",
"operational": {
"gain_target": 22,
"delta_p": 2,
"tilt_target": 0.0,
"out_voa": 0
}
},
Then the output power for a 64 Gbaud carrier will be +4 =
= lin2db(db2lin(power_dbm + delta_p)/32e9 * 64e9)
= lin2db(db2lin(power_dbm + delta_p) * 2)
= powerdbm + delta + 3 = 4 dBm
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I28bcfeb72b0e74380b087762bb92ba5d39219eb3
The program currently ignores the explicit `index` and reads the
constraints in the JSON order of the list. However in general, it is not
guaranteed that constraints are listed in order.
Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Icefe271f5801cf9f7b43311c6666556564587c65
Signed-off-by: Jan Kundrát <jan.kundrat@telecominfraproject.com>