Skip to main content

Module ghost

Module ghost 

Source
Expand description

Ghost files: a flight’s logs as time-synced trajectories in a frame at the pad, written as JSON, CZML (Cesium’s scene format) and glTF (an animated 3D scene), for a viewer to replay (M7.2g, ghost files; ADR-313).

The frame. East, north and up in meters from the pad, on WGS 84 (LaunchFrame, which docs/physics/geodesy.md derives from NGA.STND.0036). Time is seconds from the log’s liftoff (timeline::place), so two logs of one flight share a clock. A log with no liftoff stands alone, on its own clock, with Track::synced false.

What is in a track, and how far to trust it. The height comes from the first of these a log has (UpFrom): the log’s own altitude; a column whose zero the log doesn’t state, less its reading on the pad; or its GNSS altitude less the receiver’s on the pad. Not the smoother’s: on a barometer alone it can run far from the log through a sudden swing (6,618 m past the card on RocketPy’s Lince flight, as its recovery fires, where the health card says to go by the reading), and a file for a viewer has no card. East and north come only from GNSS fixes, joined linearly between fixes; a barometer alone gives a straight vertical line, and the file says so. These are a log’s numbers laid out for a viewer, not a reconstruction of the flight: a transonic spike smaller than the screen below stays in a barometer’s height, a receiver’s lag on the climb stays in east and north, and the readings remain the place for an apogee.

Heights screened. A height reached from the last one kept faster than FASTEST_M_S, plus HEIGHT_SCATTER_M, is left out and counted (Track::heights_too_fast): a logger’s last rows can be garbage, as Juno III’s 10,700 m and −2,490 m are. The first height kept is the first that agrees with the middle of the log’s first OPENING_ROWS, so one bad first row can’t shut the flight out. A height more than BELOW_PAD_M under the pad is left out and counted (Track::heights_below_pad): a receiver with no lock can write a height near sea level, as one of Juno III’s does for 3,400 rows. A moment with no height, where the track has heights, is left out and counted, so a track has a height at every moment or at none; a viewer’s line crosses the gap. A clock past CLOCK_LIMIT_S is left out and counted, too.

Fixes screened. A fix is left out, and counted (FixCounts), when it is not a place (out of range, or a receiver’s zero), when its clock doesn’t go forward, when it lies more than REACH_M from the track’s median, or when reaching it from the last fix kept would take more than FASTEST_M_S plus FIX_SCATTER_M, the first fix kept chosen as the first height is.

The formats’ limits. CZML and glTF need a number at every moment, so where a track has no fix yet or no longer it is held at the nearest fix; a track with no height is drawn at 0; a pad of unknown place is drawn at 0°N 0°E (UNKNOWN_PAD), and of unknown height on the ellipsoid; a receiver’s height stands in for a height above the ellipsoid, which is off by the local geoid, within about 110 m (EGM2008); each says so in its own text. CZML needs a date, and logs rarely hold one, so every file uses CZML_EPOCH as liftoff, or as the first moment of a log with no liftoff: the time on its clock is seconds from then, not the day of the flight. glTF stores 32-bit floats and its times can’t be negative, so its clock starts at the earliest moment and its root’s extras give that moment; its numbers stand about 0.06 ms apart at 1,000 s, and about 2 mm apart at 30 km.

Structs§

FixCounts
A track’s GNSS fixes, counted.
Ghost
A flight’s ghost: its logs’ trajectories on one clock in one frame, as the JSON writes it.
Input
A log to lay out, by the name a person knows it by, such as its file’s name.
Pad
The pad: the frame’s origin.
StatedPad
The pad’s place as the caller states it.
Track
One log’s trajectory.

Enums§

GhostError
Why a ghost can’t be made.
PadFrom
Where the pad’s place came from.
UpFrom
Where a track’s height came from.

Constants§

BELOW_PAD_M
The most a height may stand under the pad, m: a landing well down a valley from the pad stays inside it, and a receiver’s height near sea level from a pad on a plateau doesn’t. Rows past it are counted, and the file’s text says so, so a deeper valley shows.
CLOCK_LIMIT_S
The most a clock may read, either way, s: about 317 years. A Unix clock in seconds fits; a garbage row, which would overflow a date, doesn’t.
CZML_EPOCH
What a CZML file calls liftoff, or a first moment; no log’s date (module docs).
FASTEST_M_S
The fastest a track may move between fixes, m/s: above the envelope’s Mach 3.5 at sea level, about 1,190 m/s.
FIX_SCATTER_M
What two fixes may differ by standing still, m: a receiver’s scatter with few satellites.
HEIGHT_SCATTER_M
What two heights may differ by a moment apart, m: a barometer’s step at the worst of its noise.
LONGEST_LOG_S
The longest a log may run from its opening, s: about 116 days. A row past it is a garbage clock.
OPENING_ROWS
How many of a log’s first usable rows find the first one to trust, by their middle value.
PAD_FIXES
How many of the last fixes before liftoff give the pad’s place, by their median.
PAD_HEIGHT_LIMIT_M
The highest or lowest a stated pad may stand, m: past any launch site, and a height a float can still add to and subtract from.
REACH_M
The most a fix may lie from the track’s median, m. A hobby or high-power flight lands well inside it; a receiver’s garbage, such as a longitude with its sign flipped, doesn’t.
UNKNOWN_PAD
Where a pad of unknown place is drawn, degrees and m, in CZML (module docs).

Functions§

build
Lays logs out as one flight’s ghost. With more than one log, each needs a liftoff.