Skip to content

Aquamoto: tsunami land/water shading + full-file variable loading#6

Merged
joa-quim merged 5 commits into
masterfrom
aquamoto-shading-wip
Jul 19, 2026
Merged

Aquamoto: tsunami land/water shading + full-file variable loading#6
joa-quim merged 5 commits into
masterfrom
aquamoto-shading-wip

Conversation

@joa-quim

Copy link
Copy Markdown
Member

Summary

  • Tsunami land/water shading for Aquamoto (dry/wet composited RGBA layer, shared hillshade engine, flat 256-colour image on open).
  • Opening a tsunami netCDF now loads every variable the file has (pure _netcdf_subdatasets enumeration, no guessed names) and nests each as its own Scene Objects group under one group named for the file; only the active quantity starts checked.
  • Cleanup pass: no invented variable names/fallback probing, no NaN/isfinite guards or manual extrema scans on data guaranteed clean Float32, concrete Matrix{Float32} signatures instead of where {T<:Real}.

Test plan

  • deps/build.bat — clean build
  • Pkg.test() — 300/300 pass
  • Live GUI check with a real NSWING tsunami netCDF (not exercised this session — no test fixture on hand)

🤖 Generated with Claude Code

joa-quim and others added 5 commits July 18, 2026 17:22
Restore point on branch before further shading work. Current state:
per-side land/water illumination via bakeAquaShade + bakeLayerRGBA base
albedo, radio = shading-target selector, colorbar swap indicator.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- aquamoto.jl: replace all Abstract*/Real/Integer signatures with
  concrete String/Int/Float64/Matrix{T}/Symbol; drop
  Union{Nothing,Array{UInt8,3}} for the cached land image -- use an
  empty Array{UInt8,3} sentinel (isempty test) so imgbat stays one
  concrete type, no per-branch recompilation.
- 40_shading.cpp: bakeLayerRGBA used rgb8 outside its block scope
  (C2065); use the in-scope cr/cg/cb the same values were copied to.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A fresh tsunami now opens showing the flat host-composited colours (the
full 256-colour :polar/:geo image the Julia side generates), Mirone-style.
Hillshade/PBR is opt-in via the Shading dock, never forced on at open --
the grdimage relight saturated the water's steep-gradient normals and
washed the palette toward white/dark, reading as a 2-colour collapse of
an image that is really 256.

The banding was a mismatched colour range, not too few palette entries:
_cpt_nodes_range already resamples to 256 nodes, so index each pixel in.

Also: concrete GMTgrid{Float32,2} for bat, drop useless Float64/Float32
copies of G.z, parenthesise conditions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ts groups

Variable discovery is pure _netcdf_subdatasets enumeration (bathymetry + the
active time-varying quantity + any other static grid the file happens to
carry) -- no hard-coded/guessed names beyond the pre-existing "bathymetry"
convention. Each loaded variable becomes its own Scene Objects group, all
nested under one parent group named for the file (new parentStack nesting
support in rebuildSceneObjects, 50_scene.cpp). Only the active quantity
variable starts checked; bathymetry and any extra grid start hidden
(gmtvtk_set_object_visible, reused from the nested-grid blank-fill path).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…oncrete types

Variable discovery is pure _netcdf_subdatasets enumeration -- dropped the
_AQUA_VARNAMES guessed-name fallback probe entirely and the "prefer stage"
default-variable pick; this file class always has >1 variable so it always
shows up in GDAL's Subdatasets report.

Tsunami grids are guaranteed clean Float32 with no NaNs, so all isnan/isfinite
guards and manual min/max scans are gone: alllo/allhi now come straight from
each layer's own GMTgrid.range (already computed by GMT, never rescanned by
hand), the land colorbar's max elevation reads off bat.range instead of
filtering+scanning the whole array, and the Inf/-Inf dry-layer sentinel is a
plain Bool (wetany) instead of isfinite() checks. Kept the wet/dry split scan
itself (a genuine per-cell comparison against bathymetry, not something any
metadata carries).

_aqua_colorize/_aqua_composite_rgb dropped their `where {T<:Real}` generic
type params for concrete Matrix{Float32} signatures; test file updated to
match (Float32 test data, two NaN-behavior tests removed since that code path
no longer exists).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@joa-quim
joa-quim merged commit 352adb0 into master Jul 19, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant