Skip to main content

Module real_flight

Module real_flight 

Source
Expand description

Real flights: hpr against the altitude logs of RocketPy’s example rockets, flown in the ERA5 weather of their day (M2.3b, decision ADR-082).

Each RealFlight is a rocket RocketPy’s documentation flies against its team’s log. hpr flies the same rocket (its design under validation/designs/, built from the example’s inputs), on the example’s own thrust file with the example’s burn options, from the example’s rail and site, in the ERA5 file the example reads, with hpr’s own aerodynamics: the way a user would fly it. The log is the reference.

The logs, most of the thrust files and the full weather files carry their own terms, so they are read from the pinned RocketPy checkout under the gitignored refs/ and never committed. What is committed is REPORT_JSON and REPORT_MD: per flight, the log’s apogee and hpr’s, the apogee error, the altitude-trace RMS, and the SHA-256 of every file read. cargo xtask real-flights writes them and --check flies them again; CI, which has no refs/, holds the summary to the rows and the page to the data (RealFlightReport::check_consistent).

What is compared, for each flight:

  • Heights: a barometric altimeter reads the standard atmosphere’s altitude of the pressure it measures, less the pad’s, not the height it climbed: on a warm day, less. So hpr’s height is read the same way, from the ERA5 pressure at its center of mass, for a log whose Altimeter is barometric (Barometer), and taken as it is otherwise. Each log’s height column is used as recorded.
  • Apogee: the highest height in the log, read up to Log::until_s where the recovery’s pressure transients would otherwise set it, against hpr’s apogee read the same way. The error is hpr’s less the log’s, as a percentage of the log’s.
  • Altitude-trace RMS: the log’s heights against hpr’s over the ascent. The two clocks are aligned where each trace first reaches ALIGN_HEIGHT_M, since a log’s zero is its own (armed, launch detected, or power on) and not hpr’s ignition. The RMS is over every log row from there until the first of the two apogees, hpr’s heights linearly interpolated from a GRID_S grid of its dense output. The descent is not compared: its events (which parachute opened, when) are the team’s, and one of these flights lost its main.

Two diagnostic flights, not predictions, say where a miss may come from: the same flight on the example’s own drag, and where the example reshapes its thrust file, on the file as recorded. Where a log keeps its pressure or the flight a satellite altitude, the report holds the barometric reading against them. Each row carries the SHA-256 of its flight’s entry in FLIGHTS, so CI sees an input change the report hasn’t caught up with.

The mean absolute apogee error is reported against the APOGEE_TARGET_PERCENT target of docs/VALIDATION.md; it is a target, not a gate. A flight outside it is an outlier, and each outlier carries its explanation in RealFlight::explanation.

Structs§

Barometer
A barometric altimeter on a pad, in the air of a day: it reads the standard atmosphere’s altitude of the day’s pressure where it is, less that at the pad, H(p(z)) − H(p(z₀)) (Ussa76::pressure_altitude_m).
FileRead
A file read and its SHA-256.
FlightRow
One flight’s result, as the report keeps it.
Gnss
Where a flight’s satellite altitude is and how to read it.
Log
Where a flight’s altitude log is and how to read it.
RealFlight
One logged flight.
RealFlightReport
The real-flight report.
RecordedThrust
The flight on the thrust file as recorded, without the example’s reshape.
Summary
What the report sums up.
TraceComparison
What the trace comparison gives.

Enums§

Altimeter
What a log’s height is.
ExampleDrag
The drag the example flies, as its notebook gives it: the second, diagnostic flight’s.
Explanation
Why a flight’s apogee misses the log’s by more than APOGEE_TARGET_PERCENT: a claim the report’s own numbers are checked against (RealFlightReport::check_consistent), so a change that makes it false fails the check, with the words that argue it.
RealFlightError
Why a real flight could not be read, flown or reported.

Constants§

ALIGN_HEIGHT_M
The height each trace’s clock is aligned at, m above its start.
APOGEE_TARGET_PERCENT
The target for the mean absolute apogee error, per cent (docs/VALIDATION.md, “Principles”).
FLIGHTS
The flights, in the order the report lists them.
GRID_S
The spacing of hpr’s heights the trace is compared against, s.
MASS_FIXTURE
The design fixture that records each example’s own thrust file and burn options.
REPORT_JSON
The report, as data.
REPORT_MD
The report, as a page.
ROCKETPY
The pinned RocketPy checkout the logs, thrust files and weather files are read from.

Functions§

compare_traces
The ascent of hpr (time since ignition, height) against the log’s, each aligned where it first reaches ALIGN_HEIGHT_M, over the log’s rows from there to the first of the two apogees.
fly
Flies one flight and compares it with its log.
parse_log
A log’s rows as (time, height in meters), in file order.
parse_thrust
A thrust file as RocketPy 1.13.0 reads it, with the example’s burn options.
run
Flies every flight in FLIGHTS and builds the report.
summarise
The summary of rows.