ictdesigntools.optical.budget¶
Optical loss budget and optical power budget, using ITU-T terminology.
Terms follow ITU-T G.957 / G.959.1 / G.984.2 and the system-design guidance in G.Sup39:
- Reference points: S (just after the transmitter's optical connector) and R (just before the receiver's); the optical path is everything between them.
- Mean launched power (
P_min..P_max) at S, receiver sensitivity (S_rx, the minimum mean received power) and receiver overload (P_ovl, the maximum) at R. - Attenuation of the optical path, in dB. The attenuation range a system supports is
A_min = P_max - P_ovltoA_max = P_min - S_rx - P_pen - M, withP_penthe maximum optical path penalty andMa margin. - Link (path) attenuation, the worst-case sum for a planned link (G.Sup39):
A = alpha * L + n_s * a_s + n_c * a_c + A_other + M_cwithalphathe fibre attenuation coefficient (dB/km),Lthe length,a_s/a_cthe mean splice and connector attenuations, andM_cthe cable margin.
The defaults below are planning values, not figures from a Recommendation: take the numbers that apply to your fibre, components and equipment from their datasheets. The equipment-class presets are typical figures for GPON classes B+ and C+ (ITU-T G.984.2) and for common Ethernet optics (vendor datasheets); check each against the module actually used.
OpticalError ¶
Bases: ValueError
Raised when optical budget inputs are out of range or inconsistent.
LossInput
dataclass
¶
LossInput(
wavelength_nm: int,
length_km: float = 0.0,
attenuation_db_per_km: float | None = None,
connector_count: int = 0,
connector_loss_db: float | None = None,
splice_count: int = 0,
splice_loss_db: float | None = None,
splitter: str = "none",
other_loss_db: float = 0.0,
margin_db: float = DEFAULT_MARGIN,
budget_db: float | None = None,
fiber: str = "",
)
A planned link. None coefficients and losses take the planning values above.
LossResult
dataclass
¶
PowerInput
dataclass
¶
PowerInput(
preset: str,
launch_power_min_dbm: float,
launch_power_max_dbm: float,
rx_sensitivity_dbm: float,
rx_overload_dbm: float,
path_penalty_db: float = 0.0,
margin_db: float = 0.0,
attenuation_max_db: float | None = None,
attenuation_min_db: float | None = None,
)
Equipment figures at reference points S and R, and the planned path attenuation.
from_preset
classmethod
¶
from_preset(
preset: str, **overrides: float | None
) -> PowerInput
The preset's figures, with any given (not None) values in their place.
Source code in src/ictdesigntools/optical/budget.py
PowerResult
dataclass
¶
PowerResult(inp: PowerInput)
max_attenuation_db
property
¶
max_attenuation_db: float
Largest attenuation the link may have: P_min - S_rx - P_pen - M.
min_attenuation_db
property
¶
min_attenuation_db: float
Smallest attenuation that keeps the receiver out of overload: P_max - P_ovl.
rx_power_min_dbm
property
¶
rx_power_min_dbm: float | None
Lowest mean received power at R: P_min - A_max.
rx_power_max_dbm
property
¶
rx_power_max_dbm: float | None
Highest mean received power at R: P_max - A_min.
check ¶
Return value if it is a finite number from low to high, else raise.