Export
Every export is generated from Python’s numeric output. None of them is a screenshot of an
interactive view, and none of them is admitted. Each exported artifact carries the method
identifier and the status METHOD_EXECUTED · NOT_ADMITTED where the format allows it.
Python preset
Section titled “Python preset”The Python instrument shows a script for the current ROI. The script is a set of marimo cell
bodies assembled by presets.py from a fixed setup block. The setup binds the sidecar’s manifest
and store paths, and the ROI ring and τ literals:
import marimo as moimport numpy as npfrom pathlib import Pathfrom lunartrace.science import slope_quality as sqfrom lunartrace.workbench import figuresfrom lunartrace.workbench import roi as wroi
site = wroi.load_site(Path("<manifest path>"), Path("<store path>"))ring = wroi.check_ring(RING) # the evaluated ROI ringtaus = TAUS # the selected cutoffsActions:
- Copy copies the script.
- Download .py saves it as
lunartrace-<roi id>-<preset id>.py. - Open in Lab opens the same presets in the Lab (see below).
Presets (GET /presets returns the same list):
| Id | Title | Purpose |
|---|---|---|
roi-rows | Evaluate ROI rows | slope_quality/v1 rows over the ROI mask at each τ (default) |
tau-sweep | Sweep the slope-RMS cutoff | Inclusion fraction over 120 τ values from 0.25 to 30.0 |
slope-vs-rms | Slope against slope RMS | Log-scaled hexbin of slope against slope RMS inside the ROI |
compare-reference | Compare with the source ROIs | Rows for the reference ROIs (v1 closed rule) beside the user ROI (centre-inside rule) |
steep-share | Steep terrain share | Slider (5 to 45 degrees) and the share of included cells steeper than it, per τ |
figure | Make a Figure | Deterministic histogram SVG from the exact rows |
A preset is the body of one cell. Cells share the names mo, np, sq, wroi, figures,
site, ring and taus, so a downloaded script and the Lab notebook load the same Site.
Lab (marimo)
Section titled “Lab (marimo)”The Lab instrument embeds an editable marimo notebook served by the sidecar.
- The sidecar writes the notebook to
build/lab/roi-<first 12 hex of ring SHA-256>.py(the default lab directory) and startsmarimo editon127.0.0.1:4319with a per-process access token. Theurlreturned byPOST /lab/openincludes that token. - The notebook header states the ROI identity, kind and mask rule, and repeats
METHOD_EXECUTED, NOT_ADMITTED. - Because the file name depends only on the ring, a notebook is written once per ring. A later request for the same ring with different presets returns the existing file, and an edited notebook is not overwritten.
- Nothing computed in the Lab is promoted to a Study or admitted.
The Lab runs as a separate local process. If port 4319 is busy, or marimo does not start within 30 seconds, the sidecar returns an error (see Sidecar API).
Figure export
Section titled “Figure export”The Figure instrument produces figures with figures.render, which is deterministic for the
same inputs. Figures contain no creation dates, and the SVG uses a fixed hash salt.
| Control | Options | Notes |
|---|---|---|
| Kind | Histogram, Inclusion, Map | Map is the only kind that uses τ |
| τ cutoff | One of the evaluated τ values | Shown only for Map; if omitted the first τ is used |
| Format | SVG, PNG, PDF | The preview is always SVG; Export uses the chosen format |
The figure stamp reports the method identifier, status, admission, ROI id, kind, cell count, mask rule, source witness, the slope SHA-256 prefix and a line stating that the valid-cell fraction is not lunar area and that τ is a slope-RMS data-quality cutoff.
Export filenames follow lunartrace-<roi id with ':' replaced by '-'>-<kind>.<format>, for
example lunartrace-source-0-histogram.svg. The sidecar sets the same name in the
content-disposition header.
Format details:
- SVG: text is converted to paths (
svg.fonttype: path), the hash salt is fixed, and theDatemetadata is removed. - PNG: rendered at 200 dpi; the
Softwaremetadata is removed. - PDF: rendered at 200 dpi; the creation and modification dates are removed.
Save run (S, or the Save run command) saves the currently evaluated ROI as a local JSON
capsule, then opens the Runs panel. A capsule is only available when the ROI evaluation has
succeeded.
Capsule structure:
{ "kind": "lunartrace.research-capsule", "version": 1, "durability": "local file only; not openBIS, not a Study, not admitted", "id": "run-<first 8 hex of ring SHA-256>-<base-36 timestamp>", "savedAt": "<ISO 8601 time>", "roiId": "<roi id, for example source:0 or user:<12 hex>>", "ring": [[lon, lat], "..."], "taus": [0.5, 2.0, 25.0], "rows": [], "status": "METHOD_EXECUTED", "admission": "NOT_ADMITTED", "provenance": {}}The file is named lunartrace-<run id>.json. In the Runs panel each saved run can be Restored
into the workbench or Downloaded again.
Export CSV in the Rows panel writes one row per τ with the raw Python values. Filename:
lunartrace-<roi id>-rows.csv.
Columns, in order:
| Column | Meaning |
|---|---|
tau | Cutoff τ |
roi_cells | Cells in the ROI mask, including cells with missing values |
valid_slope_cells | ROI cells whose slope is finite and within [0, 90] degrees |
valid_err_cells | ROI cells whose slope RMS is finite and strictly positive |
joint_cells | ROI cells where both are valid |
included_cells | Jointly valid cells with slope RMS ≤ τ |
included_fraction | included_cells / joint_cells; empty when joint_cells is zero |
slope_mean | Mean slope of included cells (degrees); empty when none are included |
| quantile columns | Inverted-CDF quantiles of included slopes at the probabilities 0.05, 0.25, 0.5, 0.75 and 0.95 |
slope_histogram | Counts of included slopes in 45 bins of 2 degrees over [0, 90] |
Values are written raw; display rounding in the table is not applied to the CSV.