Web applet and the web contract
Local Flask applet
webapp/ is a single-page Flask + Plotly UI over the runtime, for local
exploration only:
pip install -e ".[web]"
./run.sh # then open http://127.0.0.1:5000
Showcase tables mode: pick a planet, scenario, number of transits and R; get the spectrum with one noisy realization, the template S/N, transit light curves and the slicersim readout diagnostics. Custom planet mode: prefill from a showcase preset, edit the star, planet and atmosphere, run the parametric model; a Derived table reports \(g\), \(H\), \(\mu\) and its source, the temperature clamp, the Vega→AB conversion, the readout used and any residual saturation.
The web contract
Every UI, including the public page on the Lazuli simulators site, drives the model through two small modules so defaults, ranges and messages live in one place:
lazuli_exo.forms.parse()takes the raw form/query strings and returns typed values, fatalerrors(missing magnitude, non-positive radius) and non-fatalwarnings(a value was replaced or clamped; the run proceeds). Blankmumeans chemistry, blanklog_p_cloudmeans clear, blanklog_a_hazemeans no haze.lazuli_exo.forms.to_params()maps the values ontolazuli_exo.simulate();lazuli_exo.forms.from_preset()prefills from a showcase planet and scenario.lazuli_exo.report.summary()turns the resultingSimulatedSpectruminto plain JSON: the arrays to plot,resultscalars,derivedrows (label, value, css class) and the caveat strings.
The Flask endpoints /api/presets, /api/preset and /api/simulate
are a dozen lines each on top of these. Notebook
7. A custom planet, end to end walks through the same path in Python.