Skip to content

Commit

Permalink
feat: apply per path_type ROADM OSNR
Browse files Browse the repository at this point in the history
Signed-off-by: EstherLerouzic <[email protected]>
Change-Id: I2b0838c9a217a7f918b2cf08c233aacdbf686a72
  • Loading branch information
EstherLerouzic committed Mar 15, 2024
1 parent 73fa38e commit eea664a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion gnpy/core/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def update_snr(self, *args):
# use raw_values so that the added SNR penalties are not cumulated
snr_added = 0
for s in args:
snr_added += db2lin(-s)
if s is not None:
snr_added += db2lin(-s)
snr_added = -lin2db(snr_added)
self.osnr_ase = snr_sum(self.raw_osnr_ase, self.baud_rate, snr_added)
self.snr = snr_sum(self.raw_snr, self.baud_rate, snr_added)
Expand Down
18 changes: 10 additions & 8 deletions gnpy/topology/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,17 +338,17 @@ def propagate(path, req, equipment):
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)
roadm_osnr = []
for i, el in enumerate(path):
if isinstance(el, Roadm):
si = el(si, degree=path[i + 1].uid, from_degree=path[i - 1].uid)
roadm_osnr.append(el.get_roadm_path(from_degree=path[i - 1].uid, to_degree=path[i + 1].uid).impairment.osnr)
else:
si = el(si)
path[0].update_snr(si.tx_osnr)
path[0].calc_penalties(req.penalties)
if any(isinstance(el, Roadm) for el in path):
path[-1].update_snr(si.tx_osnr, equipment['Roadm']['default'].add_drop_osnr)
else:
path[-1].update_snr(si.tx_osnr)
roadm_osnr.append(si.tx_osnr)
path[-1].update_snr(*roadm_osnr)
path[-1].calc_penalties(req.penalties)
return si

Expand Down Expand Up @@ -382,19 +382,21 @@ def propagate_and_optimize_mode(path, req, equipment):
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)
roadm_osnr = []
for i, el in enumerate(path):
if isinstance(el, Roadm):
spc_info = el(spc_info, degree=path[i + 1].uid, from_degree=path[i - 1].uid)
roadm_osnr.append(el.get_roadm_path(from_degree=path[i - 1].uid, to_degree=path[i + 1].uid).impairment.osnr)
else:
spc_info = el(spc_info)
for this_mode in modes_to_explore:
if path[-1].snr is not None:
path[0].update_snr(this_mode['tx_osnr'])
path[0].calc_penalties(this_mode['penalties'])
if any(isinstance(el, Roadm) for el in path):
path[-1].update_snr(this_mode['tx_osnr'], equipment['Roadm']['default'].add_drop_osnr)
else:
path[-1].update_snr(this_mode['tx_osnr'])
roadm_osnr.append(this_mode['tx_osnr'])
path[-1].update_snr(*roadm_osnr)
# remove the tx_osnr from roadm_osnr list for the next iteration
del roadm_osnr[-1]
path[-1].calc_penalties(this_mode['penalties'])
if round(min(path[-1].snr_01nm - path[-1].total_penalty), 2) \
> this_mode['OSNR'] + equipment['SI']['default'].sys_margins:
Expand Down

0 comments on commit eea664a

Please sign in to comment.