Merge changes from topic "warning on gain"

* changes:
  Change example file meshTopologyExampleV2.xls
  add warning in case gain over max_flat_gain + extended_gain_range
This commit is contained in:
Jan Kundrát
2021-04-06 10:29:11 +00:00
committed by Gerrit Code Review
3 changed files with 17 additions and 6 deletions

View File

@@ -317,6 +317,17 @@ def set_egress_amplifier(network, this_node, equipment, pref_ch_db, pref_total_d
gain_target += power_reduction
elif node.params.raman and not raman_allowed:
print(f'{ansi_escapes.red}WARNING{ansi_escapes.reset}: raman is used in node {node.uid}\n but fiber lineic loss is above threshold\n')
else:
# if variety is imposed by user, and if the gain_target (computed or imposed) is also above
# variety max gain + extended range, then warn that gain > max_gain + extended range
if gain_target - equipment['Edfa'][node.params.type_variety].gain_flatmax - \
equipment['Span']['default'].target_extended_gain > 1e-2:
# 1e-2 to allow a small margin according to round2float min step
print(f'{ansi_escapes.red}WARNING{ansi_escapes.reset}: '
f'WARNING: effective gain in Node {node.uid} is above user '
f'specified amplifier {node.params.type_variety}\n'
f'max flat gain: {equipment["Edfa"][node.params.type_variety].gain_flatmax}dB ; '
f'required gain: {gain_target}dB. Please check amplifier type.')
node.delta_p = dp if power_mode else None
node.effective_gain = gain_target