Lightcone photometry (SED false-colour imaging), camera/export/flythrough fixes - #38
Merged
Conversation
…through Structure panel: - SED section is now fully independent of the GALAXIES section (own colormap + colourbar state), so changing one no longer mirrors into the other. Both colour the single galaxy layer; last-touched wins. Fixes the bug where SED colormap changes sometimes didn't apply (band switches were resetting a just-picked colormap via the shared state). - SED section gains a Visible checkbox and loads with a band selected + applied instead of a blank dropdown, matching the other sections. - Colourbar limit labels lightened (#6b7280 -> #a3adbb) for legibility. Lightcone camera: - Reset/default view zooms in to fill the viewport width (was fitting the bounding sphere to the shorter axis, leaving the cone a tiny sliver), kept horizontal and centred end to end. - Go-to-centre now stands at the observer (origin) looking outward along the cone, sky spread horizontally, instead of box-centre math. Catalogue export: - Reads a flat cli_lightcone file directly (no Snap_N group), carrying its synthetic-photometry columns through, and adds a "Whole Lightcone" scope (default in Lightcone Mode). Flythrough: - Lightcone first move is distance-scaled to fly at Box Mode's linear speed, so the zoom into the first group is no longer an abrupt swoop.
…cher fixes Photometry (SED) is now a genuinely separate galaxy-splat layer, shown in a dedicated Photometry tab that replaces the Box tab in Lightcone Mode: - Its own Visible/Opacity, fully independent of the galaxies — show it with the galaxies on, off, or on its own. Hidden by default; enabling it hides the normal galaxies by default (and disabling restores them) so the image reads cleanly. - A false-colour image built from a multi-select STACK of filters, each tinted a representative colour by wavelength (u/UV violet, g green, r/i/z + JHK/WISE deepening reds); mass-to-light entries stack alongside. Drawn as nested gaussian shells for splat definition. Galaxies with no flux in the stack are skipped, so no black blobs. Colour-swatch legend. Lightcone camera: - go-to-observer focal point at the cone centre (was ~1 Mpc from the eye), fixing galaxies popping in/out of the clip planes on rotate/pan. - reset/default view zooms to fill the width (cone was a tiny sliver). Flythrough: first-group approach sped up a little in both modes. Catalogue export: reads a flat lightcone file directly (carrying SED columns) + a Whole Lightcone scope. Launcher: ./bin/visage prepends the repo root to PYTHONPATH so it runs this checkout rather than a pip-installed copy, and prints a path/version banner.
…ghtcone Compositing: the stack was normalising each band independently, throwing away the relative flux between bands, so combining filters washed to flat white. Rewritten as a Lupton-style false-colour composite — work in flux, keep the per-galaxy channel ratios (median-balanced, gamma + saturation boosted) as the hue, asinh-stretch the luminance — so galaxies read visibly blue/red/yellow by their real SED shape (~99% of lit pixels now coloured, none near-white). Splats: retuned the photometry shells into a sharply peaked profile (small opaque core inside smaller fainter haloes, outer halo well under Rvir) so each galaxy is a crisp defined point rather than a soft blob. Wizard: the LightSAGE scan step gains a Load Existing Lightcone button that discovers cli_lightcone .h5 files in sage_outputs/lightcone (+ legacy dir + recent session models) and opens one straight into Lightcone Mode — no clone/build/run needed. Removes the now-dead single-scalar SED colour helpers.
…plats The dark spots were a rendering artifact, not the SED grid: ~22% of galaxies are dim-but-drawn, and with flat alpha a dim foreground galaxy painted an opaque dark disk over brighter galaxies behind it. Now each splat's alpha is its own composite brightness, so faint galaxies are transparent (they can't darken anything) while bright ones keep an opaque, defined core — additive blending isn't usable here (VTK point-gaussian emissive only renders at opacity 1.0). Retuned the nested shells tighter/smaller (down to 0.05*Rvir) for a crisper, more defined point per the suggestion. Verified on the real scene plotter (the earlier "RGBA doesn't render" was a test-harness bug that passed the plotter into Scene's primary_par_path slot).
…city + dust options Rendering / composite (Photometry layer): - Every galaxy that has light now renders. ~28% were vanishing because the colour-contrast gamma also crushed the faint end of the luminance below the draw threshold. Hue (gamma + saturation) and brightness (raw luminance, asinh stretch with a floor) are now computed separately, so faint galaxies stay visible while the blue/red/yellow colour spread is unchanged. - Dark spots fixed: each splat's alpha is its own brightness, so a dim foreground galaxy is transparent instead of an opaque dark disk over brighter ones behind it. Nested shells retuned tighter for more definition. SED synthesis (LightSAGE run stage): - Metallicity checkbox (SED_METALLICITY_ENABLED, on): use each galaxy's own mass-weighted stellar Z (MetalsStellarMass/StellarMass); off = solar. - Dust checkbox (SED_DUST_ENABLED, off) + SED_DUST2: Calzetti starburst attenuation that reddens the SEDs. Both also on the visage-sed CLI (--no-metallicity / --dust / --dust2). Verified against real FSPS: dust reddens g-r, the metallicity toggle changes the colours.
The repo pins black 24.10.0 in pre-commit, but the black installed here is
26.5.1, and the two format the one `dedent("""…""")` block in app.py
differently — so a local `black` run and the commit hook kept reformatting
each other's output and every commit aborted with "files were modified by
this hook". (Bumping the pin to 26.5.1 isn't an option: its pytokens native
dep only ships an x86_64 wheel, which crashes the hook on Apple Silicon.)
Fenced that one block with `# fmt: off` / `# fmt: on` (bare directives on
their own lines) so no black version touches it. Both 24.10.0 and 26.5.1 now
leave app.py unchanged, and commits go through without bouncing.
…sical Adds a Draine & Li (2007) dust-emission option that re-emits (energy-balanced, per SSP) the energy the Calzetti attenuation removed. Exposed as an SED_DUST_EMISSION_ENABLED checkbox in the run script (only forwarded when dust attenuation is also on) and a --dust-emission CLI flag, threaded through compute_photometry -> SSPGrid. Verified against real FSPS: with emission on, the far-IR (5-100um) flux of an SSP rises ~170x, so WISE W1-W4 stop being the caveated bands. Docs/comments updated accordingly.
- README Lightcone Mode: add the Photometry tab (false-colour image builder), observer/reset camera behaviour, and Load Existing Lightcone; note the [sed] optional install (FSPS + SPS_HOME). - installation.md: document the optional [sed] extra and its FSPS/SPS_HOME requirement; add fsps/astropy to the dependency table. - navigation.md: note the Box tab becomes Photometry in Lightcone Mode (cross-linked to lightcone.md). - index.md: mention the synthetic-photometry imaging layer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A large batch of Lightcone / synthetic-photometry work.
Photometry (SED) — now a false-colour image builder on its own layer
SED synthesis options (LightSAGE run stage) — metallicity (per-galaxy mass-weighted Z, on), dust (Calzetti attenuation, off), and dust emission (Draine & Li IR re-emission, off — makes WISE physical). Also on the
visage-sedCLI.Lightcone camera — reset zooms in / horizontal / end-to-end; go-to-centre stands at the observer looking outward; fixed galaxies popping in/out on rotate/pan.
Other — Load Existing Lightcone button; catalogue export supports lightcones (Whole Lightcone scope, carries SED columns); lightcone output →
sage_outputs/lightcone/; flythrough first-group approach sped up;./bin/visageruns the checkout (PYTHONPATH) with a version banner; session-model registry prunes dead entries; pinned/fenced black so commits stop bouncing. Docs + CHANGELOG updated throughout.Test plan
pytest— 96 passedruff check/black --checkclean; pre-commit hooks pass