English
VertiRF is a standalone open-source toolkit for vertical receiver-function workflows. It supports three VRF methods (decon, corr, stack) with both serial and parallel execution paths.
Chinese
VertiRF 是一个独立开源工具包,面向垂向接收函数(VRF)流程。当前支持三种方法(decon、corr、stack),并提供串行与并行两种执行路径。
- Three methods in one interface:
decon: prompt22-compatible time-iteration deconvolution (single fast engine, legacy-equivalent)corr: prompt22-compatible spectral cross-correlation retrieval (single fast engine, legacy-equivalent)stack: prompt22-compatible peak-window aligned stacking with configurable peak window and optional zero-reference index
- Zero-phase filter options:
gaussianbutterworth_bandpassraised_cosine_bandpasstukey_bandpass
- Parallel batch execution (
--jobs) for all methods. - AI-agent-callable JSON-RPC interface (
vertirf.agent.server). - Engineering dataset/repro benchmark utilities.
VertiRF/
src/vertirf/
station/
catalog/
waveform/
filters/
core/
decon.py
methods.py
agent/
cli.py
tests/
scripts/
examples/
assets/
.github/workflows/
architecture.md
tasks.md
AGENTS.md
cd D:\works_2\VertiRF
python -m pip install -e .[dev]# decon (single fast engine, mode flag not needed)
python -m vertirf.cli run-synthetic --method decon --jobs 2
# corr (single fast engine; mode flag optional)
python -m vertirf.cli run-synthetic \
--method corr --jobs 4 \
--corr-smoothing-bandwidth-hz 0.2 \
--corr-divide-denom true \
--corr-water-level 1e-4 \
--corr-shift-sec 0.0 \
--corr-post-filter-type none
# stack (peak window selectable)
python -m vertirf.cli run-synthetic \
--method stack --mode optimized --jobs 4 \
--stack-peak-window-start-sec -2 \
--stack-peak-window-end-sec 20 \
--stack-zero-index 200On this machine, decon is usually fastest with --jobs 1 for smaller sample sizes and --jobs 2 for larger sample sizes.
# decon (single engine serial vs parallel)
python scripts/benchmark.py \
--out benchmark_summary.json \
--traces 128 --samples 1024 --repeat 2 --jobs 2 --filter-type butterworth_bandpass --allow-negative-impulse
# three-method benchmark
python scripts/method_parallel_benchmark.py \
--out method_parallel_benchmark_summary.json \
--traces 96 --samples 1024 --repeat 2 --jobs 4python scripts/benchmark_decon_legacy_equiv.py \
--out benchmark_decon_legacy_equiv_medium.json \
--traces 120 --samples 2001 --repeat 1 --jobs 1 --itmax 1200 --tshift-sec 10.0This benchmark compares:
legacy_reference: direct prompt22-compatible reconstruction loopoptimized_single_engine: current decon implementation
and reports both numerical equivalence (mae/max_abs/flatten_corrcoef) and speedup.
python scripts/benchmark_corr_legacy_equiv.py \
--out benchmark_corr_legacy_equiv_medium.json \
--traces 120 --samples 2001 --repeat 3 --jobs 1 \
--smooth-hz 0.2 --water-level 1e-4 --shift-sec 0.0 --divide-denom trueThis benchmark compares:
legacy_reference: prompt22-compatible corr retrieval loopoptimized_single_engine: current corr implementation
and reports both numerical equivalence (mae/max_abs/flatten_corrcoef) and speedup.
python scripts/benchmark_stack_legacy_equiv.py \
--out benchmark_stack_legacy_equiv_medium.json \
--traces 160 --samples 2001 --repeat 2 --jobs 4 \
--stack-peak-window-start-sec -10 --stack-peak-window-end-sec 40 --stack-zero-index 200This benchmark compares:
legacy_reference: prompt22-compatible stack reference loopoptimized_single_engine: current vectorized stack implementation
and reports both numerical equivalence (mae/max_abs/flatten_corrcoef) and speedup.
python scripts/check_native_backend.py --out assets/native_backend_status.jsonEnglish
The following figure shows decon/corr/stack results for the same real event case.
Chinese
下图展示同一真实事件案例下 decon/corr/stack 三种方法的结果对比。
Regenerate command:
python scripts/generate_real_case_three_methods_wiggle.py \
--input-dir D:\works_2\seismic_data_retrieval_1\data\prompt19\p14_like_lowpass_t200\convolved_npz \
--stations 20 --component z \
--filter-type butterworth_bandpass --low-hz 0.1 --high-hz 0.8 \
--corr-smoothing-bandwidth-hz 0.25 --corr-post-filter-type gaussian \
--stack-peak-window-start-sec -2 --stack-peak-window-end-sec 20 \
--allow-negative-impulse --time-end-sec 90 \
--out assets/real_case_three_methods_wiggle.pngpython examples/mcp_client_example.pyBuild dataset from existing event NPZ files:
python scripts/build_engineering_dataset.py \
--input-dir D:\works_2\seismic_data_retrieval_1\data\prompt19\p14_like_lowpass_t200\convolved_npz \
--out data/engineering_benchmark/engineering_dataset.npz \
--events 12 --stations 20 --component z --seed 20260303Run reproducible engineering benchmark:
python scripts/run_engineering_repro.py \
--dataset data/engineering_benchmark/engineering_dataset.npz \
--out data/engineering_benchmark/repro_report.json \
--jobs 4 --repeat 1 --filter-type butterworth_bandpass --allow-negative-impulseGitHub Actions workflow: .github/workflows/ci.yml
Pipeline includes:
ruffstyle checkpytest- decon benchmark smoke
- method parallel benchmark smoke
- architecture.md: requirements and technical architecture.
- tasks.md: staged development tasks and acceptance criteria.
- AGENTS.md: AI agent execution rules for this project.


