Topobathy fusion#
Blend a topographic DEM with a bathymetric DEM into a single seamless surface. Introduced as Phase-4 backfill P31.
Four blend modes:
max— per-cell maximum (canonical choice when bathy and topo overlap on a coastline and you want the higher of the two).min— per-cell minimum (post-fixup mode used by the four-phase review).topo_above— topo wins above sea-level; bathy fills below.bathy_below— bathy wins below sea-level; topo fills above.
digitalrivers.fusion.topobathy_fusion(topo, bathy, shoreline_elev=0.0, blend='max')
#
Fuse a topographic DEM and a bathymetric DEM into a single hydrographic surface.
Both inputs must be aligned (same shape, geotransform, CRS). The
shoreline is the contour at shoreline_elev (default 0 — mean sea
level).
Blend modes:
"max"(default): per-cell maximum of the two DEMs. Topo wins above the shoreline, bathy below — the canonical conservative choice when the two DEMs disagree across the shoreline (NOAA ETOPO uses this)."min": per-cell minimum — the pessimistic-bathymetry choice for flood inundation studies where you want to assume the deeper of two conflicting surveys."topo_above": pick topo wheretopo >= shoreline_elev, bathy elsewhere. Sharp transition at the shoreline; preferred when the topo DEM is known accurate at the coastline."bathy_below": pick bathy wherebathy <= shoreline_elev, topo elsewhere. Mirror of the above.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
topo
|
Topographic |
required | |
bathy
|
Bathymetric |
required | |
shoreline_elev
|
float
|
Elevation defining the shoreline contour. Default 0.0 (MSL). |
0.0
|
blend
|
str
|
|
'max'
|
Returns:
| Type | Description |
|---|---|
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes mismatch or |
Examples:
-
The
"min"blend picks the cell-by-cell minimum — useful as a pessimistic-bathymetry baseline:import numpy as np from pyramids.dataset import Dataset from digitalrivers.fusion import topobathy_fusion topo = Dataset.create_from_array( ... np.array([[5.0, -1.0]], dtype=np.float32), ... top_left_corner=(0, 0), cell_size=1.0, epsg=4326, ... ) bathy = Dataset.create_from_array( ... np.array([[-3.0, -5.0]], dtype=np.float32), ... top_left_corner=(0, 0), cell_size=1.0, epsg=4326, ... ) fused = topobathy_fusion(topo, bathy, blend="min") fused.read_array().tolist() [[-3.0, -5.0]]
References
Eakins B. W., Grothe P. R. (2014). "Challenges in building coastal digital elevation models." Journal of Coastal Research 30(5).
Source code in src/digitalrivers/fusion.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |