Skip to main content

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.

Ziyaretçi Sayısı

Proje Metrikleri

Son yerel dogrulama:

  • Surum: 2.0.0
  • Test komutu: python -m pytest
  • Coverage komutu: python -m pytest --cov=selection_service --cov-report=term-missing
  • Test sonucu: 458 passed
  • Toplam coverage: 84%
  • Dogrulama ortami: Python 3.11.15, pytest 9.1.1, pytest-cov 7.1.0 (CI: Python 3.10-3.13)

Paket ve Import Adi

Paket kurulum adi:

pip install earthquake-selection

FDSN provider'i (ObsPy tabanli) opsiyoneldir; kullanacaksaniz:

pip install "earthquake-selection[fdsn]"

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 SearchCriteria modeli 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
  • Provider'lar arasi ayni deprem/kayit tekrarinin tespiti: EVENT_GROUP
  • TBDY uygunluk raporu: kayit sayisi ve ayni depremden en fazla 3 kayit (report["compliance"])
  • 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.earthquake_api import EarthquakeAPI
from selection_service.enums.enums import DesignCode, ProviderName
from selection_service.processing.criteria import ScoringWeights, SearchCriteria, SelectionConfig
from selection_service.processing.strategies import 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.criteria 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_BREAKDOWN
  • SELECTION_STATUS
  • SELECTION_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 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for earthquake-selection 2.0.0
File Size Uploaded
earthquake_selection-2.0.0.tar.gz 1.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for earthquake-selection 2.0.0
File Interpreter ABI Platform
earthquake_selection-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.4 MB

Release files / earthquake_selection-2.0.0.tar.gz

Download URL earthquake_selection-2.0.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
7affea3f32c52b71115331a6fd4b66e1854aaa301567121b3b3a4177bd509ff3
BLAKE2b-256 checksum
How to use checksums
0194a92a9dd25f7601c9bc4746ee4b762aa7c0bd9d8e2cd248d37e086c1b03bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 3, 2026.

Transparency log

Release files / earthquake_selection-2.0.0-py3-none-any.whl

Download URL earthquake_selection-2.0.0-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2c243a32d5840c0ff7fe84ec44563b4ba91f1042036decd558f0114211d367a8
BLAKE2b-256 checksum
How to use checksums
f422f3899e61cde227ce8f6e0dfdf6aae178ec64f34f0a052342cd953b00166e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

2.3.0

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

This release

2.0.0 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page