-
Notifications
You must be signed in to change notification settings - Fork 0
Grid Inspector
Browse raw Sirocco spectra by run, inclination, and parameter value before committing to training, inference, or any quantitative fit.
The Grid Inspector is the visual entry point to a Sirocco grid. It exposes
the lookup table, the per-run .spec files, and any observational CSVs
under observation_files/ through a single Altair plot. You can step
through runs, jump to a specific parameter combination, change the
inclination column, crop the wavelength window, switch flux scaling, pin
several runs for side-by-side comparison, and overlay observed spectra.
It works both for verification — confirming that a downloaded dataset is intact and covers your wavelength range — and for exploration, e.g. investigating how a single parameter changes the emergent spectrum across the grid. For a summary of the supported datasets, see Grid Inspector — Available Grids.
| Mode | Data source |
|---|---|
| Local install | Reads extracted spectra from sirocco_grids/<dataset>/. Falls back to fetching a missing lookup table from HuggingFace. |
| HuggingFace Space | Lists all registry-backed CV/AGN production and test grids, streams runNNN.spec.xz archives on demand, and caches them for the current session. |
- Select a grid (local directory or hosted dataset ID).
- Pick a run by sliding through the lookup table or by setting the parameter dropdowns to the value you want.
- Choose an inclination, a wavelength window, and a flux scaling.
- Pin any spectra you want to compare against the current one.
- (Optional) Upload or select an observation CSV to overlay it on the plot.
| Control | Effect |
|---|---|
| Grid selector | Chooses a local grid directory or a hosted dataset ID |
| Run File Index | Slider plus direct integer input for stepping through the lookup table |
| Parameter dropdowns | Jump to the nearest valid run matching the chosen parameter value |
| Inclination Angle | Selects which inclination column to read from the .spec file |
| Wavelength Range | Crops the plotted spectrum (the outermost 10 Å of the raw range are excluded by default) |
| Flux Scale | Toggles between linear, log, and continuum-normalised
|
| Display toggles | Show or hide the current spectrum, pinned spectra, observation overlay, grid lines, Gaussian smoothing (σ = 2), and dimensionless mode |
| Pin Grid Spectrum / Clear All | Adds (run, inclination) to the comparison set, or empties it |
| Observation upload / selector | Loads, replaces, or removes a CSV from observation_files/. Bundled CV:/AGN: demonstrations are shown only for the matching selected grid family; untagged uploads remain available for every grid. |
- Run navigation is driven by the dataset's parameter lookup table. When you change a parameter value via the dropdowns, the inspector filters for runs matching that value and then chooses the candidate that preserves the most of your other current parameter values — a hierarchical match rather than a strict equality search.
- In hosted mode, cached archives are tied to the current dataset and cleared when you switch grids, so one dataset's cache does not leak into another.
- Production and test-grid selections use the same observation-family filter:
CV grids hide bundled
AGN:composites, AGN grids hide bundledCV:spectra, and ordinary uploaded filenames are never filtered out. - Dimensionless Data rescales each plotted trace by its own mean and recenters it. It is intended for shape-only comparisons; absolute flux values are no longer meaningful in that view.
- The optional smoothing toggles a Gaussian filter (
σ = 2) similar to the training workflows so the previewed spectra match the smoothed training inputs.
- An interactive Altair plot containing the current spectrum, any pinned spectra, and an optional observation overlay.
- A live parameter panel showing the run number and its physical parameter values.
-
No local grids appear. Run Model Downloader first to populate
sirocco_grids/. - Lookup table missing locally. The inspector will try to download it from HuggingFace; if that fails, re-run the downloader so the dataset folder is complete.
- Pinned spectra vanish after changing grids. Expected — pin sets are grid-specific.
-
Observation does not appear. The CSV must include
WavelengthandFluxcolumns. Confirm wavelength units overlap the model spectrum.
- Grid Inspector — Available Grids — brief descriptions of the supported CV and AGN grids.
-
speculate_grid_inspector.py— full marimo notebook driving the tool. -
Model Downloader — populate
sirocco_grids/before inspection. - Quick Fit / Inference Tool — fitting paths once the grid checks out.
🚨 Disclaimer: Most documentation has been curated using high-level reasoning LLMs (GPT5.4xHigh/GPT5.5xHigh) analysing the codebase from a human-curated plan prompt. The outputs were verified/audited by other high-level LLMs acting as judges (Claude Opus 4.7 medium/Claude Sonnet 4.6 High). The documentation should therefore, to a high degree, reflect Speculate's operations, but be aware that LLMs can make mistakes!
Speculate Tabs
Development