Everything you need to create gratings, run simulations, and plot results inside Grax Web.
The active workspace root is {{ workspace_root }}. By default, Grax Web stores data in
.grax-web/ in the current working directory unless you switch the workspace from the home page.
Grax Web keeps all local state under the active workspace directory. The default workspace is
.grax-web/ next to where you launch grax-web.
saved_gratings/One JSON file per saved grating spec.runs/One run directory per simulation, with manifests and CSV outputs.plots/Saved comparison plots and their manifests.previews/Temporary and live preview images shown in the browser.The workspace can be changed from the home page. When you switch workspaces, the app reads and writes future gratings, runs, and plots in the new location.
The grating form uses the same packaged Henke material list that the Python API uses. Pick a material from the dropdown. The density field is prefilled with the built-in default for that element, and you can type a measured density when your sample is a film, porous layer, or otherwise not bulk-like.
xrt-style material objects still work for compatibility during the transition, but Grax will warn that this path is deprecated and will be removed in a future release. For new work, prefer the string material name plus an optional density override.
saved_gratings/<grating-id>.json.After saving, the grating detail page lets you edit the profile, review the preview image, or delete the grating. Saved gratings are the starting point for simulations. The saved JSON now stores each material as a name plus density pair so the same sample can be reconstructed later.
s is TE, p is TM), and any workflow-specific values.
Each run gets its own directory under runs/<run-id>/. The manifest records the workflow, grating
metadata, selected orders, comment, and progress state. The run directory also stores the result CSV files and
generated preview images for that run.
Grating and plane-mirror pages include a schematic side-on view with switchable Beams, Angles, and Lengths indicators. The drawing follows editable fields, highlights the focused dimension, and keeps actual numerical values in labels; geometry is intentionally schematic rather than to scale.
The Multilayer design tab sizes a periodic multilayer coating for a blazed grating in two steps that share one configuration. The incident angle is not an input: every cell gets its own theta search, and the angle that search settles on is what the efficiency is reported at.
(d, blaze) efficiency
heatmap with the optimal-blaze ridge overlaid.
(d, blaze) cases from dropdowns. Two or more designs also get an overlay
comparison plot.
Tick scan the best design over energy automatically when creating the study to chain
step 2 straight off the survey — the plots render as soon as the survey lands and the scan
starts underneath them. Either stage runs in the background with a live progress bar and can
be aborted at any point — aborting stops the running solves immediately and offers to keep or
discard the partial results; what was kept is resumed on the next run. Edit parameters
on a study reopens the same form with its stored values: saving a change that a finished stage
depended on marks that stage stale rather than deleting anything.
Download script writes the study out as a single standalone Python file -- the
parameters as named constants, then both stages behind --survey /
--energy-scan flags (plus --best, --pairs and
--eval) -- to run on a cluster or another machine with only grax installed.
Re-running
the survey marks a finished energy scan stale without deleting it.
multilayer_designs/<id>/study.jsonConfig and per-stage status.survey/survey.csvOne row per surveyed cell.survey/runs/d<d>nm/blaze<b>deg/Each theta search's full output.plots/Headline survey plots and the titled energy-scan plots.energy_scan/Per-design sweep artifacts.The Plane mirror tab computes the specular reflectivity of a single layer, a periodic multilayer or a custom list of any number of layers (add, remove and reorder rows; an empty roughness uses the default) on a flat substrate with the Parratt recursion. It is stateless and instant: the curve updates as you edit the form, and Download CSV saves the current curve. Choose an energy scan at a fixed grazing angle, an angle scan at a fixed energy, or a map of reflectivity versus angle and energy, the polarization (s, p or average) and a default interface roughness; per-layer roughness fields override it.
Saving. Give the mirror a name (and an optional label) and use Save plane mirror
to keep the stack together with the current scan. On a saved mirror, Save scan attaches the
current scan settings under a scan name and label (saving under an existing name overwrites it),
Update mirror stores a changed stack, name or label, and each scan can be renamed, relabelled or
deleted. The Plane mirrors page lists all saved mirrors
and deletes several at once. Saved mirrors live in saved_plane_mirrors/ in the workspace.
Lateral grading varies every layer thickness along the mirror by a scale factor (linear in %/mm, or polynomial coefficients c0, c1, c2… in the position in mm from the mirror centre). The plot then shows the ungraded central curve and the average over sample points along the illuminated footprint length, which is broader and lower because each position reflects a different Bragg energy.
plots/<plot-id>/.The saved plot page reopens the same interactive Plotly figure together with the selected runs and orders, so the comparison styling and the axis modes persist with the saved plot.
plots/.If you want to change the Web UI, these files control the main moving parts:
src/grax/web/app.py: routes, workspace behavior, simulation wiring, and runtime page data.src/grax/web/templates/*.html: page text, layout, and button placement.src/grax/web/static/web.css: styling and responsive layout.src/grax/web/static/web.js: client-side preview, Plotly rendering, and form interactions.src/grax/web/persistence.py: how gratings are stored and reconstructed from JSON.src/grax/web/runs.py: run manifests, result loading, and comparison plot saving.
To change the default workspace folder, edit the create_app() setup in
src/grax/web/app.py. To change the docs itself, edit this template and the matching external docs
notes in docs/index.md and docs/installation/web-ui.md.