Skip to content

mersadfathizadeh1995/HV_Pro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

84 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HVSR Pro

Professional HVSR Analysis Suite

License: GPL v3 Python 3.8+ PyQt5

A modern, integrated Horizontal-to-Vertical Spectral Ratio (HVSR) analysis suite for seismic site characterization β€” featuring project-based workflows, multi-station batch processing, bedrock depth mapping, HVSR inversion, and publication-quality visualization.

Author: Mersad Fathizadeh β€” Ph.D. Candidate, University of Arkansas
πŸ“§ mersadf@uark.edu Β· GitHub: @mersadfathizadeh1995


Overview

HVSR Pro provides a complete pipeline for HVSR analysis of ambient vibration (microtremor) recordings. From raw seismic data import through spectral ratio computation to bedrock depth estimation and Google Earth export β€” everything is accessible through an interactive GUI, command-line interface, or Python API.

Key Capabilities

Module Description
Standard Analysis Single-station HVSR with interactive windowing, multi-algorithm rejection, and azimuthal processing
Batch Processing Multi-station automated analysis with configurable sensor routing and time-window assignment
Bedrock Mapping Spatial interpolation of bedrock depth from HVSR peak frequencies, with KMZ export to Google Earth
HV Strip Progressive time-frequency analysis with multiple processing engines and a figure studio
HVSR Invert Forward-model inversion of HVSR curves to recover subsurface velocity structure
Project Manager Unified project workflow connecting all modules with persistent state

Visual Tour

πŸ—‚οΈ Project Manager

Create and manage analysis projects. Define stations, assign sensors, and navigate between modules β€” all state is saved and restored automatically.

Project creation dialog

Main application window


πŸ“Š Standard HVSR Analysis

Load seismic data in multiple formats, configure processing settings, and compute HVSR interactively. Supports real-time window rejection, azimuthal processing, and layer-based visualization.

Data loading

HVSR analysis view

Processing settings panel

Azimuthal HVSR processing

πŸ“ˆ Analysis Output Figures (click to expand)

HVSR Pro generates a comprehensive set of publication-quality figures for each analysis:

3-component waveform
Three-component waveform display

Window spectrogram
Window spectrogram with time-frequency content

Pre/post rejection
Pre- and post-rejection HVSR comparison

Raw vs adjusted HVSR
Raw vs. adjusted HVSR curves

Final HVSR curve
Final HVSR curve with peak identification

Statistics panel
Statistical summary β€” mean/median, variability, and quality metrics

Export options Layer management

Export dialog (left) and layer management panel (right)


⚑ Batch Processing

Process multiple stations at once with automatic sensor routing, per-station time-window configuration, and comprehensive statistics. Results are saved to the project and can be reloaded at any time.

Batch processing window

Batch statistics output
Per-station statistics: H/V curve with uncertainty, mean vs. median comparison, variability, and summary


πŸ—ΊοΈ Bedrock Mapping

Compute bedrock depth from HVSR peak frequencies and Vs profiles. Perform spatial interpolation (IDW, Kriging, RBF), generate surface and bedrock contours, and export everything to Google Earth as KMZ.

Bedrock mapping β€” map view

Bedrock mapping β€” station table
Station registry with coordinates, Vs average, f0, depth, and bedrock elevation

Interpolation settings
Interpolation configuration panel

Bedrock contour on map

Surface elevation contour

Google Earth export settings

KMZ output in Google Earth
Contour layers and station markers exported to Google Earth

2D & 3D Visualization

2D visualization 3D visualization

2D cross-section and interactive 3D subsurface model


πŸ“ HV Strip β€” Progressive Analysis

Time-frequency progressive HVSR analysis with multiple processing engines, side-by-side engine comparison, and a dedicated figure studio for creating custom visualizations.

HV Strip main window

Progressive analysis Engine comparison

Progressive analysis (left) and multi-engine comparison (right)

Figure studio
Figure Studio β€” customize and export publication-ready plots


πŸ”¬ HVSR Invert β€” Subsurface Inversion

Forward-model inversion of HVSR curves to estimate subsurface shear-wave velocity profiles. Define layer bounds, run the inversion, and visualize the recovered Vs structure.

HVSR Invert main window

Bound generation Inversion process

Layer bound generation (left) and inversion progress (right)


Installation

Prerequisites

  • Python 3.8 or newer
  • pip (included with Python)

1. Clone the Repository

git clone --recurse-submodules https://github.com/mersadfathizadeh1995/HV_Pro.git
cd HV_Pro/HV_Analyze_Pro

2. Create a Virtual Environment (recommended)

# Windows
python -m venv .venv
.venv\Scripts\activate

# Linux / macOS
python3 -m venv .venv
source .venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

Or install the package in editable mode:

pip install -e .
Core Dependencies
Package Purpose
NumPy Array operations and numerical computation
SciPy Signal processing, spectral analysis
Matplotlib Plotting and visualization
Pandas Tabular data handling
ObsPy Seismic data I/O (MiniSEED, SAC, etc.)
PyQt5 GUI framework
PyQtWebEngine Interactive map display
Folium Leaflet-based station maps
Plotly Interactive 3D visualizations
pyproj Coordinate system transformations
scikit-learn ML-based window rejection
PyYAML Settings persistence
Optional β€” 3D Bedrock Mapping
Package Purpose
PyKrige Kriging interpolation
Shapely Boundary geometry operations
PyVista 3D mesh visualization and export
Pillow Contour image generation

4. Launch the Application

