Add total_loss parameter for fiber attenuation (OTDR measurement support)#560
Open
LynchXLQ wants to merge 1 commit into
Open
Add total_loss parameter for fiber attenuation (OTDR measurement support)#560LynchXLQ wants to merge 1 commit into
LynchXLQ wants to merge 1 commit into
Conversation
937b9e9 to
67118a5
Compare
…ation Support OTDR-measured total span loss via new Fiber.total_loss parameter. When provided, it overrides loss_coef with an effective per-km value. - Add total_loss field to Fiber element with validation - Compute effective loss_coef = total_loss / length when total_loss is set - Add tests for total_loss functionality and edge cases - Add author entry to AUTHORS.rst
67118a5 to
45a11e5
Compare
Collaborator
|
Dear @LynchXLQ , thanks a lot for your contribution! We will review it and will give you feedback as soon as possible. We normally use gerrithub for review (https://review.gerrithub.io/q/project:Telecominfraproject/oopt-gnpy). If you are familiar with it please push your commits there. If not I can do it for you, so that we can start the review process. |
Author
|
Thanks @EstherLerouzic! I've pushed the changes to GerritHub: https://review.gerrithub.io/c/Telecominfraproject/oopt-gnpy/+/1231186 Looking forward to your feedback! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for specifying fiber attenuation as total loss (dB) instead of only via
loss_coef(dB/km). This addresses the use case where users have OTDR measurements that report total span loss directly.Resolves #441
Changes
gnpy/core/parameters.py(FiberParams)total_lossas an alternative toloss_coeftotal_lossis provided, deriveloss_coef = total_loss / lengthtotal_loss(dict withvalueandfrequencykeys)loss_coefcontinues to work unchangedasdict()preserves the original parameter (total_lossorloss_coef)gnpy/core/elements.py(Fiber)to_jsonexportstotal_loss/total_loss_per_frequencywhen total_loss was the inputgnpy/tools/yang_convert_utils.py&convert_legacy_yang.pytotal_loss/total_loss_per_frequencyTests
asdict()Usage Example
{ "uid": "fiber-span-1", "type": "Fiber", "params": { "length": 80, "length_units": "km", "total_loss": 16.0, "con_in": 0.5, "con_out": 0.5, "pmd_coef": 1.265e-15 } }cc @jktjkt