How smousavi05/eqtransformer works
Main Components
a. Data Ingestion & Storage
• Downloader (EQTransformer/utils/downloader.py) fetches continuous seismic waveforms.
• HDF5 Maker (EQTransformer/utils/hdf5_maker.py) packages raw traces into HDF5.
• Sample Data & Models directory (ModelsAndSampleData/) holds .h5 model files, .hdf5 datasets, .npy indices.
b. Preprocessing & Utilities
• Plotting (EQTransformer/utils/plot.py) for visualization.
• Associator (EQTransformer/utils/associator.py) for simple phase association.
c. Core Engine
• Trainer (EQTransformer/core/trainer.py) builds and trains new models in TensorFlow.
• Tester (EQTransformer/core/tester.py) evaluates model performance on test sets.
• Predictor (EQTransformer/core/predictor.py) applies models to single‐station data.
• MSEED Predictor (EQTransformer/core/mseed_predictor.py) batches prediction on miniSEED directories.
• Utils (EQTransformer/core/EqT_utils.py) shared neural‐network utilities.
d. External Interfaces
• Python API (module entry points exposed by setup.py).
• Jupyter notebooks (examples/ and EQTransformerviaGoogleColab.ipynb) demonstrating workflows.
• CLI hooks (if configured in setup.py) or direct module calls.
e. Development & Deployment
• Tests (tests/*.py) for unit and integration testing.
• CI Pipeline (.github/workflows/python-publish.yml) automates linting, tests, packaging, publishing.
• Documentation (docs/) generated via Sphinx.
Architectural Patterns & Principles
• Modular layered architecture:
• “Utils” layer (data download & formatting)
• “Core” layer (AI model lifecycle: train, test, predict)
• “Interface” layer (Jupyter/CLI)
• Data‐pipeline pattern: raw data → preprocessing → model training/prediction → postprocessing.
• Separation of concerns: each module has one responsibility.
• Use of external libraries: Obspy (waveform I/O), TensorFlow (modeling), HDF5 (storage).