Communications¶
Antenna models¶
- class missiontools.IsotropicAntenna(gain_dbi=0.0)[source]¶
Bases:
AbstractAntennaAntenna with constant gain in all directions.
Since the gain is direction-independent, no mounting information is needed.
- class missiontools.SymmetricAntenna(angles_deg, gains_dbi, **kwargs)[source]¶
Bases:
AbstractAntennaAxially symmetric antenna defined by a gain-vs-angle table.
The radiation pattern is symmetric about the boresight. Gain values are linearly interpolated between the tabulated points.
- Parameters:
angles_deg (
array_like,shape (K,)) – Off-boresight angles (deg). Must be monotonically increasing and span a range within [0, 180].gains_dbi (
array_like,shape (K,)) – Gain at each angle (dBi).**kwargs – Mounting keyword arguments passed to
AbstractAntenna.
- Parameters:
angles_deg (npt.ArrayLike)
gains_dbi (npt.ArrayLike)
Notes
Gain values are linearly interpolated using
numpy.interp, which clamps angles outside the tabulated range to the nearest endpoint value. If the table only covers[0°, 90°], angles beyond 90° will return the gain at 90° rather than a lower back-hemisphere value, which may overstate gain in that region. Extend the table to 180° (e.g. with a low back-lobe gain) to avoid this clamping.- property angles_deg: ndarray[tuple[Any, ...], dtype[floating]]¶
Tabulated off-boresight angles (deg).
- classmethod from_isoflux(altitude_km, min_elev_deg=5.0, edge_gain=None, central_body_radius=6371008.7714, **kwargs)[source]¶
Isoflux antenna pattern for a fixed nadir-pointing orbit altitude.
Shapes the beam so that power flux density at the spherical body surface is constant across the coverage footprint. The gain increases from boresight (nadir) toward the edge of coverage to compensate for the increasing slant range.
- Parameters:
altitude_km (
float) – Orbital altitude above the body surface (km).min_elev_deg (
float, optional) – Minimum surface elevation angle defining the coverage edge (deg). Default 5.0°.edge_gain (
floatorNone, optional) – Desired gain at the edge of coverage (dBi). If None (default), the boresight gain is derived from the constraint that the total antenna directivity equals unity (0 dBi on average), assuming zero radiation beyond the coverage zone.central_body_radius (
float, optional) – Mean radius of the central body (m). Defaults toEARTH_MEAN_RADIUS.**kwargs – Mounting keyword arguments forwarded to
SymmetricAntenna.
- Parameters:
- Return type:
- classmethod from_gaussian(gain_dbi, **kwargs)[source]¶
Ideal Gaussian beam pattern with automatically scaled beamwidth.
The half-power beamwidth is derived from the normalisation condition that total directivity equals gain_dbi (i.e. the Gaussian integral over the full sphere gives the correct peak value).
- Parameters:
gain_dbi (
float) – Peak gain at boresight (dBi).**kwargs – Mounting keyword arguments forwarded to
SymmetricAntenna.
- Parameters:
gain_dbi (float)
- Return type:
- classmethod from_parabolic(diameter, frequency, eff=0.6, envelope=False, **kwargs)[source]¶
Uniformly illuminated parabolic reflector antenna pattern.
- Parameters:
diameter (
float) – Reflector diameter (m).frequency (
float) – Centre frequency (Hz).eff (
float, optional) – Antenna efficiency (dimensionless, 0 < eff ≤ 1). Accounts for spillover, blockage, surface errors, etc. Default 0.6.envelope (
bool, optional) – If False (default), the full pattern including sidelobes is returned. If True, the sidelobe envelope is used: the main lobe is exact and sidelobes beyond the first null are replaced by the asymptotic envelopef_env(u) = 8 / (π · u³)derived from the large-argument approximationJ₁(u) ~ √(2/(πu)) · cos(u − 3π/4).**kwargs – Mounting keyword arguments forwarded to
SymmetricAntenna.
- Parameters:
- Return type:
- classmethod from_s465(diameter, frequency, main_lobe_model=False, gmax_dbi=None, **kwargs)[source]¶
ITU-R S.465 reference Earth station antenna pattern.
- Parameters:
diameter (
float) – Reflector diameter (m).frequency (
float) – Centre frequency (Hz). Valid range per the Recommendation: 2–31 GHz.main_lobe_model (
bool, optional) – If False (default), the canonical ITU-R S.465-6 sidelobe envelope is used; the inner region (0° to φ_min) is completed with a flat plateau at G*_max. If *True, the smooth parabolic main-lobe extension from APEREC013V01 is used, producing a continuous pattern from boresight to 180°.gmax_dbi (
float, optional) – Peak on-axis gain (dBi). When provided, overrides the value computed from diameter and frequency (which assumes η = 0.7). This matches the behaviour of tools such as ANSYS STK that accept *G*_max as a direct input.**kwargs – Mounting keyword arguments forwarded to
SymmetricAntenna.
- Parameters:
- Return type:
References
Link budget¶
- class missiontools.Link(tx, rx, tx_power_dbw, frequency_hz, data_rate_bps, rx_gt_db_k, required_eb_n0_db, implementation_loss_db=2.0, misc_losses_db=0.0, use_p618=True)[source]¶
Bases:
objectRF communication link between two antennas.
Computes link margin at arbitrary times, accounting for free-space path loss, antenna pointing gain, central-body obstruction, and optionally ITU-R P.618 tropospheric attenuation for Spacecraft–GroundStation paths.
- Parameters:
tx (
AbstractAntenna) – Transmit antenna (must be attached to a host).rx (
AbstractAntenna) – Receive antenna (must be attached to a host).tx_power_dbw (
float) – Transmit power (dBW).frequency_hz (
float) – Centre frequency (Hz).data_rate_bps (
float) – Data rate (bit/s).rx_gt_db_k (
float) – Receive system G/T at boresight (dB/K). Off-boresight pointing loss from the rx antenna pattern is applied on top of this value.required_eb_n0_db (
float) – Required Eb/N0 (dB).implementation_loss_db (
float, optional) – Implementation loss (dB). Default 2.misc_losses_db (
float, optional) – Miscellaneous fixed losses (dB). Default 0.use_p618 (
bool, optional) – Whether to apply ITU-R P.618 atmospheric attenuation. Only effective for Spacecraft–GroundStation links. Default True.
- Parameters:
- property tx: AbstractAntenna¶
Transmit antenna.
- property rx: AbstractAntenna¶
Receive antenna.
- link_margin(t, *, availability_pct=99.9)[source]¶
Compute link margin at the given times.
- Parameters:
t (
array_likeofdatetime64[us],shape (N,)orscalar) – Evaluation timestamps.availability_pct (
float, optional) – Link availability target (%) used for ITU-R P.618 atmospheric attenuation. The attenuation not exceeded for this percentage of the time is applied. Default 99.9.
- Returns:
ndarray,shape (N,)orscalar float– Link margin (dB) at each timestamp. Timesteps where the central body blocks the line of sight are returned as NaN.- Parameters:
t (ArrayLike)
availability_pct (float)
- Return type: