Units & Constants¶
Unit conversion utilities and physical constants used throughout OpenSatCom.
Unit Conversions¶
units
¶
Unit conversion utilities for dB and power domains.
Provides symmetric conversion pairs for power ratios (10 log10), amplitude ratios (20 log10), and absolute power (watts / dBW).
lin_to_db10
¶
Convert a linear power ratio to decibels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
Linear power ratio (must be > 0). |
required |
Returns:
| Type | Description |
|---|---|
float
|
Value in dB: |
Examples:
Source code in src/opensatcom/core/units.py
db10_to_lin
¶
Convert decibels to a linear power ratio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_db
|
float
|
Value in dB. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Linear power ratio: |
Examples:
Source code in src/opensatcom/core/units.py
lin_to_db20
¶
Convert a linear amplitude ratio to decibels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
Linear amplitude ratio (must be > 0). |
required |
Returns:
| Type | Description |
|---|---|
float
|
Value in dB: |
Examples:
Source code in src/opensatcom/core/units.py
db20_to_lin
¶
Convert decibels to a linear amplitude ratio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_db
|
float
|
Value in dB. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Linear amplitude ratio: |
Examples:
Source code in src/opensatcom/core/units.py
w_to_dbw
¶
Convert watts to dBW.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
float
|
Power in watts (must be > 0). |
required |
Returns:
| Type | Description |
|---|---|
float
|
Power in dBW: |
Examples:
Source code in src/opensatcom/core/units.py
dbw_to_w
¶
Convert dBW to watts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dbw
|
float
|
Power in dBW. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Power in watts: |
Examples:
Source code in src/opensatcom/core/units.py
Physical Constants¶
constants
¶
Physical constants used throughout OpenSatCom.
All constants are in SI units.
.. list-table:: Constants :header-rows: 1
-
- Name
- Value
- Unit
-
SPEED_OF_LIGHT_MPS- 299 792 458
- m/s
-
BOLTZMANN_DBW_PER_K_HZ- -228.6
- dBW/(K Hz)
-
EARTH_RADIUS_M- 6 371 000
- m