mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-10-30 01:32:21 +00:00
improve power saturation handling
fix issue with low power level (after very long spans) where signal gian was depleted Signed-off-by: Jean-Luc Auge <jeanluc.auge@orange.com>
This commit is contained in:
@@ -575,11 +575,16 @@ class Edfa(Node):
|
||||
self.effective_gain = self.target_pch_out_db - pref.pi
|
||||
else:
|
||||
self.effective_gain = self.operational.gain_target
|
||||
|
||||
"""check power saturation and correct effective gain & power accordingly:"""
|
||||
self.effective_gain = min(
|
||||
self.effective_gain,
|
||||
self.params.p_max - (pref.pi + pref.neq_ch)
|
||||
)
|
||||
#print(self.uid, self.effective_gain, self.operational.gain_target)
|
||||
self.effective_pch_out_db = round(pref.pi + self.effective_gain, 2)
|
||||
|
||||
"""check power saturation and correct target_gain accordingly:"""
|
||||
self.effective_gain = min(self.effective_gain, self.params.p_max - self.pin_db)
|
||||
self.effective_pch_out_db = round(pref.pi + self.effective_gain, 2)
|
||||
#print(self.uid, self.effective_gain, self.pin_db, pref.pi)
|
||||
self.nf = self._calc_nf()
|
||||
self.gprofile = self._gain_profile(pin)
|
||||
|
||||
@@ -30,7 +30,7 @@ class ConvenienceAccess:
|
||||
|
||||
|
||||
class Power(namedtuple('Power', 'signal nonlinear_interference amplified_spontaneous_emission'), ConvenienceAccess):
|
||||
|
||||
"""carriers power in W"""
|
||||
_ABBREVS = {'nli': 'nonlinear_interference',
|
||||
'ase': 'amplified_spontaneous_emission',}
|
||||
|
||||
@@ -42,7 +42,11 @@ class Channel(namedtuple('Channel', 'channel_number frequency baud_rate roll_off
|
||||
'ffs': 'frequency',
|
||||
'freq': 'frequency',}
|
||||
|
||||
class Pref(namedtuple('Pref', 'p_span0, p_spani'), ConvenienceAccess):
|
||||
class Pref(namedtuple('Pref', 'p_span0, p_spani, neq_ch '), ConvenienceAccess):
|
||||
"""noiseless reference power in dBm:
|
||||
p0: inital target carrier power
|
||||
pi: carrier power after element i
|
||||
neqch: equivalent channel count in dB"""
|
||||
|
||||
_ABBREVS = {'p0' : 'p_span0',
|
||||
'pi' : 'p_spani'}
|
||||
@@ -60,8 +64,8 @@ def merge_input_spectral_information(*si):
|
||||
def create_input_spectral_information(f_min, f_max, roll_off, baud_rate, power, spacing):
|
||||
# pref in dB : convert power lin into power in dB
|
||||
pref = lin2db(power * 1e3)
|
||||
si = SpectralInformation(pref=Pref(pref, pref))
|
||||
nb_channel = automatic_nch(f_min, f_max, spacing)
|
||||
si = SpectralInformation(pref=Pref(pref, pref, lin2db(nb_channel)))
|
||||
si = si.update(carriers=[
|
||||
Channel(f, (f_min+spacing*f),
|
||||
baud_rate, roll_off, Power(power, 0, 0)) for f in range(1,nb_channel+1)
|
||||
|
||||
Reference in New Issue
Block a user