Stochastic Earthquake Set

This notebook demonstrates how to convert a Stochastic Event Set (SES), that is a set of ruptures describing the potential seismicity occurring within a certain period of time according to a PSHA input model, generated by the OpenQuake (OQ) Engine event-based PSHA calculation workflow, into a catalogue format compatible with the Hazard Modeller’s Toolkit (HMTK) [1] (for a general description of the HMTK please refer to the Data Format section.

Descriptions of the SES event and rupture files that will be defined as inputs here are given in Data Format section.

[1]:
import os
import pandas as pd
from openquake.man.ses_utils.ses_cat import build_hmtk_ses_catalogue

Here, we use build_hmtk_ses_catalogue function that is available in the module openquake.man.ses_utils.ses_cat to transform raw SES event and SES rupture into an HMTK-formatted catalogue.

Paths to the files produced by the OQ Engine - Usually use the following command: oq engine --eos <calculation ID>

[2]:
events = "../data/output-241-events_62.csv"
ruptures = "../data/output-244-ruptures_62.csv"

output_dir = os.path.join("..", "output", "ses_cat")
if not os.path.exists(output_dir):
    os.makedirs(output_dir)
output = os.path.join(output_dir, "hmtk_sample_catalogue.csv")
[3]:
result = build_hmtk_ses_catalogue(events, ruptures, output)
print(f"Done!\n\nSaved to: {result}")
Done!

Saved to: ../output/ses_cat/hmtk_sample_catalogue.csv

Now you have an HMTK-formatted earthquake catalogue. Following the next tutorial (Catalogue), you might evaluate the catalogue.