Gallery¶
Runnable examples — four producer archetypes and three annotation entities. Each lives under
examples/ and writes a .czml you
can open in any Cesium client — see viewing the output.
Run them from the repository root with the package installed:
python examples/leo_ground_track.py
python examples/geo.py
python examples/skyfield_tle.py # needs Skyfield: pip install skyfield
python examples/lunar_transfer.py
python examples/contacts_mission.py
python examples/maneuver_mission.py
python examples/attitude_mission.py
The images below are rendered with Cesium ion world imagery.
LEO with ground track — from a GMAT ephemeris¶
The flagship interop case: a trajectory GMAT already computed, read from a CCSDS-OEM and converted with the ground track enabled.

from orbit_formats import read
from gmat_czml import to_czml
trajectory = read("examples/data/gmat-leo.oem")
to_czml(trajectory, ground_track=True).save("leo-ground-track.czml")
Source: examples/leo_ground_track.py.
A geostationary orbit — built in code¶
Not every producer is a file reader. This one builds a circular geostationary orbit directly as the canonical schema, proving the schema — not a GMAT file — is the real input contract.

Source: examples/geo.py.
A non-GMAT producer — an ISS TLE via Skyfield¶
A TLE propagated by Skyfield — no GMAT anywhere — through the same one call, ground track included.

Source: examples/skyfield_tle.py.
A lunar transfer — out past the Moon, from GMAT¶
The deep-space case. GMAT targets a full translunar mission — a low-perigee departure, a trans-lunar injection, a powered swing past the Moon, and capture into lunar orbit — and writes it as a four-segment CCSDS-OEM in Earth-centred EME2000. orbit-formats reads the segments as one continuous state series, and the same one call turns the whole eight-day voyage into a scene that reaches past lunar distance.

from orbit_formats import read
from gmat_czml import to_czml
trajectory = read("examples/data/gmat-lunar-transfer.oem")
to_czml(trajectory, playback_seconds=90).save("lunar-transfer.czml")
The scene spans ~400,000 km, so the viewer zooms out until Earth is a bright point and the path
fills the frame; the Moon's gravity shows as the bend where the trajectory swings around and
captures. The trajectory is Earth-centred — gmat-czml renders the geometry GMAT computed, it does
not model the third body — and the ground track is left off, as an Earth-surface projection is
meaningless out at lunar distance. Source:
examples/lunar_transfer.py.
Contacts — ground stations and a windowed line of sight¶
The GMAT LEO again, with two ground stations and the access windows between each station and the satellite. Each observer is placed on the globe, and a line of sight is drawn only while the station can see the spacecraft — so a link appears as the pass begins and clears when it ends.

from orbit_formats import read
from gmat_czml import Contact, GroundStation, to_czml
trajectory = read("examples/data/gmat-leo.oem")
contact = Contact(observer=GroundStation("Station-A", latitude=45.5, longitude=-9.9), target="GmatLeo", windows=windows)
to_czml(trajectory, contacts=[contact], ground_track=True).save("contacts.czml")
The example computes plausible windows by placing each station beneath the satellite at a chosen
instant; a real mission gets them from an access tool. See Contacts. Source:
examples/contacts_mission.py.
Maneuvers — impulsive and finite burns¶
An impulsive burn pinned on the orbit where it happens, and a finite burn drawn as a highlighted arc over the span it fires, each labelled with its Δv.

from orbit_formats import read
from gmat_czml import to_czml
trajectory = read("examples/data/gmat-leo.oem")
to_czml(trajectory, maneuvers=maneuvers).save("maneuvers.czml")
maneuvers is an iterable of orbit-formats Maneuver records, read from a CCSDS OPM / OCM. See
Maneuvers. Source:
examples/maneuver_mission.py.
Attitude — the body axes turning over the orbit¶
A spacecraft attitude history rendered as an animated orientation: the body box turns to the
spacecraft's orientation at each instant as the playhead moves along the orbit.

from orbit_formats import read
from gmat_czml import to_czml
trajectory = read("examples/data/gmat-leo.oem")
attitude = read("spacecraft.aem") # a CCSDS-AEM quaternion history
to_czml(trajectory, attitude=attitude).save("attitude.czml")
The example synthesizes a slow body-Z roll so it stays self-contained; a real mission reads the
quaternion history from an AEM. See Attitude. Source:
examples/attitude_mission.py.
Rendering these images¶
The screenshots and GIF here are produced headlessly by
scripts/render_gallery.py,
which runs the examples, loads each output in the bundled viewer, and captures the frames. The
committed images are what this site embeds, so building the docs never needs a browser.