Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

voa in function: set_egress-amplifier #370

Open
Tobelightbeam opened this issue Nov 9, 2020 · 2 comments
Open

voa in function: set_egress-amplifier #370

Tobelightbeam opened this issue Nov 9, 2020 · 2 comments

Comments

@Tobelightbeam
Copy link

Tobelightbeam commented Nov 9, 2020

In gnpy.core.network, the function set_egress-amplifier is defined to set the parameters of EDFAs.
It sets delta_p or target_gain of an EDFA according to previous node's dp, out_voa and span loss. However, the process to iterate out_voa one by one seems wrong.

To be detailed:
In line 262, voa = node.out_voa if node.out_voa else 0,voa is set as current node's out_voa.
Then, in line 308, set_amplifier_voa(node, power_target, power_mode), current node's out_voa is adjusted.
However, in line 310 - 313, where the current node begins to be transformed into a "previous" node,prev_voa = voa, prev_voa is set as voa, rather than node.out_voa.

It seems that node.out_voa is not passed to prev_voa correctly.

@ojnas
Copy link
Contributor

ojnas commented Nov 9, 2020

The set_amplifier_voa method also updates the current Edfas delta_p to compensate for the voa, which is not reflected in prev_dp = dp. I think these two "errors" cancel each other when the target gain of the next Edfa is calculated, no? But the code definitely is a bit confusing.

@Tobelightbeam
Copy link
Author

hi @ojnas , I got your idea.
It's true that there is a balance between delta_p and out_voa for the set_amplifier_voa method. But prev_dp = node.delta_p and prev_voa = node.out_voa are more direct than prev_dp = dp and prev_voa = voa, I think.
So maybe we can consider to do this to improve readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants