Protocols¶
Protocol-based interfaces defining the public API contracts for OpenSatCom. All pluggable components implement these protocols.
protocols
¶
Protocol definitions for OpenSatCom public interfaces.
All pluggable components implement these typing.Protocol interfaces.
Use runtime_checkable protocols for isinstance checks at configuration time.
AntennaModel
¶
Bases: Protocol
Interface for antenna gain models.
Implementations must provide gain_dbi (vectorised over angles)
and eirp_dbw (scalar convenience for link budgets).
gain_dbi
¶
Compute antenna gain over an array of directions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
theta_deg
|
ndarray
|
Elevation angles in degrees. |
required |
phi_deg
|
ndarray
|
Azimuth angles in degrees. |
required |
f_hz
|
float
|
Carrier frequency in Hz. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Gain values in dBi, same shape as theta_deg. |
Source code in src/opensatcom/core/protocols.py
eirp_dbw
¶
Compute EIRP toward a specific direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
theta_deg
|
float
|
Elevation angle in degrees. |
required |
phi_deg
|
float
|
Azimuth angle in degrees. |
required |
f_hz
|
float
|
Carrier frequency in Hz. |
required |
tx_power_w
|
float
|
Transmit power in watts. |
required |
Returns:
| Type | Description |
|---|---|
float
|
EIRP in dBW. |
Source code in src/opensatcom/core/protocols.py
PropagationModel
¶
Bases: Protocol
Interface for propagation loss models.
Implementations compute total one-way path loss in dB for a given frequency, geometry, and environmental conditions.
total_path_loss_db
¶
Compute total path loss.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_hz
|
float
|
Carrier frequency in Hz. |
required |
elev_deg
|
float
|
Elevation angle in degrees. |
required |
range_m
|
float
|
Slant range in metres. |
required |
cond
|
PropagationConditions
|
Environmental conditions (rain, climate, availability). |
required |
Returns:
| Type | Description |
|---|---|
float
|
Total path loss in dB (positive value). |
Source code in src/opensatcom/core/protocols.py
PerformanceCurve
¶
Bases: Protocol
Interface for modem performance curves (Eb/N0 vs BLER).
Maps Eb/N0 to block error rate and vice versa for a given ModCod.
bler
¶
Compute BLER at a given Eb/N0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ebn0_db
|
float
|
Energy-per-bit to noise-density ratio in dB. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Block error rate (0.0 to 1.0). |
Source code in src/opensatcom/core/protocols.py
required_ebn0_db
¶
Find the minimum Eb/N0 that achieves the target BLER.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_bler
|
float
|
Desired block error rate threshold. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Required Eb/N0 in dB. |
Source code in src/opensatcom/core/protocols.py
ACMPolicy
¶
Bases: Protocol
Interface for adaptive coding and modulation selection.
Selects the best ModCod for current channel conditions, optionally with hysteresis to prevent rapid switching.
select_modcod
¶
Select a ModCod for the current Eb/N0 and time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ebn0_db
|
float
|
Current Eb/N0 in dB. |
required |
t_s
|
float
|
Current simulation time in seconds. |
required |
Returns:
| Type | Description |
|---|---|
ModCod
|
Selected modulation and coding scheme. |
Source code in src/opensatcom/core/protocols.py
LinkEngine
¶
Bases: Protocol
Interface for link budget evaluation.
Computes a full snapshot link budget from geometry and link parameters.
evaluate_snapshot
¶
Evaluate a snapshot link budget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
elev_deg
|
float
|
Elevation angle in degrees. |
required |
az_deg
|
float
|
Azimuth angle in degrees. |
required |
range_m
|
float
|
Slant range in metres. |
required |
inputs
|
LinkInputs
|
Link configuration (terminals, antennas, propagation, RF chain). |
required |
cond
|
PropagationConditions
|
Environmental conditions. |
required |
Returns:
| Type | Description |
|---|---|
LinkOutputs
|
Complete link budget results. |
Source code in src/opensatcom/core/protocols.py
TrajectoryProvider
¶
Bases: Protocol
Interface for satellite trajectory generation.
Provides time-tagged ECEF states for a satellite over a simulation window.
states_ecef
¶
Generate satellite states over a time window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t0_s
|
float
|
Start time in seconds. |
required |
t1_s
|
float
|
End time in seconds. |
required |
dt_s
|
float
|
Time step in seconds. |
required |
Returns:
| Type | Description |
|---|---|
list of StateECEF
|
Satellite states at each time step. |
Source code in src/opensatcom/core/protocols.py
EnvironmentProvider
¶
Bases: Protocol
Interface for time-varying propagation conditions.
Returns propagation conditions that may vary with time and terminal locations.
conditions
¶
Get propagation conditions at a given time and link geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t_s
|
float
|
Simulation time in seconds. |
required |
terminal_a
|
Terminal
|
First terminal (typically satellite). |
required |
terminal_b
|
Terminal
|
Second terminal (typically ground station). |
required |
Returns:
| Type | Description |
|---|---|
PropagationConditions
|
Environmental conditions at this time step. |