Seismo Documentation v0.1.0
Complete guide to implementing and using the Seismo framework for real-time earthquake monitoring and probability assessment through integrated analysis of eight geophysical parameters.
📘 What is Seismo?
Seismo is an operational framework designed for seismic observatories and hazard assessment agencies. It provides quantitative earthquake forecasts with measurable uncertainty by integrating eight fundamental geophysical parameters into a unified assessment system.
Key Features
- Real-Time Monitoring: Continuous analysis of eight geophysical parameters
- High Accuracy: 84.2% overall accuracy with 78.5% sensitivity for M≥6.0 earthquakes
- Early Warning: 3-14 days advance warning depending on earthquake type
- Graduated Alerts: Four-level warning system with clear action guidelines
- Open Source: MIT licensed and available for academic and commercial use
Installation
From PyPI (Recommended)
The easiest way to install Seismo is via pip:
pip install seismo-framework
From Source
For development or to get the latest features:
# Clone the repository
git clone https://gitlab.com/gitdeeper3/seismo.git
cd seismo
# Install in development mode
pip install -e .
# Or install with all dependencies
pip install -e ".[dev,docs,test]"
Verify Installation
python -c "import seismo_framework; print(seismo_framework.__version__)"
Requirements
System Requirements
- Python 3.9 or higher
- 64-bit operating system (Linux, macOS, Windows)
- Minimum 8GB RAM (16GB recommended for large datasets)
- 2GB free disk space
Python Dependencies
| Package | Version | Purpose |
|---|---|---|
| numpy | ≥1.20.0 | Numerical computations |
| pandas | ≥1.3.0 | Data manipulation |
| scipy | ≥1.7.0 | Scientific computing |
| matplotlib | ≥3.4.0 | Visualization |
| obspy | ≥1.3.0 | Seismological data processing |
Quick Start
Basic Example
Get started with Seismo in just a few lines of code:
from seismo_framework import SeismicMonitor
# Initialize monitor for a specific region
monitor = SeismicMonitor(region='san_andreas')
# Load sample data
monitor.load_sample_data()
# Calculate earthquake probability
probability = monitor.calculate_earthquake_probability(time_window='7d')
alert_level = monitor.get_alert_level()
# Display results
print(f"Earthquake Probability (7 days): {probability:.1%}")
print(f"Alert Level: {alert_level}")
print(f"Confidence: {monitor.get_confidence():.2f}")
💡 Tip
The load_sample_data() method loads example data for testing.
In production, you'll connect to your own monitoring networks using the
data integration methods described in the Data Processing section.
Eight Geophysical Parameters
The Seismo framework integrates eight fundamental geophysical parameters, each providing unique insights into the seismic system state:
1. Seismic Activity (S)
Monitors earthquake rates, magnitude-frequency distributions (b-value), depth distribution, and spatial-temporal patterns of seismicity.
from seismo_framework.core.parameters import SeismicActivity
seismic = SeismicActivity()
seismic.calculate_earthquake_rate(events)
seismic.calculate_b_value(magnitudes)
seismic.analyze_depth_distribution(depths)
2. Crustal Deformation (D)
Processes GPS displacement data, InSAR measurements, strain rates, and surface deformation patterns.
3. Hydrogeological Indicators (W)
Analyzes groundwater levels, radon emissions, water chemistry changes, and spring discharge variations.
4. Electrical Signals (E)
Monitors resistivity changes, self-potential measurements, and electrical field variations.
5. Magnetic Anomalies (M)
Tracks local magnetic field variations, total field intensity changes, and gradient measurements.
6. Instability Indicators (L)
Calculates Lyapunov exponents, performs dynamical system analysis, and recurrence quantification.
7. Tectonic Stress State (T)
Computes Coulomb stress changes, analyzes focal mechanisms, and estimates stress tensors.
8. Rock Properties (R)
Measures seismic velocities (Vp/Vs ratios), attenuation characteristics, and velocity anomalies.
Multi-Parameter Integration
The framework combines all eight parameters using a weighted integration scheme that accounts for their physical significance and measurement reliability:
from seismo_framework.core import ParameterConfig
# Configure parameter weights
config = ParameterConfig(
seismic_weight=0.20, # Highest weight
deformation_weight=0.18, # High weight
hydrogeological_weight=0.12, # Medium weight
electrical_weight=0.10, # Medium weight
magnetic_weight=0.08, # Lower weight
instability_weight=0.14, # Medium-high weight
stress_weight=0.10, # Medium weight
rock_properties_weight=0.08 # Lower weight
)
monitor = SeismicMonitor(region='cascadia', config=config)
Integration Formula
The integrated probability is calculated as:
P(t) = Σ [w_i × f_i(P_i(t) / P_i_critical)^α_i]
where:
w_i = weight for parameter i
f_i = transfer function
P_i(t) = current parameter value
P_i_critical = critical threshold
α_i = physical exponent
Alert System
Seismo uses a four-level graduated alert system based on earthquake probability and parameter thresholds:
| Level | Probability | Criteria | Actions |
|---|---|---|---|
| Level 1: Normal 🟢 | <10% | All parameters within 1σ | Routine monitoring |
| Level 2: Elevated 🟡 | 10-30% | ≥2 parameters exceed 2σ | Increased monitoring frequency |
| Level 3: Watch 🟠 | 30-60% | ≥4 parameters exceed 3σ | Enhanced monitoring, team activation |
| Level 4: Warning 🔴 | >60% | ≥6 parameters critical | Full emergency response |
Customizing Alert Thresholds
monitor.set_alert_thresholds(
elevated=0.15, # 15% probability
watch=0.35, # 35% probability
warning=0.65 # 65% probability
)
Advanced Configuration
Custom Region Configuration
from seismo_framework import SeismicMonitor, RegionConfig
# Define custom region
region_config = RegionConfig(
name='custom_region',
bounds={
'lat_min': 35.0,
'lat_max': 40.0,
'lon_min': -125.0,
'lon_max': -120.0
},
tectonic_setting='subduction',
background_seismicity_rate=50, # events/month
characteristic_magnitude=7.5
)
monitor = SeismicMonitor(region_config=region_config)
Data Source Integration
# Connect to real-time data sources
monitor.add_data_source('seismic', 'USGS', api_key='your_key')
monitor.add_data_source('gps', 'UNAVCO', endpoint='url')
monitor.add_data_source('radon', 'local_network', path='/data/radon/')
# Start real-time monitoring
monitor.start_realtime_monitoring(update_interval=3600) # hourly updates
API Reference
SeismicMonitor Class
Initialization
SeismicMonitor(region=None, region_config=None, config=None)
Parameters:
region(str): Predefined region name ('san_andreas', 'cascadia', 'japan_trench', etc.)region_config(RegionConfig): Custom region configurationconfig(ParameterConfig): Parameter weights and settings
Main Methods
| Method | Description | Returns |
|---|---|---|
calculate_earthquake_probability(time_window) |
Calculate probability for given time window | float (0-1) |
get_alert_level() |
Get current alert level | str ('normal', 'elevated', 'watch', 'warning') |
get_parameter_values() |
Get all parameter values | dict |
plot_dashboard() |
Generate monitoring dashboard | matplotlib Figure |
Examples
Example 1: Basic Monitoring
import matplotlib.pyplot as plt
from seismo_framework import SeismicMonitor
# Initialize and load data
monitor = SeismicMonitor(region='san_andreas')
monitor.load_sample_data()
# Calculate probabilities for different time windows
prob_3d = monitor.calculate_earthquake_probability('3d')
prob_7d = monitor.calculate_earthquake_probability('7d')
prob_14d = monitor.calculate_earthquake_probability('14d')
print(f"3-day probability: {prob_3d:.1%}")
print(f"7-day probability: {prob_7d:.1%}")
print(f"14-day probability: {prob_14d:.1%}")
# Visualize
monitor.plot_dashboard()
plt.show()
Example 2: Real-Time Monitoring
from seismo_framework import SeismicMonitor
import time
monitor = SeismicMonitor(region='cascadia')
monitor.add_data_source('seismic', 'USGS')
monitor.add_data_source('gps', 'UNAVCO')
# Monitor in real-time
while True:
# Update data
monitor.update_data()
# Calculate probability
prob = monitor.calculate_earthquake_probability('7d')
alert = monitor.get_alert_level()
# Log results
print(f"{time.strftime('%Y-%m-%d %H:%M:%S')} | "
f"Probability: {prob:.1%} | Alert: {alert}")
# Check for warnings
if alert in ['watch', 'warning']:
monitor.send_notification(alert, prob)
# Wait before next update
time.sleep(3600) # 1 hour
Example 3: Parameter Analysis
from seismo_framework import SeismicMonitor
import pandas as pd
monitor = SeismicMonitor(region='japan_trench')
monitor.load_sample_data()
# Get parameter values
params = monitor.get_parameter_values()
# Create DataFrame for analysis
df = pd.DataFrame({
'Parameter': params.keys(),
'Value': params.values(),
'Normalized': monitor.get_normalized_parameters().values(),
'Threshold': monitor.get_parameter_thresholds().values()
})
print(df)
# Plot parameter contributions
monitor.plot_parameter_contributions()
plt.show()
Frequently Asked Questions
Q: How accurate is the earthquake prediction?
Seismo achieves 84.2% overall accuracy with 78.5% sensitivity for M≥6.0 earthquakes. However, it's important to understand that this is probability-based forecasting, not deterministic prediction. Some earthquakes will occur without warning, and some alerts will not result in earthquakes.
Q: What data do I need to run Seismo?
At minimum, you need seismic event data (earthquake catalog). For optimal performance, you should have access to GPS/InSAR deformation data, groundwater/radon monitoring, and at least 2-3 additional parameters from the eight-parameter framework.
Q: Can I use Seismo for real-time monitoring?
Yes! Seismo is designed for operational real-time monitoring. You can connect it to various data sources and set up automated monitoring with customizable update intervals.
Q: How do I interpret the alert levels?
Each alert level has specific criteria and recommended actions. See the Alert System section for details. Always combine Seismo alerts with other information sources and expert judgment.
Q: Is Seismo suitable for all tectonic settings?
Seismo has been tested in subduction zones, transform boundaries, and intraplate regions. Performance is best in subduction zones (85-90% accuracy) and moderate in intraplate settings (75-85% accuracy). Regional calibration may improve results.
Troubleshooting
Common Issues
Installation fails with dependency errors
Try creating a fresh virtual environment and installing dependencies separately:
python -m venv seismo_env
source seismo_env/bin/activate # On Windows: seismo_env\Scripts\activate
pip install --upgrade pip
pip install numpy scipy pandas
pip install seismo-framework
Data loading errors
Ensure your data files are in the correct format. Seismo accepts:
- CSV files with standard column names
- ObsPy-compatible earthquake catalogs
- GPS/GNSS data in standard formats (RINEX, etc.)
Low probability values
If all probabilities are near zero, check:
- Parameter values are being calculated correctly
- Data quality and completeness
- Regional configuration matches your study area
- Baseline statistics are properly established
Contributing
We welcome contributions from the community! Here's how you can help improve Seismo:
Ways to Contribute
- Report bugs: Open an issue on GitLab
- Suggest features: Describe new functionality you'd like to see
- Submit code: Fork the repository and submit merge requests
- Improve documentation: Help us make the docs clearer
- Share case studies: Tell us about your implementation
Development Setup
# Fork and clone the repository
git clone https://gitlab.com/your-username/seismo.git
cd seismo
# Create development environment
python -m venv venv
source venv/bin/activate
# Install in development mode with all extras
pip install -e ".[dev,test,docs]"
# Run tests
pytest
# Build documentation
cd docs
make html
Code Guidelines
- Follow PEP 8 style guidelines
- Write docstrings for all public functions and classes
- Add unit tests for new functionality
- Update documentation as needed
- Keep commits focused and write clear commit messages
Contact & Support
For questions, collaboration opportunities, and technical support, please reach out through the following channels:
👤 Principal Investigator
Samir Baladi
Interdisciplinary AI Researcher
Lead Developer
🏛️ Affiliation
Ronin Institute
Rite of Renaissance
Independent Research Scholar
For technical inquiries, collaboration proposals, and research discussions
Online Resources
Research Areas
- Seismic Monitoring & Earthquake Forecasting
- Multi-Parameter Geophysical Integration
- Risk Assessment & Early Warning Systems
- Machine Learning Applications in Seismology
- Dynamical Systems Analysis
- Operational Earthquake Prediction
📚 Citing Seismo
If you use Seismo in your research, please cite:
@software{baladi2026seismo,
author = {Baladi, Samir},
title = {Seismo: Real-Time Earthquake Monitoring Through
Multi-Parameter Geophysical Integration},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.18563973},
url = {https://doi.org/10.5281/zenodo.18563973}
}
Community Guidelines
We are committed to fostering an inclusive and respectful community. When participating in discussions or contributing to the project, please:
- Be respectful and constructive in all communications
- Welcome newcomers and help others learn
- Focus on what is best for the community and science
- Show empathy towards other community members
- Accept constructive criticism gracefully
💬 Need Help?
The fastest way to get help is to:
- Check the FAQ and Troubleshooting sections
- Search existing issues on GitLab
- Open a new issue with a detailed description of your problem
- For urgent matters, contact via email
License
Seismo is released under the MIT License, making it free to use for both academic and commercial purposes.
MIT License
Copyright (c) 2026 Samir Baladi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
© 2026 Seismo Framework. All rights reserved