Source code for cubesat_specs._models
"""Dataclass models for satellite form factors, deployers, and launch providers."""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import List, Optional, Tuple
[docs]
@dataclass(frozen=True)
class CenterOfGravityLimits:
"""Acceptable centre-of-gravity offset from the geometric centre.
Values are expressed as *±cm* on each axis.
- CubeSat: per-form-factor limits from CDS Rev 14.1 Table 2.
- PocketQube: ±1 cm on all axes (PQ-Mass-04).
- ``None`` means no specified limit for that axis.
"""
x_pm_cm: Optional[float] = None
"""Max CG offset from geometric centre on X-axis [±cm]."""
y_pm_cm: Optional[float] = None
"""Max CG offset from geometric centre on Y-axis [±cm]."""
z_pm_cm: Optional[float] = None
"""Max CG offset from geometric centre on Z-axis [±cm]."""
[docs]
def within(self, x_cm: float, y_cm: float, z_cm: float) -> bool:
"""Return True if the given CG offset is within all limits."""
if self.x_pm_cm is not None and abs(x_cm) > self.x_pm_cm:
return False
if self.y_pm_cm is not None and abs(y_cm) > self.y_pm_cm:
return False
if self.z_pm_cm is not None and abs(z_cm) > self.z_pm_cm:
return False
return True
[docs]
@dataclass(frozen=True)
class DeployerSpec:
"""Specification for a CubeSat deployment system (P-POD, NRCSD, ISIPOD, …).
.. versionchanged:: 0.2.0
``deployment_velocity_min_ms``, ``deployment_velocity_max_ms``, and
``tip_off_rate_max_deg_s`` are now ``Optional[float]``; many commercial
deployer specs are proprietary and these fields may be ``None``.
"""
name: str
"""Deployer product name."""
provider: str
"""Company or organisation providing the deployer."""
max_units: float
"""Maximum total CubeSat units (U) the deployer can accommodate."""
supported_form_factors: List[str]
"""Form factor keys accepted by this deployer, e.g. ['1U', '2U', '3U']."""
max_payload_mass_kg: float
"""Maximum total payload mass that can be loaded into the deployer [kg]."""
deployment_velocity_min_ms: Optional[float] = None
"""Minimum ejection velocity [m/s] (None = not publicly specified)."""
deployment_velocity_max_ms: Optional[float] = None
"""Maximum ejection velocity [m/s] (None = not publicly specified)."""
tip_off_rate_max_deg_s: Optional[float] = None
"""Maximum tip-off angular rate [deg/s] per axis (None = not publicly specified)."""
mechanism: str = "spring"
"""Ejection mechanism type ('spring', 'pneumatic', 'electromagnetic')."""
inclination_deg: Optional[float] = None
"""Typical orbital inclination [deg] if this deployer is orbit-specific."""
altitude_km_min: Optional[float] = None
"""Typical minimum deployment altitude [km] (None = mission-specific)."""
altitude_km_max: Optional[float] = None
"""Typical maximum deployment altitude [km] (None = mission-specific)."""
notes: str = ""
"""Additional constraints or remarks."""
[docs]
@dataclass
class LaunchProvider:
"""A launch service provider offering CubeSat deployment services."""
name: str
"""Provider name."""
website: str
"""Official website URL."""
deployers: List[DeployerSpec] = field(default_factory=list)
"""Deployer systems offered by this provider."""
notes: str = ""
"""Additional notes."""