[scautoloc] Add location-dependent depth lookup (Slab2 backend)#126
Open
comoglu wants to merge 11 commits into
Open
[scautoloc] Add location-dependent depth lookup (Slab2 backend)#126comoglu wants to merge 11 commits into
comoglu wants to merge 11 commits into
Conversation
Replace fixed locator.defaultDepth and autoloc.maxDepth with a
geographic DepthLookup system compiled directly into scautoloc.
No plugin loader, no Client::Application dependency — safe to use
from standalone code and Python scripts.
Backends (selected via autoloc.depthLookup):
Constant (default) — uses existing defaultDepth/maxDepth config
values unchanged; zero behaviour change for
existing deployments
Slab2 — USGS Slab2.0 depth-footprint contours; depth
and maxDepth vary by geographic location
Config:
autoloc.depthLookup = Constant | Slab2
autoloc.slab2.directory = path to BNA contour files
- Add 531 USGS Slab2.0 depth-contour BNA files (35 depth levels, 27 slab zones) installed to share/scautoloc/slabs/ - Update config.cpp dump() to show depthLookup type and slabDir - Update scautoloc.xml with depthLookup and slab2.directory params
- Fix feature name to match BNA header format: 'zone depth km' - Initialize _depthLookup in constructor to prevent null dereference if init() is bypassed or fails early - Use Environment::absolutePath(configGetString()) for slabDir, consistent with gridConfigFile/staConfFile pattern
Use Environment::shareDir() in catch block so the default slabs path is correctly resolved even when autoloc.slab2.directory is not explicitly configured.
Two bugs fixed: - BNA files had negative vertex counts (-N) which SC's GeoFeature treats as open polygons (closedPolygon=false), making contains() always return false. Changed to positive counts so polygons are loaded as closed and contains() works correctly. - _lookupDepth/_fetchMaxDepth: check all sub-polygons per zone level (some zones have multiple sub-polygons with the same name).
- Rename _dd → dd and _maxDep → maxDep (leading underscore is for class members only, not local variables) - Fix typo: "objects(s)" → "object(s)"
Adds fetchCandidateDepths() to the DepthLookup interface (default wraps
fetch(), returns single depth — existing behaviour unchanged).
Slab2 backend overrides it: inside a slab zone returns {slabDepth,
fallbackDepth} so both the deep slab seed and the shallow crustal seed
are evaluated. Outside all zones returns {fallbackDepth} as before.
_setDefaultDepth() now iterates all candidates and keeps the
best-scoring relocation, enabling correct depth assignment in regions
with dual seismicity (e.g. Tonga: 140 km slab vs 10 km crustal).
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
Adds location-dependent
defaultDepthandmaxDepthto scautoloc via asmall abstract
DepthLookupinterface compiled directly into the binary.Two backends ship:
autoloc.defaultDepth/autoloc.maxDepth. This is the default; existing behaviour is unchanged.(BNA, 27 slab zones, 35 depth levels at 20 km intervals, 000–680 km).
The implementation is intentionally self-contained: no plugin loader, no
Client::Applicationdependency. Safe for standalone use and Python scripts.New config keys
New files
apps/processing/scautoloc/depthlookup.happs/processing/scautoloc/depthlookup.cppapps/processing/scautoloc/share/slabs/Integration points in autoloc.cpp
All
_config.defaultDepthcall sites replaced by_depthLookup->fetch(lat, lon);all
_config.maxDepthchecks replaced by_depthLookup->fetchMaxDepth(lat, lon).Test results (4 pick files, 2026-06-05)
With
Slab2vsConstant:Relationship to seiscomp/common PR #199
SeisComP/common#199 (
Seiscomp::Seismology::DepthLookup) provides anabstract factory interface for other SC modules. This PR is independent —
scautoloc's interface lives in
Seiscomp::Processingand has no dependencyon the common factory system. The two can coexist; a Slab2 plugin for the
common interface can be added separately if desired.