mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-02 11:07:57 +00:00
Merge "feat: enable different sim_param vectors for multiple requests"
This commit is contained in:
@@ -333,13 +333,31 @@ See ``delta_power_range_db`` for more explaination.
|
||||
| | | from `arXiv:1710.02225 |
|
||||
| | | <https://arxiv.org/abs/1710.02225>`_). |
|
||||
+---------------------------------------------+-----------+---------------------------------------------+
|
||||
| ``nli_params.computed_channels`` | (number) | The channels on which the NLI is |
|
||||
| | | explicitly evaluated. |
|
||||
| ``nli_params.computed_channels`` | (list | Optional. The exact channel indices |
|
||||
| | of | (starting from 1) on which the NLI is |
|
||||
| | numbers) | explicitly evaluated. |
|
||||
| | | The NLI of the other channels is |
|
||||
| | | interpolated using ``numpy.interp``. |
|
||||
| | | In a C-band simulation with 96 channels in |
|
||||
| | | a 50 GHz spacing fix-grid we recommend at |
|
||||
| | | one computed channel every 20 channels. |
|
||||
| | | least one computed channel every 20 |
|
||||
| | | channels. If this option is present, the |
|
||||
| | | next option "computed_number_of_channels" |
|
||||
| | | is ignored. If none of the options are |
|
||||
| | | present, the NLI is computed for all |
|
||||
| | | channels (no interpolation) |
|
||||
+---------------------------------------------+-----------+---------------------------------------------+
|
||||
| ``nli_params.computed_number_of_channels`` | (number) | Optional. The number of channels on which |
|
||||
| | | the NLI is explicitly evaluated. |
|
||||
| | | The channels are |
|
||||
| | | evenly selected between the first and the |
|
||||
| | | last carrier of the current propagated |
|
||||
| | | spectrum. |
|
||||
| | | The NLI of the other channels is |
|
||||
| | | interpolated using ``numpy.interp``. |
|
||||
| | | In a C-band simulation with 96 channels in |
|
||||
| | | a 50 GHz spacing fix-grid we recommend at |
|
||||
| | | least 6 channels. |
|
||||
+---------------------------------------------+-----------+---------------------------------------------+
|
||||
|
||||
Span
|
||||
|
||||
@@ -54,7 +54,7 @@ class RamanParams(Parameters):
|
||||
|
||||
class NLIParams(Parameters):
|
||||
def __init__(self, method='gn_model_analytic', dispersion_tolerance=1, phase_shift_tolerance=0.1,
|
||||
computed_channels=None):
|
||||
computed_channels=None, computed_number_of_channels=None):
|
||||
"""Simulation parameters used within the Nli Solver
|
||||
|
||||
:params method: formula for NLI calculation
|
||||
@@ -66,6 +66,7 @@ class NLIParams(Parameters):
|
||||
self.dispersion_tolerance = dispersion_tolerance
|
||||
self.phase_shift_tolerance = phase_shift_tolerance
|
||||
self.computed_channels = computed_channels
|
||||
self.computed_number_of_channels = computed_number_of_channels
|
||||
|
||||
def to_json(self):
|
||||
return {"method": self.method,
|
||||
|
||||
@@ -305,6 +305,10 @@ class NliSolver:
|
||||
elif 'ggn_spectrally_separated' in sim_params.nli_params.method:
|
||||
if sim_params.nli_params.computed_channels is not None:
|
||||
cut_indices = array(sim_params.nli_params.computed_channels) - 1
|
||||
elif sim_params.nli_params.computed_number_of_channels is not None:
|
||||
nb_ch_computed = sim_params.nli_params.computed_number_of_channels
|
||||
nb_ch = len(spectral_info.channel_number)
|
||||
cut_indices = array([round(i * (nb_ch - 1) / (nb_ch_computed - 1)) for i in range(0, nb_ch_computed)])
|
||||
else:
|
||||
cut_indices = array(spectral_info.channel_number) - 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user