Skip to main content

Space Trace

Spacetrace is a simple, lightweight, low-abstraction tool for visualizing astrodynamic trajectories. Spacetrace is agnostic of the physics, coordinate systems and the tools to generate the data. It's sole purpose is to plot trajectories and inspect them visually.

This tool should be used similarly to matplotlib's 3d plotting tool, but optimized for interactivity and inspection, as well as drawing large trajectories at a smooth framerate.

Screenshot 1 Screenshot 2

Installation

Spacetrace is a standard python package available on pypi:

pip install spacetrace

Spacetrace only depends on numpy as data interface and pyray for drawing.

Usage

The most basic usecase is as follows:

    import spacetrace

    scene = spacetrace.Scene()
    scene.add_trajectory(epochs, states)
    scene.add_static_body(0, 0, 0, radius=6.7e6, name='Earth', color='blue')
    spacetrace.show_scene(scene)

where states is a numpy array of size N x 3 or N x 6 and epochs is a numpy array of size N, with the corresponding times values. This program will draw the trajectory and add a blue sphere, representing Earth for reference.

For more details see the documentation within the source files (spacetrace/*) or the examples (examples/*)

GUI

  • Middle mouse button to pan camera
  • RMB click to offset camera vertically
  • shift + RMB to offset camera horizontally
  • Drag slider at the bottom to readjust time
  • Left click on entity label (top left) to hide/show
  • Press F while hovering over entity label to focus

Changelog

0.1.1

  • Update readme.md

0.1.2

  • Update how color palette works
  • Older python version should now work (as matched is no longer required)
  • Fixed Color type-hinting input
  • Updated raylib requirement to only support version 5.5 due to recent breaking api change
  • Clamped camera pitch to -pi/2 ... pi/2, preventing rendering glitch

0.2.0

  • Fixed bug of add_trajectory changing the output
  • Added transforms and vectors
  • BREAKING: User is now responsible for object initialization, i.e. add_xxx(...) notation is replaced with more flexible add(Xxx(...))

0.2.1

  • Added new example, illustrating usage of transforms
  • Window only pops up when scene is displayed

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for spacetrace 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spacetrace 0.2.1
File Size Uploaded
spacetrace-0.2.1.tar.gz 125.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spacetrace 0.2.1
File Interpreter ABI Platform
spacetrace-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 139.3 kB

Release files / spacetrace-0.2.1.tar.gz

Download URL spacetrace-0.2.1.tar.gz
Size 125.0 kB
Tags Source
SHA-256 checksum
How to use checksums
84ab472835193738618d9c06e390451f121485033a57541851a6050c407a9be3
BLAKE2b-256 checksum
How to use checksums
f24ffe1db648ef32cece15715e10044613eeb4137e9f3b9e0cd8e64c1fed8cd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.12

Release files / spacetrace-0.2.1-py3-none-any.whl

Download URL spacetrace-0.2.1-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65167bcc98c6a4582127e5e650e01b2879b653ed2b4da5d0a7af0624b53ea379
BLAKE2b-256 checksum
How to use checksums
17a1942d8c1f071bb78b00bace27ed9ad2d53ece99c78a87162faa7f72894759
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page