# GUI launcher
python launch_gui.py

# Project Manager (project-based workflow)
python -m hvsr_pro.packages.project_manager.main

# CLI
python -m hvsr_pro.cli --help

Usage

GUI Workflow

python launch_gui.py
  1. Load Data β€” Import seismic recordings (MiniSEED, SAC, GCF, TXT, and more)
  2. Configure β€” Adjust window length, overlap, smoothing, and rejection settings
  3. Process β€” Compute HVSR spectral ratios
  4. Reject β€” Toggle individual windows on/off interactively
  5. Analyze β€” View mean HVSR, peak frequency, amplitude, and quality metrics
  6. Export β€” Save results, plots, and full session files

CLI

# Process a single file
python -m hvsr_pro.cli process data.txt --output results/

# Batch process a directory
python -m hvsr_pro.cli batch input_dir/ --output results/

# Show help
python -m hvsr_pro.cli --help

Python API

from hvsr_pro import HVSRDataHandler, HVSRProcessor, HVSRAnalysis

# Quick analysis
analysis = HVSRAnalysis()
results = analysis.run("data.txt", output_dir="results/")
print(f"Peak frequency: {results.peak_frequency:.2f} Hz")

# Step-by-step
handler = HVSRDataHandler()
data = handler.load_data("data.txt")

processor = HVSRProcessor()
results = processor.process(data)

Project Structure

HV_Pro/
└── HV_Analyze_Pro/
    β”œβ”€β”€ launch_gui.py               # GUI launcher
    β”œβ”€β”€ setup.py                    # Package setup
    β”œβ”€β”€ requirements.txt            # Dependencies
    β”‚
    └── hvsr_pro/                   # Main package
        β”œβ”€β”€ core/                   # Data structures & handling
        β”œβ”€β”€ processing/             # HVSR computation engine
        β”‚   β”œβ”€β”€ hvsr/               #   Spectral ratio algorithms
        β”‚   β”œβ”€β”€ windows/            #   Window management
        β”‚   β”œβ”€β”€ rejection/          #   Multi-algorithm rejection
        β”‚   β”œβ”€β”€ smoothing/          #   Konno-Ohmachi, Parzen, etc.
        β”‚   └── azimuthal/          #   Directional HVSR
        β”œβ”€β”€ visualization/          # Matplotlib plotting tools
        β”œβ”€β”€ gui/                    # PyQt5 application
        β”‚   β”œβ”€β”€ main_window.py      #   Main window
        β”‚   β”œβ”€β”€ tabs/               #   Analysis tab widgets
        β”‚   β”œβ”€β”€ panels/             #   Side panels
        β”‚   β”œβ”€β”€ docks/              #   Dockable widgets
        β”‚   β”œβ”€β”€ dialogs/            #   Dialog windows
        β”‚   └── workers/            #   Background threads
        β”œβ”€β”€ loaders/                # Format-specific readers
        β”œβ”€β”€ config/                 # Settings & session persistence
        β”œβ”€β”€ cli/                    # Command-line interface
        β”œβ”€β”€ api/                    # Programmatic API
        β”‚
        └── packages/               # Integrated sub-packages
            β”œβ”€β”€ project_manager/     #   Project workflow manager
            β”œβ”€β”€ batch_processing/    #   Multi-station batch analysis
            β”œβ”€β”€ bedrock_mapping/     #   Bedrock depth mapping (submodule)
            β”œβ”€β”€ hvstrip-progressive/ #   HV strip analysis (submodule)
            └── invert_hvsr/         #   HVSR inversion (submodule)

Architecture

HVSR Pro follows a layered, modular architecture:

Layer Location Role
Core core/ Data structures, unified data handler, caching
Processing processing/ Windowing, rejection, smoothing, HVSR computation
Visualization visualization/ Matplotlib-based plotting engine
Loaders loaders/ Format-specific readers (MiniSEED, SAC, GCF, TXT, ...)
Config config/ Settings management, validation, session persistence
GUI gui/ PyQt5 application with tabs, docks, and background workers
CLI / API cli/, api/ Non-GUI access to the full pipeline
Packages packages/ Self-contained modules (batch, bedrock, invert, HV strip) connected via the project manager

Supported Seismic Formats

Format Extension Description
MiniSEED .mseed, .miniseed Standard seismological format (via ObsPy)
SAC .sac Seismic Analysis Code format
GCF .gcf Guralp Compressed Format
ASCII/TXT .txt, .dat Column-based time series
SAF .saf Seismic Analysis Format
PEER .at2, .peer PEER ground motion database
MiniShark various MiniShark portable recorder

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m "Add my feature")
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

Acknowledgments

This work was developed under the guidance of Dr. Clinton Wood at the University of Arkansas. Parts of the azimuthal analysis workflow and certain data-input format handling drew inspiration from hvsrpy.


Citation

If you use HVSR Pro in your research, please cite:

Rahimi, M., Wood, C., Fathizadeh, M., & Rahimi, S. (2025). A Multi-method Geophysical Approach for Complex Shallow Landslide Characterization. Annals of Geophysics, 68(3), NS336. https://doi.org/10.4401/ag-9203


License

Copyright (C) 2025 Mersad Fathizadeh

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3.0 as published by the Free Software Foundation.

See the LICENSE file for details.

About

All-in-one HVSR analysis suite: single-station interactive analysis, azimuthal processing, multi-station batch processing, progressive HV Strip, HVSR inversion, and bedrock depth mapping with spatial interpolation and Google Earth export.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors