Skip to content
Edit this page

ictdesigntools.optical.components

Optical component grades and limits, from data/components.toml.

  • Connector attenuation grades (IEC 61753-1 / IEC 61755): the most a randomly mated connection may lose, on average and for 97 % of connections.
  • Connector return loss grades: the least return loss a mated connection may have.
  • Splitter limits (ITU-T G.671 branching components): insertion loss per path by split, with reflectance, directivity and uniformity.
>>> grade("C").max_db, grade("C").mean_db
(0.5, 0.25)
>>> return_loss_grade("1").min_db
60
>>> s = splitter(32)
>>> s.max_il_db, s.uniformity_db
(18.6, 5.0)
>>> round(combined_return_loss_db([45, 45]), 2)
41.99

ComponentError

Bases: ValueError

An unknown grade or split.

ReturnLossGrade dataclass

ReturnLossGrade(
    grade: str,
    mode: str,
    min_db: float,
    source: str,
    unmated_min_db: float = 0.0,
)

reflectance_db property

reflectance_db: float

The same limit as a reflectance: the most a mated connection may reflect.

Splitter dataclass

Splitter(
    inputs: int,
    outputs: int,
    min_il_db: float,
    max_il_db: float,
    source: str,
)

uniformity_db property

uniformity_db: float

The most the loss may differ between output paths.

ideal_loss_db property

ideal_loss_db: float

The loss of an even split with no excess loss, from any input to one output: 10·log10(outputs).

grade

grade(name: str) -> AttenuationGrade

An attenuation grade: B, C or D for single-mode, Bm or Cm for multimode.

Source code in src/ictdesigntools/optical/components.py
def grade(name: str) -> AttenuationGrade:
    """An attenuation grade: B, C or D for single-mode, Bm or Cm for multimode."""
    found = _grades().get(name.strip().lower())
    if found is None:
        known = ", ".join(g.grade for g in _grades().values())
        raise ComponentError(f"“{name}” is not a defined attenuation grade (use {known}).")
    return found

return_loss_grade

return_loss_grade(name: str) -> ReturnLossGrade

A return loss grade: 1 to 4 for single-mode, 2m for multimode.

Source code in src/ictdesigntools/optical/components.py
def return_loss_grade(name: str) -> ReturnLossGrade:
    """A return loss grade: 1 to 4 for single-mode, 2m for multimode."""
    found = _rl_grades().get(str(name).strip().lower())
    if found is None:
        known = ", ".join(g.grade for g in _rl_grades().values())
        raise ComponentError(f"“{name}” is not a defined return loss grade (use {known}).")
    return found

splitter

splitter(outputs: int, inputs: int = 1) -> Splitter

The G.671 limits for an inputs × outputs splitter.

Source code in src/ictdesigntools/optical/components.py
def splitter(outputs: int, inputs: int = 1) -> Splitter:
    """The G.671 limits for an ``inputs`` × ``outputs`` splitter."""
    found = _splitters().get((inputs, outputs))
    if found is None:
        known = ", ".join(s.slug for s in _splitters().values())
        raise ComponentError(f"G.671 sets no limits for a {inputs}x{outputs} splitter "
                             f"(it covers {known}).")  # fmt: skip
    return found

combined_return_loss_db

combined_return_loss_db(return_losses_db) -> float

The return loss of several reflections seen together, adding their powers and ignoring the loss between them (the worst case): -10·log10(Σ 10^(-RL/10)).

Source code in src/ictdesigntools/optical/components.py
def combined_return_loss_db(return_losses_db) -> float:
    """The return loss of several reflections seen together, adding their powers and ignoring
    the loss between them (the worst case): ``-10·log10(Σ 10^(-RL/10))``."""
    total = sum(10 ** (-rl / 10) for rl in return_losses_db)
    if total == 0:
        raise ComponentError("Give at least one return loss.")
    return -10 * math.log10(total)