Skip to content

Grid Inspector

Austen edited this page Aug 21, 2026 · 8 revisions

Grid Inspector

Browse raw Sirocco spectra by run, inclination, and parameter value before committing to training, inference, or any quantitative fit.


Overview

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.

Availability

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.

Workflow

  1. Select a grid (local directory or hosted dataset ID).
  2. Pick a run by sliding through the lookup table or by setting the parameter dropdowns to the value you want.
  3. Choose an inclination, a wavelength window, and a flux scaling.
  4. Pin any spectra you want to compare against the current one.
  5. (Optional) Upload or select an observation CSV to overlay it on the plot.

Controls

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.

Behind The Scenes

  • 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 bundled CV: 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.

Outputs

  • 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.

Troubleshooting

  • 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 Wavelength and Flux columns. Confirm wavelength units overlap the model spectrum.

References

Clone this wiki locally