Upgrade colormaps to Crameri scientific palette and fix IGN location map

- Replace RdBu_r with Crameri roma for all 6 relief-family colormaps
  (curvature, mslrm, lrm, tpi, sailore, aniso_open): perceptually
  uniform, CVD-friendly, dark center makes near-zero values visible
- Replace hsv with twilight for aspect: perceptually uniform cyclic
  colormap with no hue discontinuity
- Add cmcrameri dependency (falls back to RdBu_r if unavailable)
- Fix IGN location map: pass min_zoom=8 to download_ign_tiles so zoom
  10 context maps work (was hardcoded to min_zoom=15, blocking the
  loop entirely for zoom_level=10)
- Expand location map context from 3x extent to 80km fixed radius for
  better regional context at zoom 10
- Remove dead code: flow colormap entry, _nice_scale dead loop,
  aspect='auto' in location map imshow, outdated PDF report order list
- Fix SVF docstring: 8 directions → 16 directions
This commit is contained in:
Antoine Jacquin
2026-05-15 11:50:15 +02:00
parent c634db573a
commit 4848f25326
5 changed files with 100 additions and 102 deletions

View File

@ -73,7 +73,7 @@ def _lat_lon_to_px(lat, lon, zoom, tile_size=256):
return px_x, px_y
def download_ign_tiles(min_x, max_x, min_y, max_y, layer, zoom_level=15):
def download_ign_tiles(min_x, max_x, min_y, max_y, layer, zoom_level=15, min_zoom=15):
"""Download IGN WMTS tiles for the given bounds using Web Mercator (PM).
If the first tile returns 404, automatically retries at lower zoom levels.
@ -82,6 +82,7 @@ def download_ign_tiles(min_x, max_x, min_y, max_y, layer, zoom_level=15):
min_x, max_x, min_y, max_y: Bounds in Lambert 93.
layer: IGN WMTS layer name.
zoom_level: WMTS zoom level (default 15).
min_zoom: Lowest zoom level to try when falling back (default 15).
Returns:
numpy array (H, W, 3) uint8, or None on failure.
@ -109,7 +110,6 @@ def download_ign_tiles(min_x, max_x, min_y, max_y, layer, zoom_level=15):
tile_size = 256
# Try downloading at the requested zoom level; fall back to lower zooms on 404
min_zoom = 15
for zoom in range(zoom_level, min_zoom - 1, -1):
col_min, row_min = _lat_lon_to_tile(nw_lat, nw_lon, zoom)
col_max, row_max = _lat_lon_to_tile(se_lat, se_lon, zoom)