[ana5] Add extBottomOption to extend the DFA path to the deposit front#1296
Conversation
fso42
left a comment
There was a problem hiding this comment.
Thank you Ivan for your PR. I have 2 comments, one is only minor.
|
Does the new extension need peak flow thickness or is also just flow thickness of the final time step sufficient? the fieldFT variable is initialized with the peak flow thickness and pft has also been added as a required simulation result but later on when used in docstring also referred to as flow thickness field? I guess the peak flow thickness field is needed as otherwise the computation of the lowBand (lowest part of the flow elevation range) is changed |
|
Thanks for the review, Anna. To your question: it is the peak flow thickness (pft). The flow thickness of the final time step could be used to locate the front as well, but I went with pft because it is a default com1DFA output that is always computed, independent of whether the path is built from the particles or from the fields, while the final time step thickness would depend on that choice. The pft also covers the full extent the flow reached, which is what we need to place the front. I also renamed nrows/ncols to nRows/nCols in leastCostPath for camelCase consistency, as you suggested. All points are addressed in 331c543, with replies in the inline threads. |
|
Standardtests ok (apart from known com5) |
…posit front The mass-averaged path ends short of the deposit once the front decelerates, and the existing bottom extension extrapolates a straight line of fixed relative length (factBottomExt * sMax) clipped at the DEM border, independently of where the avalanche actually stopped. This adds extBottomOption = 1: the front of the deposit is located in the peak flow thickness field (flow-thickness-weighted centroid of the flow cells in the lowest part of the flow elevation range, with a lowest-cell fallback for flat deposits) and the path is extended to it along a Dijkstra least-cost path over the DEM, penalizing uphill steps and cells away from the flow footprint. The distance from the flow is computed in meters (distance_transform_edt with sampling=cellsize) so the penalties are resolution independent. Default behaviour is unchanged (extBottomOption = 0); the option is dispatched in extendDFAPath, which gains an optional fieldFT argument, and the pft field is read in generatePathAndSplitpoint only when the option is active. Used for the corridor-scale thalweg extraction on Route 115-CH (Chile), validated there against 208 manually delineated reference thalwegs (median endpoint distance 64 m).
Move the makeSimDF call out of the per-simulation loop in generatePathAndSplitpoint: the peak files are parsed once and the dataframe is passed to readPeakFT, instead of re-reading and re-parsing all peak files for every simulation. Document why findFlowFront needs no divide-by-zero guard on the flow-weight sum.
The least-cost bottom extension uses the peak flow thickness field (pft), so rename fieldFT to fieldPFT and make the docstrings and messages say peak flow thickness consistently. Relabel the option-0 extension as straight-line instead of fixed-length, rename nrows/ncols to nRows/nCols in leastCostPath, and update the docs (the mass-averaged path ends at the last center of mass point; document lowFrontFraction and its default).
331c543 to
8a5fd52
Compare
What this adds
A new option
extBottomOptioninDFAPathGenerationcontrolling how themass-averaged path is extended at the bottom:
extBottomOption = 0(default, unchanged): the current fixed-lengthextrapolation (
extendProfileBottom), which extends the path in thedirection of its last points by
factBottomExt * sMax, clipped at theDEM border.
extBottomOption = 1(new): extend the path to the front of thesimulated deposit.
Motivation
The mass-averaged path ends short of the deposit once the front
decelerates. The default bottom extension extrapolates a straight line of
fixed relative length, independently of where the avalanche actually
stopped, so the path end does not coincide with the simulated runout.
Targeting the deposit front yields a path that ends at the simulated
runout, which is useful for corridor-scale and road-crossing analyses.
How it works
(
pft) as the flow-thickness-weighted centroid of the flow cells in thelowest part of the flow elevation range (
findFlowFront), with alowest-cell fallback for flat deposits and a snap to the deposit when the
centroid falls between disjoint lobes.
over the DEM (
leastCostPath). The cost of a step is its horizontallength plus a penalty on the positive elevation gain and on the distance
from the flow footprint, so the extension descends along the deposit.
Distances use meters (
distance_transform_edtwithsampling=cellsize)so the penalties are resolution independent.
available, the path falls back to the fixed-length extension, so the
AIMEC buffer is preserved.
The option is dispatched in
extendDFAPath(which gains an optionalfieldFTargument, mirroring the existingextTopOption); thepftfieldis read in
generatePathAndSplitpointonly when the option is active. Newparameters live in
DFAPathGenerationCfg.ini(ftThreshold,lowFrontFraction,upSlopePenalty,flowDistPenalty) andresTypegains
pft.Default behaviour
Unchanged. With
extBottomOption = 0(the default) the existing pipelineis not affected.
Tests
Unit tests added for
findFlowFront(front band, flat deposit, two-lobesnap, no flow),
leastCostPath(channel routing, unreachable goal behindnodata),
extendProfileToFront(extension to the front, both fallbacks)and
readPeakFT(lookup by name and by hash, missing field). Docs updatedin
docs/moduleAna5Utils.rst.Context
Developed for the corridor-scale thalweg extraction on Route 115-CH (Chile)
and validated there against 208 manually delineated reference thalwegs
(median endpoint distance 64 m).