SelectionEarthquake
Deprem kayitlarini AFAD ve PEER gibi veri saglayicilardan cekip ortak kolona normalize eden, arama kriterlerine gore puanlayan ve TBDY 2018 odakli kayit secimi yapan Python kutuphanesi.
Proje Metrikleri
Son yerel dogrulama:
- Surum:
1.2.1 - Test komutu:
python -m pytest - Coverage komutu:
python -m pytest --cov=selection_service --cov-report=term-missing - Test sonucu:
414 passed - Toplam coverage:
81% - Dogrulama ortami: Python
3.13.5, pytest8.4.2, pytest-cov7.0.0
Paket ve Import Adi
Paket kurulum adi:
pip install earthquake-selection
Python import paketi:
import selection_service
Yerel gelistirme kurulumu:
git clone https://github.com/muhammedsural/SelectionEarthquake.git
cd SelectionEarthquake
pip install -e ".[dev]"
Ozellikler
- Coklu veri saglayici destegi: AFAD, PEER
- Ortak
SearchCriteriamodeli ve provider bazli kriter donusumu - Pipeline tabanli sorgu, birlestirme, puanlama ve secim akisi
- TBDY 2018 icin Gaussian tabanli secim stratejisi
- Kriter bazli skor kirilimi:
SCORE_BREAKDOWN - Her kayit icin secim/eleme aciklamasi:
SELECTION_STATUS,SELECTION_REASON - CSV, JSON rapor ve Pandas DataFrame ciktilari
- AFAD icin waveform indirme destegi
- Pytest tabanli test altyapisi
Hizli Baslangic
from selection_service.core.EarthquakeApi import EarthquakeAPI
from selection_service.enums.Enums import DesignCode, ProviderName
from selection_service.processing.Selection import (
ScoringWeights,
SearchCriteria,
SelectionConfig,
TBDYSelectionStrategy,
)
config = SelectionConfig(
design_code=DesignCode.TBDY_2018,
num_records=11,
max_per_station=3,
max_per_event=3,
min_score=55,
)
strategy = TBDYSelectionStrategy(config=config)
criteria = SearchCriteria(
start_date="2000-01-01",
end_date="2025-09-05",
min_magnitude=7.0,
max_magnitude=8.0,
min_vs30=300,
max_vs30=400,
mechanisms=["StrikeSlip"],
weights=ScoringWeights.from_preset("tbdy_2018_record_selection"),
)
api = EarthquakeAPI(
provider_names=[ProviderName.PEER],
strategies=[strategy],
use_cache=True,
)
result = api.run_sync(criteria=criteria, strategy_name=strategy.get_name())
if result.success:
selected = result.value.selected_df
report = result.value.report
print(selected[["PROVIDER", "RSN", "EVENT", "MAGNITUDE", "SCORE", "SELECTION_REASON"]].head())
print(report["selection_summary"])
else:
print(result.error)
Komut Satiri Ornegi
Kurulumdan sonra uc uca arama, secim, CSV ve JSON rapor uretimi:
quake-sel --providers peer --num-records 11 --report-path selection_report.json --selected-csv selected_records.csv
AFAD ile waveform indirme akisini da baslatmak icin:
quake-sel --providers afad --download-waveforms --export-type mseed
AFAD API ag baglantisi gerektirir. PEER veri seti lokal flatfile ile calisir ve waveform indirme desteklemez; download adiminda desteklenmeyen provider atlanir.
Scoring Presetleri
Hazir agirlik setleri ScoringWeights.from_preset(...) ile secilir:
balanced: Varsayilan dengeli agirliklar.tbdy_2018_record_selection: Magnitude, mesafe, Vs30 ve mekanizmayi one cikarir.site_response: Vs30, sure ve siddet olcutlerine daha fazla agirlik verir.
Preset aciklamalari:
from selection_service.processing.Selection import ScoringWeights
print(ScoringWeights.preset_descriptions())
Rapor Izlenebilirligi
PipelineResult.report asagidaki ek alanlari icerir:
selection_summary: Secilen/reddedilen kayit sayilari ve eleme gerekceleri.score_breakdown: Secilen kayitlar icin kriter bazli hedef, deger, agirlik ve katki.
scored_df tum kayitlar icin su kolonlari tasir:
SCORE_BREAKDOWNSELECTION_STATUSSELECTION_REASON
Mimari
selection_service/
core/ Pipeline, API facade, config, error types
services/ Query, provider registry, waveform download orchestration
providers/ AFAD, PEER, cache, provider interfaces
processing/ SearchCriteria, selection strategy, mappers, Result
utility/ Data file loading helpers
data/ Packaged CSV/XLSX data
tests/ pytest suite
examples/ Usage examples
Test
pytest
Pytest ayarlari tek kaynak olarak pyproject.toml icindedir.
Yol Haritasi
- FDSN waveform sonuclarini dosyaya aktarma ve secim akisiyla iliskilendirme.
- Eurocode stratejisini gercek kurallarla doldur veya deneysel olarak etiketle.
- Rapor ciktilarini HTML/PDF formatina genislet.
Lisans
MIT License
Metadata
Release files for earthquake-selection 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| earthquake_selection-1.2.1.tar.gz | 1.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| earthquake_selection-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.4 MB
Release files / earthquake_selection-1.2.1.tar.gz
| Download URL | earthquake_selection-1.2.1.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4dc816ab3be974a06bc06ab0983d2f9ac29e261740668851cd54c406672faf0f
|
|
BLAKE2b-256 checksum How to use checksums |
4c778f8f1240fee40323f8caae4008bcb9e65633999202c690eb28cea5738209
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.
Transparency logRelease files / earthquake_selection-1.2.1-py3-none-any.whl
| Download URL | earthquake_selection-1.2.1-py3-none-any.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07ac046adb80ae299a2d63051fefc28550353963f85a3654dd5b0902f9561563
|
|
BLAKE2b-256 checksum How to use checksums |
c35d61decbc10a6f15e48a91ea844484d019e4f17129ad9a8d260799a9002dfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.
Transparency log