mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-01 10:38:10 +00:00
docs: random improvements and Sphinxiation
This commit is contained in:
@@ -290,12 +290,12 @@ class Fiber(Node):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def fiber_loss(self):
|
def fiber_loss(self):
|
||||||
# dB fiber loss, not including padding attenuator
|
"""Fiber loss in dB, not including padding attenuator"""
|
||||||
return self.loss_coef * self.length + self.con_in + self.con_out
|
return self.loss_coef * self.length + self.con_in + self.con_out
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def loss(self):
|
def loss(self):
|
||||||
#total loss incluiding padding att_in: useful for polymorphism with roadm loss
|
"""total loss including padding att_in: useful for polymorphism with roadm loss"""
|
||||||
return self.loss_coef * self.length + self.con_in + self.con_out + self.att_in
|
return self.loss_coef * self.length + self.con_in + self.con_out + self.att_in
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -320,8 +320,10 @@ class Fiber(Node):
|
|||||||
|
|
||||||
def carriers(self, loc, attr):
|
def carriers(self, loc, attr):
|
||||||
"""retrieve carriers information
|
"""retrieve carriers information
|
||||||
loc = (in, out) of the class element
|
|
||||||
attr = (ase, nli, signal, total) power information"""
|
:param loc: (in, out) of the class element
|
||||||
|
:param attr: (ase, nli, signal, total) power information
|
||||||
|
"""
|
||||||
if not (loc in ('in', 'out') and attr in ('nli', 'signal', 'total', 'ase')):
|
if not (loc in ('in', 'out') and attr in ('nli', 'signal', 'total', 'ase')):
|
||||||
yield None
|
yield None
|
||||||
return
|
return
|
||||||
@@ -338,11 +340,11 @@ class Fiber(Node):
|
|||||||
yield c.power._asdict().get(attr, None)
|
yield c.power._asdict().get(attr, None)
|
||||||
|
|
||||||
def beta2(self, ref_wavelength=None):
|
def beta2(self, ref_wavelength=None):
|
||||||
""" Returns beta2 from dispersion parameter.
|
"""Returns beta2 from dispersion parameter.
|
||||||
Dispersion is entered in ps/nm/km.
|
Dispersion is entered in ps/nm/km.
|
||||||
Disperion can be a numpy array or a single value. If a
|
Disperion can be a numpy array or a single value.
|
||||||
value ref_wavelength is not entered 1550e-9m will be assumed.
|
|
||||||
ref_wavelength can be a numpy array.
|
:param ref_wavelength: can be a numpy array; default: 1550e-9m
|
||||||
"""
|
"""
|
||||||
# TODO|jla: discuss beta2 as method or attribute
|
# TODO|jla: discuss beta2 as method or attribute
|
||||||
wl = 1550e-9 if ref_wavelength is None else ref_wavelength
|
wl = 1550e-9 if ref_wavelength is None else ref_wavelength
|
||||||
@@ -351,17 +353,15 @@ class Fiber(Node):
|
|||||||
return b2 # s/Hz/m
|
return b2 # s/Hz/m
|
||||||
|
|
||||||
def dbkm_2_lin(self):
|
def dbkm_2_lin(self):
|
||||||
""" calculates the linear loss coefficient
|
"""calculates the linear loss coefficient"""
|
||||||
"""
|
# linear loss coefficient in dB/km^-1
|
||||||
# alpha_pcoef is linear loss coefficient in dB/km^-1
|
|
||||||
# alpha_acoef is linear loss field amplitude coefficient in m^-1
|
|
||||||
alpha_pcoef = self.loss_coef
|
alpha_pcoef = self.loss_coef
|
||||||
|
# linear loss field amplitude coefficient in m^-1
|
||||||
alpha_acoef = alpha_pcoef / (2 * 10 * log10(exp(1)))
|
alpha_acoef = alpha_pcoef / (2 * 10 * log10(exp(1)))
|
||||||
return alpha_pcoef, alpha_acoef
|
return alpha_pcoef, alpha_acoef
|
||||||
|
|
||||||
def _psi(self, carrier, interfering_carrier):
|
def _psi(self, carrier, interfering_carrier):
|
||||||
""" Calculates eq. 123 from arXiv:1209.0394.
|
"""Calculates eq. 123 from `arXiv:1209.0394 <https://arxiv.org/abs/1209.0394>`__"""
|
||||||
"""
|
|
||||||
if carrier.num_chan == interfering_carrier.num_chan: # SCI
|
if carrier.num_chan == interfering_carrier.num_chan: # SCI
|
||||||
psi = arcsinh(0.5 * pi**2 * self.asymptotic_length
|
psi = arcsinh(0.5 * pi**2 * self.asymptotic_length
|
||||||
* abs(self.beta2()) * carrier.baud_rate**2)
|
* abs(self.beta2()) * carrier.baud_rate**2)
|
||||||
@@ -375,8 +375,9 @@ class Fiber(Node):
|
|||||||
return psi
|
return psi
|
||||||
|
|
||||||
def _gn_analytic(self, carrier, *carriers):
|
def _gn_analytic(self, carrier, *carriers):
|
||||||
""" Computes the nonlinear interference power on a single carrier.
|
"""Computes the nonlinear interference power on a single carrier.
|
||||||
The method uses eq. 120 from arXiv:1209.0394.
|
The method uses eq. 120 from `arXiv:1209.0394 <https://arxiv.org/abs/1209.0394>`__.
|
||||||
|
|
||||||
:param carrier: the signal under analysis
|
:param carrier: the signal under analysis
|
||||||
:param carriers: the full WDM comb
|
:param carriers: the full WDM comb
|
||||||
:return: carrier_nli: the amount of nonlinear interference in W on the under analysis
|
:return: carrier_nli: the amount of nonlinear interference in W on the under analysis
|
||||||
@@ -557,8 +558,10 @@ class Edfa(Node):
|
|||||||
|
|
||||||
def carriers(self, loc, attr):
|
def carriers(self, loc, attr):
|
||||||
"""retrieve carriers information
|
"""retrieve carriers information
|
||||||
loc = (in, out) of the class element
|
|
||||||
attr = (ase, nli, signal, total) power information"""
|
:param loc: (in, out) of the class element
|
||||||
|
:param attr: (ase, nli, signal, total) power information
|
||||||
|
"""
|
||||||
if not (loc in ('in', 'out') and attr in ('nli', 'signal', 'total', 'ase')):
|
if not (loc in ('in', 'out') and attr in ('nli', 'signal', 'total', 'ase')):
|
||||||
yield None
|
yield None
|
||||||
return
|
return
|
||||||
@@ -575,7 +578,7 @@ class Edfa(Node):
|
|||||||
yield c.power._asdict().get(attr, None)
|
yield c.power._asdict().get(attr, None)
|
||||||
|
|
||||||
def interpol_params(self, frequencies, pin, baud_rates, pref):
|
def interpol_params(self, frequencies, pin, baud_rates, pref):
|
||||||
"""interpolate SI channel frequencies with the edfa dgt and gain_ripple frquencies from json
|
"""interpolate SI channel frequencies with the edfa dgt and gain_ripple frquencies from JSON
|
||||||
set the edfa class __init__ None parameters :
|
set the edfa class __init__ None parameters :
|
||||||
self.channel_freq, self.nf, self.interpol_dgt and self.interpol_gain_ripple
|
self.channel_freq, self.nf, self.interpol_dgt and self.interpol_gain_ripple
|
||||||
"""
|
"""
|
||||||
@@ -674,7 +677,7 @@ class Edfa(Node):
|
|||||||
return self.interpol_nf_ripple + nf_avg # input VOA = 1 for 1 NF degradation
|
return self.interpol_nf_ripple + nf_avg # input VOA = 1 for 1 NF degradation
|
||||||
|
|
||||||
def noise_profile(self, df):
|
def noise_profile(self, df):
|
||||||
""" noise_profile(bw) computes amplifier ase (W) in signal bw (Hz)
|
"""noise_profile(bw) computes amplifier ase (W) in signal bw (Hz)
|
||||||
noise is calculated at amplifier input
|
noise is calculated at amplifier input
|
||||||
|
|
||||||
:bw: signal bandwidth = baud rate in Hz
|
:bw: signal bandwidth = baud rate in Hz
|
||||||
@@ -829,7 +832,7 @@ class Edfa(Node):
|
|||||||
return g1st - voa + array(self.interpol_dgt) * dgts3
|
return g1st - voa + array(self.interpol_dgt) * dgts3
|
||||||
|
|
||||||
def propagate(self, pref, *carriers):
|
def propagate(self, pref, *carriers):
|
||||||
"""add ase noise to the propagating carriers of SpectralInformation"""
|
"""add ASE noise to the propagating carriers of SpectralInformation"""
|
||||||
pin = array([c.power.signal+c.power.nli+c.power.ase for c in carriers]) # pin in W
|
pin = array([c.power.signal+c.power.nli+c.power.ase for c in carriers]) # pin in W
|
||||||
freq = array([c.frequency for c in carriers])
|
freq = array([c.frequency for c in carriers])
|
||||||
brate = array([c.baud_rate for c in carriers])
|
brate = array([c.baud_rate for c in carriers])
|
||||||
|
|||||||
Reference in New Issue
Block a user