Add layer masking, profile tool, theme toggle, buffer visualization, and prepare-disp-s1 fixes#23
Open
mgovorcin wants to merge 4 commits intoopera-adt:mainfrom
Open
Add layer masking, profile tool, theme toggle, buffer visualization, and prepare-disp-s1 fixes#23mgovorcin wants to merge 4 commits intoopera-adt:mainfrom
mgovorcin wants to merge 4 commits intoopera-adt:mainfrom
Conversation
…setup-dolphin fixes
## GUI changes
### New components
- **MeasureTool**: click-to-measure polyline tool on the map with cumulative
distance display; toggled from the sidebar footer.
- **ProfileTool**: draw a line/polyline on the map and extract a raster value
profile along it; persistent line while the button is active; draggable
vertex adjustment; profile chart shown/hidden from the sidebar footer.
- **RefPointChart**: floating chart showing time series of all pixels within
the reference-point buffer (median + random samples ± 1σ fill); labels
match the main time-series x-axis timestamps.
- **Histogram**: value-distribution histogram for the current time step,
shown in the sidebar under "Value Distribution".
### Sidebar additions
- **Point Picking ON/OFF** pill (footer) — disables map-click point picking
to prevent conflicts with Measure/Profile tools.
- **Re-referencing ON/OFF** pill (footer) — enables/disables spatial
re-referencing for all datasets and charts.
- **Show/Hide Profile** button (footer) — toggles the profile chart panel.
- **Show/Hide Ref Buffer Chart** button (footer, visible when buffer is ON).
- **Reference Buffer** section — ON/OFF toggle + radius slider; when ON the
median within the radius is used for re-referencing instead of a single
pixel; updates tile shift and time-series simultaneously.
- **Layer Masking** section — replaces fixed coherence/phase-similarity/
inversion-residual sliders with a flexible multi-mask UI: pick any loaded
raster group, choose ≥ or ≤ mode, set a 0–1 normalised threshold (scaled
server-side to the layer's actual data range); add/remove multiple masks
that are combined with AND logic; custom GeoTIFF upload preserved.
- **Colormap panel** — added Grays and Jet options; colormap now persists
per-dataset in localStorage and is restored on dataset switch.
- **Value Distribution** section — inline histogram with p2/p98 and p16/p84
percentile markers.
### Time-series chart improvements
- Multi-point time series with per-point colour-coded lines.
- Legend label colour changed to white for readability.
- Masking thresholds (layer masks) applied to all API calls.
- Reference buffer radius passed to /multi_point for median re-referencing.
- Trend lines and residuals toggleable.
### Map display
- Tile shift (re-referencing) uses buffer median when Reference Buffer is ON.
- Ref values re-fetched automatically when buffer toggle or radius changes,
and on ref-marker drag-end.
- Layer masks sent as JSON to both COG and MD tile endpoints.
## Backend masking
- Replace fixed coherence/phase-similarity/inversion-residual params with a
generic layer_masks list [{dataset, threshold, mode}] in /multi_point,
/buffer_timeseries, InputDependency (COG tiles), XarrayPathDependency (MD).
- Threshold normalised 0–1 and scaled to each layer's actual data range;
per-variable range cached at startup to avoid repeated nanmin/nanmax.
## Reference buffer re-referencing
- _get_ref_median(): computes nanmedian within circular buffer in MD mode;
falls back to single pixel when buffer_m=0 or COG mode.
- Tile shift and time-series both use buffer median when buffer is ON.
- Buffer median re-aligned to full-length index array (NaN for missing steps).
## Float16 / GDAL type-15 support (readers.py)
- RasterReader.from_file: catches KeyError when rasterio does not recognise
the GDAL dtype (Float16 = type 15, new in GDAL 3.7+); falls back to GDAL
directly for shape/transform/nodata, treats dtype as float32.
- RasterReader.bounds: same fallback using rasterio.transform.array_bounds.
## setup-dolphin fixes (cli.py)
- _glob() validates each file is openable (skips truly unreadable files,
includes Float16 files via KeyError catch).
- _glob_first() tries alternate glob patterns in order.
- velocity and Filtered velocity use _glob() instead of bare string literals.
- Groups with empty file_list silently skipped before RasterGroup().
- Temporal coherence and Phase cosine similarity fall back to broader globs
to handle date-range-suffixed filenames (e.g. similarity_20251025_20260117).
## prepare_amplitude CLI command
- New bowser prepare-amplitude command: reads complex SLC GeoTIFFs, computes
20·log10(|z|), writes Cloud-Optimised GeoTIFF (float32, DEFLATE, 512×512).
- -m/--mask option: pre-loads combined_mask.tif once, applies per window.
- -j/--workers option (default 4): parallel processing via ThreadPoolExecutor.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ute thresholds, custom colormaps - ProfileTool: remove redundant hide button; add radius (m) input with buffer corridor polygon on map; backend /profile returns centre/median/samples when radius > 0; chart renders median (bold) + random sample lines (faint) - MapContainer: RadiusCircles component draws dashed L.circle around TS points (bufferRadius) and reference marker (refBufferRadius) when enabled - Theme-aware charts: useThemeVersion() MutationObserver hook triggers useMemo rebuild of chartOptions on data-theme toggle; chart/profile panel backgrounds use var(--sb-surface) instead of hardcoded dark rgba - Colormaps: register cfastie_r / schwarzwald_r / rplumbo_r into rio_tiler's cmap.data *before* titiler imports so Literal validation accepts _r variants; fixes 422 when selecting these colormaps with inverted toggle active - Layer masks: threshold is now absolute (real data units); /dataset_range endpoint returns min/max/p2/p98; slider range and number input show actual values; backend _apply_layer_masks_md and InputDependency pass threshold directly without _scale_threshold normalization - Histogram: ±0 centering button (symmetric around zero) - CSS: mouseposition uses var(--sb-surface) + border for light theme; profile-panel uses var(--sb-surface); profile-radius-input styles added Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… dir input
- _prepare_utils.py: fix S3 path bug — Path.resolve() on s3:// mangles the
double-slash (e.g. s3://bucket → /cwd/s3:/bucket), so the subsequent
.replace('s3://', '/vsis3/') never matched. Now detect s3:// first and
map directly to /vsis3/ without calling resolve(); local paths still go
through resolve() for portability.
TODO: verify /vsis3/ access works with the current AWS credentials/env when
input NetCDF files live in S3 — boto3/GDAL env vars (AWS_PROFILE,
AWS_DEFAULT_REGION) must be set before calling gdal.Translate on /vsis3/ paths.
- _prepare_utils.py: force Float32 output in gdal.Translate — Float64 VRTs
cause titiler to fail PNG tile rendering
- _prepare_utils.py: inline gdal.BuildOverviews() replacing removed
add_overviews() helper import
- _prepare_disp_s1.py: use .resolve() on glob results so VRT paths are
absolute (portable when bowser launched from a different cwd)
- cli.py: prepare-disp-s1 accepts directories as input; globs *.nc inside them
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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
New map tools
Sidebar / UI additions
/dataset_range); replaces fixed coherence/similarity/residual slidersuseThemeVersion()MutationObserver hook rebuilds Chart.js options on switchL.circlerings around TS points and reference marker when buffer is activeBackend
/profile: newradius/n_randomparams; returns{centre, median, samples}for buffer mode/dataset_range/{dataset_name}: min/max/p2/p98 for mask threshold UIlayer_maskslist replaces fixed masking params across tile and time-series endpoints; thresholds are absolute data-unit valuesreaders.py: patch rasteriodtype_fwdfor GDAL 3.12 Float16 (type code 15) at import timeutils.py: register cfastie/rplumbo/schwarzwald_rreversed variants intorio_tiler.cmap.databefore titiler imports — fixes 422 when invert toggle is activeprepare-disp-s1 CLI
Path.resolve()ons3://mangled the double-slash so/vsis3/mapping never matched; S3 inputs now mapped directly withoutresolve()— TODO: verify with a real S3 file that AWS env vars (AWS_PROFILE,AWS_DEFAULT_REGION) are setFloat32ingdal.Translate— Float64 VRTs break PNG tile rendering in titilergdal.BuildOverviews()replacing removedadd_overviews()helper.resolve()for absolute paths (portable across working dirs)*.ncinside themprepare-amplitudecommand: SLC complex GeoTIFF → 20·log10(|z|) Cloud-Optimised GeoTIFFTest plan
prepare-disp-s1with S3 NetCDF —/vsis3/VRT created correctlyCustom masking on-the-fly
