Declustering
Declustering is a fundamental preprocessing step in Probabilistic Seismic Hazard Analysis (PSHA) that aims to purge dependent earthquakes (aftershocks, foreshocks, and swarm-type seismicity) from earthquake catalogues, leaving only independent earthquakes (mainshocks) for analysis. This script shows three different space-time windowing declustering methods available here.
[1]:
import os
from openquake.hmtk.parsers.catalogue.csv_catalogue_parser import CsvCatalogueParser, CsvCatalogueWriter
from openquake.hmtk.seismicity.declusterer.dec_gardner_knopoff import GardnerKnopoffType1
from openquake.hmtk.seismicity.declusterer.distance_time_windows import GardnerKnopoffWindow, GruenthalWindow, UhrhammerWindow
The required input is briefly described below. For more detailed information, please see Data Format section.
catalogue (str): Path to the HMTK-formatted CSV catalogue.
[2]:
# creating output file to save outputs
output_dir = os.path.join("..", "output", "declustering_out")
os.makedirs(output_dir, exist_ok=True)
[3]:
catalogue = CsvCatalogueParser("../data/cat_it.csv").read_file()
catalogue.sort_catalogue_chronologically()
Catalogue Attribute source_cat is not a recognised catalogue key
Catalogue Attribute depth_orig is not a recognised catalogue key
Catalogue Attribute winGT_fs01 is not a recognised catalogue key
Catalogue Attribute winGK_fs01 is not a recognised catalogue key
Catalogue Attribute rb_rfact10 is not a recognised catalogue key
Catalogue Attribute rb_rfact20 is not a recognised catalogue key
Catalogue Attribute rb_rfact30 is not a recognised catalogue key
Catalogue Attribute Date is not a recognised catalogue key
Gardner-Knopoff (GK)
The Gardner and Knopoff (1974) (GK) method, derived empirically from Californian seismicity, is one of the well-known and popular windowing techniques. The implemented GK method might be used as follows:
[4]:
output_file_path = os.path.join(output_dir, "catalogue_gk.csv")
config = {"time_distance_window": GardnerKnopoffWindow(), "fs_time_prop": 0.25}
_, cluster_flag = GardnerKnopoffType1().decluster(catalogue, config)
# Purge and Save
catalogue.purge_catalogue(cluster_flag == 0)
CsvCatalogueWriter(output_file_path).write_file(catalogue)
print(f"Done! Remaining events: {catalogue.get_number_events()}")
print(f"File saved to: {os.path.abspath(output_file_path)}")
Done! Remaining events: 4530
File saved to: /Users/fahrettinkuran/quakeT/openquake/quaket/output/declustering_out/catalogue_gk.csv
Grünthal (GR)
The Grünthal (1986) (GR) method is another windowing technique shown in this notebook that is conceptually similar to GK but modifies the empirical parameters for improved representation. The implemented GR method might be used as follows:
[5]:
output_file_path = os.path.join(output_dir, "catalogue_gr.csv")
config = {"time_distance_window": GruenthalWindow(), "fs_time_prop": 0.25}
_, cluster_flag = GardnerKnopoffType1().decluster(catalogue, config)
# Purge and Save
catalogue.purge_catalogue(cluster_flag == 0)
CsvCatalogueWriter(output_file_path).write_file(catalogue)
print(f"Done! Remaining events: {catalogue.get_number_events()}")
print(f"File saved to: {os.path.abspath(output_file_path)}")
Done! Remaining events: 3868
File saved to: /Users/fahrettinkuran/quakeT/openquake/quaket/output/declustering_out/catalogue_gr.csv
Uhrhammer (UH)
The Uhrhammer (1985) (UH) method is also another windowing technique utilized in this notebook. The implemented UH method might be used as follows:
[6]:
output_file_path = os.path.join(output_dir, "catalogue_uh.csv")
config = {"time_distance_window": UhrhammerWindow(), "fs_time_prop": 0.25}
_, cluster_flag = GardnerKnopoffType1().decluster(catalogue, config)
# Purge and Save
catalogue.purge_catalogue(cluster_flag == 0)
CsvCatalogueWriter(output_file_path).write_file(catalogue)
print(f"Done! Remaining events: {catalogue.get_number_events()}")
print(f"File saved to: {os.path.abspath(output_file_path)}")
Done! Remaining events: 3865
File saved to: /Users/fahrettinkuran/quakeT/openquake/quaket/output/declustering_out/catalogue_uh.csv