COASTSim: ConOps Astronomical Space Telescope Simulator
A Python module for simulating Concept of Operations (ConOps) for space telescopes and astronomical spacecraft missions.
Overview
COASTSim is a comprehensive simulation framework designed to model and analyze the operational behavior of space-based astronomical observatories. It enables mission planners and engineers to simulate Day-In-The-Life (DITL) scenarios, evaluate spacecraft performance, optimize observation schedules, and validate operational constraints before launch.
The package is organized into logical submodules for better maintainability and clearer separation of concerns: common (utilities), config (configuration), ditl (simulation), schedulers (planning), targets (observations), and simulation (core components).
Key Features
- Spacecraft Bus Simulation: Model power systems, attitude control, and thermal management
- Orbit Propagation: TLE-based ephemeris computation and orbit tracking
- Observation Planning: Target queue management and scheduling algorithms
- Instrument Modeling: Multi-instrument configurations with power and pointing requirements
- Constraint Management: Sun, Moon, Earth limb, and custom geometric constraints
- Power Budget Analysis: Solar panel modeling, battery management, and emergency charging scenarios
- Ground Station Passes: Communication window calculations and data downlink planning
- Attitude Control System: Slew modeling, pointing accuracy, and settle time simulation
- South Atlantic Anomaly (SAA) Avoidance: Radiation belt constraint handling
- DITL Generation: Comprehensive day-in-the-life timeline simulation
- Plan Export: Versioned JSON plans with optional TLE provenance and executed attitude and orbit-state sidecars
Installation
From Source
git clone https://github.com/CosmicFrontierLabs/coast-sim.git
cd coast-sim
pip install -e .
Requirements
- Python >= 3.10
- See
pyproject.tomlfor full dependency list
Key dependencies include:
astropy- Astronomical calculations and coordinate systemsnumpy- Numerical computationsmatplotlib- Visualizationrust-ephem- Efficient ephemeris calculationspydantic- Configuration validationshapely- Geometric operations
Quick Start
Basic DITL Simulation
from datetime import datetime, timedelta
from conops import Config, QueueDITL
from rust_ephem import TLEEphemeris
# Load configuration
config = Config.from_json_file("example_config.json")
# Set simulation period
begin = datetime(2025, 11, 1)
end = begin + timedelta(days=1)
# Compute orbit ephemeris
ephemeris = TLEEphemeris(tle="example.tle", begin=begin, end=end)
# Run DITL simulation
ditl = QueueDITL(config=config)
# Field-of-regard telemetry is optional and disabled by default.
# Enable it only when needed:
# ditl = QueueDITL(config=config, calculate_field_of_regard=True)
ditl.ephem = ephemeris
ditl.begin = begin
ditl.end = end
ditl.calc()
# Export the executed plan. When available, attitude and orbit-state sidecars
# are written beside the plan JSON and linked from it.
plan_path = ditl.plan.save("observation_plan.json")
# Analyze results
ditl.plot()
ditl.print_statistics()
Configuration-Based Approach
Create a JSON configuration file defining your spacecraft parameters:
{
"name": "My Space Telescope",
"spacecraft_bus": {
"power_draw": {
"nominal_power": 50.0,
"peak_power": 300.0
},
"attitude_control": {
"slew_acceleration": 0.01,
"max_slew_rate": 1.0
}
},
"solar_panel": {
"panels": [...]
},
"instruments": {
"instruments": [...]
}
}
Examples
Comprehensive examples are provided in the examples/ directory as Jupyter notebooks:
Example_Spacecraft_DITL.ipynb: Complete spacecraft DITL simulation with custom spacecraft configuration, including power modeling, attitude control, and observation schedulingExample_DITL_from_JSON.ipynb: Simplified workflow using JSON configuration files for quick simulations
To run the examples:
cd examples
jupyter notebook
Visualization
COASTSim includes a set of plotting utilities to visualize DITL simulations and telemetry. Each visualization function accepts an optional config parameter. If omitted, the plots will use ditl.config.visualization if present, or reasonable defaults defined by VisualizationConfig.
Key plotting utilities are in the conops.visualization module:
plot_ditl_telemetry()— show RA, Dec, ACS mode, battery, power, and ObsIDs in a multi-panel timelineplot_data_management_telemetry()— recorder volume/fill fractions, cumulative data generated/downlinked, and alert timelinesplot_acs_mode_distribution()— pie chart of time spent in each ACS mode; supports custom mode colorsplot_ditl_timeline()— full timeline view with orbit numbers, observations, slews, SAA, and eclipsesplot_sky_pointing()— interactive mollweide sky projection showing current pointing, patterns, and constraints
How to customize fonts and colors
Custom visualization settings are controlled via the VisualizationConfig Pydantic model (conops.config.visualization). Important fields include:
font_family(str): font used for titles, labels, and legends (default:Helvetica)title_font_size,label_font_size,legend_font_size,tick_font_size(int)mode_colors(dict[str, str]): color mapping for ACS modes used in plots such asplot_acs_mode_distribution
Example — customizing fonts and colors
from conops import Config, QueueDITL
from conops.visualization import plot_ditl_telemetry, plot_acs_mode_distribution
from datetime import datetime, timedelta
from rust_ephem import TLEEphemeris
cfg = Config.from_json_file("examples/example_config.json")
cfg.visualization.font_family = "Helvetica"
cfg.visualization.title_font_size = 14
cfg.visualization.mode_colors["SAA"] = "#800080" # purple
begin = datetime.utcnow()
end = begin + timedelta(days=1)
ephem = TLEEphemeris(tle="examples/example.tle", begin=begin, end=end)
ditl = QueueDITL(config=cfg)
ditl.ephem = ephem
ditl.calc()
# Render using the resolved visualization config
fig, axes = plot_ditl_telemetry(ditl)
fig2, ax2 = plot_acs_mode_distribution(ditl, config=cfg.visualization)
Tip: Set cfg.visualization to keep consistent fonts and colors across every plot end-to-end. Note that the requested font must be installed on your system; Matplotlib may fallback to another font (e.g., DejaVu Sans or Arial) if the requested family isn't available. To guarantee a specific font, use a FontProperties object with the font file path.
Core Components
Configuration (conops.config)
Pydantic-based configuration management for spacecraft parameters, instruments, and operational constraints.
DITL Simulation (conops.ditl)
Day-In-The-Life simulation classes including DITL, DITLMixin, and QueueDITL for comprehensive timeline simulation.
Instantaneous field-of-regard telemetry (for_solid_angle_sr) is optional and
disabled by default for performance. To enable it, pass
calculate_field_of_regard=True when creating DITL or QueueDITL.
Scheduling (conops.schedulers)
Target observation queue management and intelligent scheduling algorithms (DumbScheduler, DumbQueueScheduler).
Targets (conops.targets)
Target management classes including Pointing, Queue, TargetList, Plan, and PlanEntry for observation planning and portable plan export.
Simulation (conops.simulation)
Core simulation components including ACS (Attitude Control System), slew modeling, SAA handling, emergency charging, and other simulation utilities.
Common Utilities (conops.common)
Shared utilities, enums (ACSMode, ChargeState, ACSCommandType), vector mathematics, and common functions.
Module Structure
conops/
├── __init__.py # Package initialization and exports
├── _version.py # Version information
├── common/ # Shared utilities and common functions
│ ├── __init__.py
│ ├── common.py
│ ├── enums.py
│ └── vector.py
├── config/ # Configuration management
│ ├── __init__.py
│ ├── config.py
│ ├── constants.py
│ ├── constraint.py
│ ├── battery.py
│ ├── solar_panel.py
│ ├── instrument.py
│ └── spacecraft_bus.py
├── ditl/ # Day-In-The-Life simulation
│ ├── __init__.py
│ ├── ditl.py
│ ├── ditl_mixin.py
│ └── queue_ditl.py
├── schedulers/ # Scheduling algorithms
│ ├── __init__.py
│ ├── scheduler.py
│ └── queue_scheduler.py
├── targets/ # Target management and planning
│ ├── __init__.py
│ ├── pointing.py
│ ├── plan.py
│ ├── plan_entry.py
│ └── target_queue.py
└── simulation/ # Core simulation components
├── __init__.py
├── acs.py
├── acs_command.py
├── emergency_charging.py
├── passes.py
├── roll.py
├── saa.py
├── slew.py
└── ephemeris.py
Testing
The project includes a comprehensive test suite:
pytest tests/
The test suite includes a COAST-owned default plan output regression check. Run it directly when reviewing planner/output changes:
python scripts/check_default_plan_output.py
If a planner change intentionally changes the default output, update and review the checked-in baseline:
python scripts/check_default_plan_output.py --update
Run with coverage:
pytest --cov=conops tests/
Documentation
Full API documentation is available in the docs/ directory and can be built using Sphinx.
Building Documentation
Install documentation dependencies:
pip install -e ".[docs]"
Build the HTML documentation:
cd docs
make html
The built documentation will be available in docs/_build/html/index.html.
For more information, see docs/README.md.
Development
Setup Development Environment
pip install -e ".[dev]"
pre-commit install
Code Quality
This project uses:
- ruff: Linting and code formatting
- mypy: Static type checking
- pytest: Testing framework
- pre-commit: Git hooks for code quality
Use Cases
- Mission Planning: Evaluate operational scenarios before launch
- Performance Analysis: Assess power budgets, observation efficiency, and data return
- Schedule Optimization: Test different scheduling algorithms and target prioritization
- Constraint Validation: Verify observational constraints are satisfied
- Trade Studies: Compare different spacecraft configurations and operational strategies
- Operations Training: Simulate realistic mission scenarios for operations teams
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass and code quality checks succeed
- Submit a pull request
License
See LICENSE file for details.
Author
Jamie A. Kennea Email: jak51@psu.edu
Acknowledgments
Developed for space telescope mission planning and operational analysis.
Project Status
Development Status: Production/Stable
For questions, issues, or feature requests, please open an issue on GitHub.
Metadata
Release files for coast-sim 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| coast_sim-0.9.0.tar.gz | 989.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coast_sim-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.1 MB
Release files / coast_sim-0.9.0.tar.gz
| Download URL | coast_sim-0.9.0.tar.gz |
|---|---|
| Size | 989.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43be459bee19d993eeccbe4eec69e40b5435cc61b59712bdd24d0a77183825ed
|
|
BLAKE2b-256 checksum How to use checksums |
dc7aa88a286f14066018710ab27f04926ecbc7e726ad963caf227a550e473074
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / coast_sim-0.9.0-py3-none-any.whl
| Download URL | coast_sim-0.9.0-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d166d36ffbe08cb35ef212c1899690f8de1a7abaf68c02a5f9829f4268671f8
|
|
BLAKE2b-256 checksum How to use checksums |
52cc3ba996854dfccc382a317cdf29d39e62cfd72c70adaf924c44fc1893f118
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log